> For the complete documentation index, see [llms.txt](https://docs.carto.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.carto.com/carto-for-developers/reference/carto-api/resources-api/connections.md).

# Connections

A connection stores the credentials CARTO uses to reach your data warehouse. Everything else — maps, workflows, tokens — is scoped to one.

Use these endpoints to provision connections programmatically: onboarding a new team, rotating credentials, or replicating a setup across organizations.

| Endpoint                                | What it does        |
| --------------------------------------- | ------------------- |
| `GET /v3/connections`                   | List connections    |
| `POST /v3/connections`                  | Create a connection |
| `GET /v3/connections/{connectionId}`    | Get a connection    |
| `PATCH /v3/connections/{connectionId}`  | Update a connection |
| `DELETE /v3/connections/{connectionId}` | Delete a connection |

{% hint style="info" %}
These endpoints need an **OAuth Access Token**. See [Authorization](/carto-for-developers/reference/carto-api.md#authorization).
{% endhint %}

## Credentials are write-only

Secrets you send are stored encrypted and are **never returned** by any endpoint. When updating a connection, omit them to keep the stored values.

Each provider takes a different `config` shape — BigQuery, Snowflake, Redshift, PostgreSQL, Databricks and Oracle. The request examples below cover the common authentication method for each.

## Deleting a connection that is in use

Deleting a connection with maps or workflows behind it returns `409`. Pass `targetConnectionId` to move them to another connection of the same provider first — it must belong to the same user and use the same provider.

## Sharing

`privacy` is `private` or `shared`. Sharing requires `sharingScope` — `organization` for everyone, or `specific` with the `groupIds` to share with.

## Endpoints

{% openapi src="<https://openapi.gitbook.com/o/zP3LT2Qhlb5jPWQCfWV3/spec/carto-api>" path="/v3/connections" method="get" %}
<https://openapi.gitbook.com/o/zP3LT2Qhlb5jPWQCfWV3/spec/carto-api>
{% endopenapi %}

{% openapi src="<https://openapi.gitbook.com/o/zP3LT2Qhlb5jPWQCfWV3/spec/carto-api>" path="/v3/connections" method="post" %}
<https://openapi.gitbook.com/o/zP3LT2Qhlb5jPWQCfWV3/spec/carto-api>
{% endopenapi %}

{% openapi src="<https://openapi.gitbook.com/o/zP3LT2Qhlb5jPWQCfWV3/spec/carto-api>" path="/v3/connections/{connectionId}" method="get" %}
<https://openapi.gitbook.com/o/zP3LT2Qhlb5jPWQCfWV3/spec/carto-api>
{% endopenapi %}

{% openapi src="<https://openapi.gitbook.com/o/zP3LT2Qhlb5jPWQCfWV3/spec/carto-api>" path="/v3/connections/{connectionId}" method="patch" %}
<https://openapi.gitbook.com/o/zP3LT2Qhlb5jPWQCfWV3/spec/carto-api>
{% endopenapi %}

{% openapi src="<https://openapi.gitbook.com/o/zP3LT2Qhlb5jPWQCfWV3/spec/carto-api>" path="/v3/connections/{connectionId}" method="delete" %}
<https://openapi.gitbook.com/o/zP3LT2Qhlb5jPWQCfWV3/spec/carto-api>
{% endopenapi %}


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.carto.com/carto-for-developers/reference/carto-api/resources-api/connections.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
