# Change an AI action

```http
PATCH https://trydimmi.com/api/v1/ai/actions/{action}
```

## Authorization

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

## Path parameters

- `action` (string, required): Id of the AI agent action, starting with aac_, such as aac_01jx2m8k4t. Find it with GET /ai/actions.

## Body

- `agents` (string[]): dimmi (answers customers) and operator (works for the team). Default dimmi only.
- `approval` (string): none, teammate or admin: who on the team must approve a write before it runs.
- `approval_timeout_minutes` (integer): A length of time in minutes, such as 30.
- `body_encoding` (string): How the request body is sent: "json" or "form". Left out, it is "json". With "form" the body_template must be a flat object of plain values, such as {"email": "{contact.email}"}.
- `body_template` (any): JSON body sent with the request, only for POST, PUT and PATCH. Values may hold placeholders {input.x}, {contact.x} or {connection.x}, such as {"order_id": "{input.order_id}", "reason": "{input.reason}"}. Send null to clear the body.
- `bound_arguments` (object): For an action on an MCP connection: arguments you fix yourself, hidden from the model and laid over what the model sends. An object of argument name to value; values may hold placeholders, such as {"account_id": "{connection.account_id}", "limit": 10}.
- `channels` (string[]): Where dimmi may take it, such as widget. Default widget.
- `confirmation` (string): none, or customer to have the customer confirm a write first (the default).
- `connection_id` (string): Id of the action connection, starting with acn_, such as acn_01jx2m8k4t. Find it with GET /ai/action-connections.
- `description` (string): When to use the action, 10 to 1024 characters; the model reads it to decide.
- `error_message_path` (string): Dotted path to the error message in the other system's JSON response, read when a call fails. Letters, digits, _ , - and # joined by dots, at most 200 characters, such as "error.message".
- `headers` (object): Extra HTTP headers sent with the request, as an object of header name to value, at most 10, such as {"X-Api-Version": "2024-01"}. Not allowed: Host, Cookie, Content-Length, Content-Type, Transfer-Encoding, Authorization, Idempotency-Key, User-Agent, Connection and any name starting with Dimmi-.
- `input_schema` (any): JSON Schema of what the model fills in.
- `mcp_tool_name` (string): The MCP server's tool this action calls, on an mcp connection.
- `method` (string): HTTP method of an action on an http connection: GET, POST, PUT, PATCH or DELETE (lowercase is accepted). Left out on create, it is GET. Not used for an action on an mcp connection. Such as "POST".
- `name` (string): Tool name the model sees: 3 to 48 lowercase letters, digits and underscores.
- `path_template` (string): Path under the connection's base url; placeholders are {input.x}, {contact.email}, {contact.external_id}, {contact.attr.key} and {connection.x}.
- `query` (object): Words to search for, such as refund.
- `response_fields` (object[]): Which values of the response the model reads, at most 30; left empty, it reads the whole response. A list of {name, path, description}: name is lowercase letters, digits and _, path is a dotted path into the JSON, such as [{"name": "status", "path": "order.status", "description": "Order status"}].
  - `description` (string): An optional short note telling the AI what this value means, such as The order's shipping status.
  - `name` (string, required): The name the AI reads this value under: lowercase letters, digits and underscores, starting with a letter, at most 48 characters, used only once in the list, such as order_status.
  - `path` (string, required): Dotted path to the value in the other system's JSON response: letters, digits, _ and - joined by dots, a number for a list position and # to take every item, at most 200 characters, such as data.order.status or items.#.name.
- `response_max_bytes` (integer): A size in bytes, such as 65536.
- `restore_version_id` (string): Id of the saved version, starting with prcv or srsv_, such as prcv_01jx2m8k4t. Find it with the matching versions list.
- `side_effect` (string): read runs at once; write changes something and may wait for agreement. Default write.
- `status` (string): When creating: has no effect, a new action always starts as a draft and goes live through POST /ai/actions/{action}/publications, so leave it out. When updating: "disabled" or "published" switches an action published before off or back on; "published" is refused for an action never published. Such as "disabled".
- `timeout_ms` (integer): A length of time in milliseconds, such as 10000 for ten seconds.
- `title` (string): The title of the action.

## Response 200 (OK)

- `data` (object, required)
  - `agents` (string[] | null, required): Which agents may use the action: dimmi (answers customers), operator (works for the team), or both.
  - `approval` (string, required): Who on the team must approve a call before it runs: none, teammate or admin. Only a write action can need approval.
  - `approval_timeout_minutes` (integer, required): Minutes a call waits for a teammate's approval before it expires, from 1 to 10080. Defaults to 60.
  - `body_encoding` (string, required): How the request body is sent: json or form.
  - `body_template` (any, required): The request body as JSON, with placeholders such as {input.order_id}, {contact.email} or {connection.region} filled in at call time. Null when the request has no body.
  - `bound_arguments` (object, required): Arguments of an MCP tool that the admin fills in and the model never sees, by argument name. Values may hold placeholders such as {contact.email}. Empty when none.
  - `channels` (string[] | null, required): Channels on which the action is offered, such as ["widget"]. Defaults to the widget alone.
  - `confirmation` (string, required): Whether the customer must confirm a call before it runs: none or customer. Only a write action can ask for it.
  - `connection_id` (string, required): Id of the connection the action sends its requests through, such as acn_... Send it wherever an action connection is asked for.
  - `created_at` (string, required): When it was created, as an RFC 3339 time, such as 2026-01-31T09:00:00Z.
  - `description` (string, required): What the action does, written for the model that decides when to call it. 10 to 1024 characters.
  - `error_message_path` (string | null, required): Dotted path into a failed response's body where the error message is found, such as error.message. Null when none is set.
  - `has_unpublished_changes` (boolean, required): True when this working copy differs from the published version, or nothing was published yet. The agent only runs the published version.
  - `headers` (object, required): Extra request headers by name. Values may hold placeholders such as {input.locale}. Empty when none.
  - `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.
  - `input_schema` (any, required): JSON Schema object of the arguments the model must give when it calls the action.
  - `kind` (string, required): How the action runs: http sends a request to an API, mcp_tool calls a tool on an MCP server.
  - `last_test_response` (any): The result of the last successful live test of the action, kept to help map response fields. Left out when there is none.
  - `mcp_tool_name` (string | null, required): Name of the tool called on the MCP server. Null for an http action.
  - `method` (string | null, required): HTTP method of the request: GET, POST, PUT, PATCH or DELETE. Null for an mcp_tool action.
  - `name` (string, required): The tool name the model calls the action by: 3 to 48 lowercase letters, digits and underscores, such as lookup_order.
  - `object` (string, required): The kind of record this is, the same for every record of its kind, such as article.
  - `path_template` (string | null, required): Path added to the connection's base URL, with placeholders, such as /orders/{input.order_id}. Null for an mcp_tool action.
  - `published_version` (object, required)
    - `created_at` (string, required): When it was created, as an RFC 3339 time, such as 2026-01-31T09:00:00Z.
    - `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.
    - `number` (integer, required): The published version's number within its action, starting at 1.
  - `query` (object, required): Query string parameters by name. Values may hold placeholders such as {input.status}. Empty when none.
  - `response_fields` (object[] | null, required): Which values of the response the model gets to read, each a name and a dotted path into the body. Empty when nothing is mapped.
    - `description` (string): An optional short note telling the AI what this value means, such as The order's shipping status.
    - `name` (string, required): The name the AI reads this value under: lowercase letters, digits and underscores, starting with a letter, at most 48 characters, used only once in the list, such as order_status.
    - `path` (string, required): Dotted path to the value in the other system's JSON response: letters, digits, _ and - joined by dots, a number for a list position and # to take every item, at most 200 characters, such as data.order.status or items.#.name.
  - `response_max_bytes` (integer, required): Largest response body the action accepts, in bytes, from 1024 to 262144. Defaults to 65536.
  - `side_effect` (string, required): Whether a call only reads data (read) or changes something (write). A read runs at once; a write may wait for confirmation or approval.
  - `source` (string, required): How the action was made: dashboard, api or mcp_sync (created from an MCP server's tool list).
  - `status` (string, required): Where the action stands: draft (never published), published (the agent can use it) or disabled (switched off).
  - `timeout_ms` (integer | null, required): How long a call may take, in milliseconds, from 1000 to 15000. Null uses the connection's timeout.
  - `title` (string, required): Short name people see for the action, up to 80 characters, such as Look up an order.
  - `updated_at` (string, required): When it last changed, as an RFC 3339 time, such as 2026-01-31T09:00:00Z.
  - `warnings` (string[] | null, required): Notes about the action's definition. Currently always an empty list.

## 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/actions/{action}' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "agents": [
    "<string>"
  ],
  "approval": "<string>",
  "approval_timeout_minutes": 123,
  "body_encoding": "<string>",
  "body_template": null,
  "bound_arguments": {
    "<key>": null
  },
  "channels": [
    "<string>"
  ],
  "confirmation": "<string>",
  "connection_id": "<string>",
  "description": "<string>",
  "error_message_path": "<string>",
  "headers": {
    "<key>": "<string>"
  },
  "input_schema": null,
  "mcp_tool_name": "<string>",
  "method": "<string>",
  "name": "<string>",
  "path_template": "<string>",
  "query": {
    "<key>": "<string>"
  },
  "response_fields": [
    {
      "description": "<string>",
      "name": "<string>",
      "path": "<string>"
    }
  ],
  "response_max_bytes": 123,
  "restore_version_id": "<string>",
  "side_effect": "<string>",
  "status": "<string>",
  "timeout_ms": 123,
  "title": "<string>"
}'
```

## Example response

```json
{
  "data": {
    "agents": [
      "<string>"
    ],
    "approval": "<string>",
    "approval_timeout_minutes": 123,
    "body_encoding": "<string>",
    "body_template": null,
    "bound_arguments": {
      "<key>": null
    },
    "channels": [
      "<string>"
    ],
    "confirmation": "<string>",
    "connection_id": "<string>",
    "created_at": "2026-11-01T09:30:00Z",
    "description": "<string>",
    "error_message_path": "<string>",
    "has_unpublished_changes": true,
    "headers": {
      "<key>": "<string>"
    },
    "id": "<string>",
    "input_schema": null,
    "kind": "<string>",
    "last_test_response": null,
    "mcp_tool_name": "<string>",
    "method": "<string>",
    "name": "<string>",
    "object": "<string>",
    "path_template": "<string>",
    "published_version": {
      "created_at": "2026-11-01T09:30:00Z",
      "id": "<string>",
      "number": 123
    },
    "query": {
      "<key>": "<string>"
    },
    "response_fields": [
      {
        "description": "<string>",
        "name": "<string>",
        "path": "<string>"
      }
    ],
    "response_max_bytes": 123,
    "side_effect": "<string>",
    "source": "<string>",
    "status": "<string>",
    "timeout_ms": 123,
    "title": "<string>",
    "updated_at": "2026-11-01T09:30:00Z",
    "warnings": [
      "<string>"
    ]
  }
}
```

---

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