# Connections

The connection endpoints allow you to manage AI provider connections programmatically.

## Available Endpoints

| Method | Endpoint                                                                 | Description                   |
| ------ | ------------------------------------------------------------------------ | ----------------------------- |
| GET    | `/umbraco/ai/management/api/v1/connections`                              | List all connections          |
| GET    | `/umbraco/ai/management/api/v1/connections/{connectionIdOrAlias}`        | Get a specific connection     |
| POST   | `/umbraco/ai/management/api/v1/connections`                              | Create a connection           |
| PUT    | `/umbraco/ai/management/api/v1/connections/{connectionIdOrAlias}`        | Update a connection           |
| DELETE | `/umbraco/ai/management/api/v1/connections/{connectionIdOrAlias}`        | Delete a connection           |
| POST   | `/umbraco/ai/management/api/v1/connections/{connectionIdOrAlias}/test`   | Test a connection             |
| GET    | `/umbraco/ai/management/api/v1/connections/capabilities`                 | List available capabilities   |
| GET    | `/umbraco/ai/management/api/v1/connections/capabilities/{capability}`    | Get connections by capability |
| GET    | `/umbraco/ai/management/api/v1/connections/{connectionIdOrAlias}/models` | Get available models          |

## Connection Model

{% code title="Connection Response" %}

```json
{
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "alias": "openai-prod",
    "name": "OpenAI Production",
    "providerId": "openai",
    "isActive": true,
    "dateCreated": "2024-01-15T10:30:00Z",
    "dateModified": "2024-01-15T10:30:00Z",
    "settings": {
        "apiKey": "sk-***",
        "organization": null
    }
}
```

{% endcode %}

### Properties

| Property       | Type     | Description                   |
| -------------- | -------- | ----------------------------- |
| `id`           | guid     | Unique identifier             |
| `alias`        | string   | Unique alias for lookups      |
| `name`         | string   | Display name                  |
| `providerId`   | string   | ID of the provider            |
| `isActive`     | boolean  | Whether connection is enabled |
| `dateCreated`  | datetime | Creation timestamp            |
| `dateModified` | datetime | Last modification timestamp   |
| `settings`     | object   | Provider-specific settings    |

{% hint style="info" %}
Settings are returned with sensitive values masked (for example, API keys show as `sk-***`).
{% endhint %}

## In This Section

{% content-ref url="/pages/H72XBZB5X3sqJwW41fSi" %}
[List Connections](/ai-in-umbraco/management-api/connections/list.md)
{% endcontent-ref %}

{% content-ref url="/pages/8860jDky9CHs2vjQNcLW" %}
[Get Connection](/ai-in-umbraco/management-api/connections/get.md)
{% endcontent-ref %}

{% content-ref url="/pages/o7cVaHsLCMc3wo2PKj9F" %}
[Create Connection](/ai-in-umbraco/management-api/connections/create.md)
{% endcontent-ref %}

{% content-ref url="/pages/Hz0OuKSeKMAo9TyEiMvL" %}
[Update Connection](/ai-in-umbraco/management-api/connections/update.md)
{% endcontent-ref %}

{% content-ref url="/pages/IGuqNQFRKjenFiPMBI3v" %}
[Delete Connection](/ai-in-umbraco/management-api/connections/delete.md)
{% endcontent-ref %}

{% content-ref url="/pages/RpT9G9qjqO6GSVhG0Bo5" %}
[Test Connection](/ai-in-umbraco/management-api/connections/test.md)
{% endcontent-ref %}

{% content-ref url="/pages/MeXKs36NsXlEvsna3iuJ" %}
[List Capabilities](/ai-in-umbraco/management-api/connections/capabilities.md)
{% endcontent-ref %}

{% content-ref url="/pages/XPWRaBY7VC0swQg8ztBO" %}
[Get Models](/ai-in-umbraco/management-api/connections/models.md)
{% endcontent-ref %}


---

# Agent Instructions: 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:

```
GET https://docs.umbraco.com/ai-in-umbraco/management-api/connections.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
