# Change an action connection

```http
PATCH https://trydimmi.com/api/v1/ai/action-connections/{connection}
```

## Authorization

Send an API token as `Authorization: Bearer <token>`.
The token needs: `ai:actions`.

## Path parameters

- `connection` (string, required): Id of the action connection, starting with acn_, such as acn_01jx2m8k4t. Find it with GET /ai/action-connections.

## Body

- `auth_config` (object)
  - `header_name` (string): Needed when auth_type is api_key_header: the name of the HTTP header the key travels in. 1 to 64 letters, digits or hyphens, such as X-Api-Key.
  - `prefix` (string): Only for auth_type bearer: the word put before the token in the Authorization header in place of Bearer, such as Token. Left out, it is Bearer.
  - `query_param` (string): Needed when auth_type is api_key_query: the name of the query parameter the key travels in. 1 to 64 letters, digits or hyphens only (no underscore), such as apikey.
- `auth_type` (string): How the connection signs its requests: "none", "bearer", "api_key_header", "api_key_query" or "basic". api_key_header also needs auth_config.header_name and api_key_query needs auth_config.query_param; "none" clears the stored secret. Such as "bearer".
- `base_url` (string): The https address every action's path is added to; requests can never leave it. A full https address with no credentials, query or fragment, at most 512 characters, such as https://api.example.com.
- `default_headers` (object): Headers sent with every request through this connection, as an object of header name to value, at most 10, values at most 256 characters, such as {"X-Api-Version": "2024-01"}. Not allowed: Authorization, Content-Type, Cookie, Host, User-Agent and names starting with Dimmi-.
- `kind` (string): The connection's kind: "http" for an HTTP API or "mcp" for an MCP server. When creating: needed, and fixed from then on. When updating: it does not change, so leave it out. One of: `http`, `mcp`.
- `name` (string): The name of the action connection, at most 60 characters.
- `password` (string): The password, as text. It is stored encrypted and never shown again.
- `status` (string): "active", or "disabled" to stop every action on the connection. When creating: it has no effect, a new connection always starts active, so leave it out. When updating: switches the connection off or back on; PATCH /ai/action-connections/{connection} is the way to disable one.
- `timeout_ms` (integer): A length of time in milliseconds, such as 10000 for ten seconds.
- `token` (string): The secret bearer token or API key, as text, at most 4096 characters. It is only written: stored encrypted and never returned or shown again.
- `username` (string): The user name for basic auth, sent together with password, at most 256 characters, such as api-user.
- `variables` (object): Named values the connection's actions can use in their templates as {connection.name}, as an object of name to text. At most 20; names are lowercase letters, digits and _, up to 40 characters; values up to 256 characters. Such as {"account_id": "acct_42", "region": "eu"}.

## Response 200 (OK)

- `data` (object, required)
  - `actions_count` (integer, required): How many actions use this connection. Counted in lists; 0 when the connection is read alone.
  - `auth_config` (object, required)
    - `header_name` (string): Needed when auth_type is api_key_header: the name of the HTTP header the key travels in. 1 to 64 letters, digits or hyphens, such as X-Api-Key.
    - `prefix` (string): Only for auth_type bearer: the word put before the token in the Authorization header in place of Bearer, such as Token. Left out, it is Bearer.
    - `query_param` (string): Needed when auth_type is api_key_query: the name of the query parameter the key travels in. 1 to 64 letters, digits or hyphens only (no underscore), such as apikey.
  - `auth_type` (string, required): How requests prove who they are: none, bearer, api_key_header, api_key_query or basic.
  - `base_url` (string, required): The address every request of this connection starts from, such as https://api.example.com, or the MCP server's URL.
  - `created_at` (string, required): When it was created, as an RFC 3339 time, such as 2026-01-31T09:00:00Z.
  - `default_headers` (object, required): Headers sent with every request of this connection, by name. Empty when none.
  - `has_secret` (boolean, required): True when a token or password is stored for the connection. The secret itself is never returned.
  - `id` (string, required): The id of this record. Send it wherever an endpoint asks for this record; never use its name or title in its place.
  - `kind` (string, required): What the connection reaches: http for an HTTP API, mcp for a remote MCP server.
  - `last_error` (string | null, required): Error code of the last failed call or test, such as auth_failed or unavailable. Null when none has failed.
  - `last_error_at` (string | null, required): When a call or test through this connection last failed. Null when none has.
  - `last_success_at` (string | null, required): When a call or test last reached the connection. Null when none has.
  - `name` (string, required): The name the team gave the connection, such as Orders API. Up to 60 characters.
  - `object` (string, required): The kind of record this is, the same for every record of its kind, such as article.
  - `secret_hint` (string | null, required): The last four characters of the stored secret after an ellipsis, such as …9f2c, to tell keys apart. Null when there is no secret or it is under 8 characters.
  - `status` (string, required): Whether the connection can be used: active, error (its actions are not offered until a test passes) or disabled.
  - `status_reason` (string | null, required): Why the connection is in error: host_blocked, or auth after three refused credentials in a row. Null otherwise.
  - `timeout_ms` (integer, required): How long a request may take, in milliseconds, from 1000 to 15000. Defaults to 8000.
  - `tools_synced_at` (string | null, required): When the MCP server's tools were last synced into actions. Null when never synced.
  - `updated_at` (string, required): When it last changed, as an RFC 3339 time, such as 2026-01-31T09:00:00Z.
  - `variables` (object, required): Plain named values that request templates read as {connection.<name>}, such as a region or account id. Not for secrets. Empty when none.

## Response default (Error)

- `code` (string, required): Stable code for programs to tell errors apart, such as validation_failed or internal_error.
- `errors` (object): Each rejected field mapped to its messages. Only present when the input was invalid.
- `message` (string, required): What went wrong, in words safe to show a person.

## Example request

```bash
curl --request PATCH \
  --url 'https://trydimmi.com/api/v1/ai/action-connections/{connection}' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "auth_config": {
    "header_name": "<string>",
    "prefix": "<string>",
    "query_param": "<string>"
  },
  "auth_type": "<string>",
  "base_url": "<string>",
  "default_headers": {
    "<key>": "<string>"
  },
  "kind": "http",
  "name": "<string>",
  "password": "<string>",
  "status": "<string>",
  "timeout_ms": 123,
  "token": "<string>",
  "username": "<string>",
  "variables": {
    "<key>": "<string>"
  }
}'
```

## Example response

```json
{
  "data": {
    "actions_count": 123,
    "auth_config": {
      "header_name": "<string>",
      "prefix": "<string>",
      "query_param": "<string>"
    },
    "auth_type": "<string>",
    "base_url": "<string>",
    "created_at": "2026-11-01T09:30:00Z",
    "default_headers": {
      "<key>": "<string>"
    },
    "has_secret": true,
    "id": "<string>",
    "kind": "<string>",
    "last_error": "<string>",
    "last_error_at": "2026-11-01T09:30:00Z",
    "last_success_at": "2026-11-01T09:30:00Z",
    "name": "<string>",
    "object": "<string>",
    "secret_hint": "<string>",
    "status": "<string>",
    "status_reason": "<string>",
    "timeout_ms": 123,
    "tools_synced_at": "2026-11-01T09:30:00Z",
    "updated_at": "2026-11-01T09:30:00Z",
    "variables": {
      "<key>": "<string>"
    }
  }
}
```

---

Index of all dimmi docs: https://trydimmi.com/llms.txt (full text: https://trydimmi.com/llms-full.txt)
