> For the complete documentation index, see [llms.txt](https://documentation.immuta.com/SaaS/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.immuta.com/SaaS/developer-guides/api-intro/immuta-v2-api.md).

# Immuta V2 API

Learn about managing data sources and policies using the V2 API

## Policy as code benefits

* **Reduces complexity**: The data source API has been simplified to only require the connection information in most instances and one endpoint for all database technologies.
* **Maintains less state**: Whether updating or creating, the same endpoint is used, and the same data is passed. No ids are required, so no additional state is required.
* **Requires fewer steps**: Only an API key is required; no additional authentication step is required before using the API.
* **Integrates with Git**: Define data sources and policies in files that can be tracked in Git and easily pushed to Immuta. Both JSON and YAML are supported for more flexibility. (For example, use YAML to add comments in files.)

## Endpoints and details

All of the API endpoints described below take either JSON or YAML, and the endpoint and payload are the same for both creating and updating data sources, policies, projects, and purposes.

* [`/api/v2/data`](/SaaS/developer-guides/api-intro/immuta-v2-api/data-source.md): Create data sources
* `/api/v2/policy`: Create policies
  * [Data policies](/SaaS/developer-guides/api-intro/immuta-v2-api/policies.md)
  * [Subscription policies](/SaaS/developer-guides/api-intro/immuta-v2-api/subscription-policy.md)
* [`/api/v2/project`](/SaaS/developer-guides/api-intro/immuta-v2-api/projects.md): Create projects
* [`/api/v2/purpose`](/SaaS/developer-guides/api-intro/immuta-v2-api/purposes.md): Create purposes


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://documentation.immuta.com/SaaS/developer-guides/api-intro/immuta-v2-api.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
