---
title: "Attach an action"
method: POST
path: "/actions/attach"
---

# Attach an action

`POST /actions/attach`

## Headers

- `Authorization` string, required

## Request body

- object
  - `model_id` string, required — The ID of the agent you want to attach an action to.
  - `actions` string[] — To find an action's ID, go to its page in your Synthflow dashboard.
  - `items` ActionsAttachPostRequestBodyContentApplicationJsonSchemaItemsItems[] — Batch attach payload with per-action attachment configuration.
    - `action_id` string — ID of the action to attach. Provide either `action_id` or `slug`.
    - `slug` string — Slug of the action to attach. Provide either `action_id` or `slug`.
    - `attachment_type` 'before' | 'during' | 'after' — When this action is available in the conversation. Optional and defaults to `during` when omitted or null.
    - `trigger_condition` string, nullable — Per-assistant 'When to use this Action' condition describing when the agent should call this action. Currently applies to custom actions. Omit or send null to leave it unchanged; send an empty string to clear it.
    - `input_variables_mapping` ActionsAttachPostRequestBodyContentApplicationJsonSchemaItemsItemsInputVariablesMappingItems[] — Per-assistant mapping for this action's input variables.
      - `variable_name` string, required — Input variable name defined in the action.
      - `source` 'llm' | 'hardcoded', required — Source used to populate the variable.
      - `hardcoded_value` string, nullable — Value used when source is `hardcoded`.
      - `llm_config` ActionsAttachPostRequestBodyContentApplicationJsonSchemaItemsItemsInputVariablesMappingItemsLlmConfig
        - `description` string, nullable — Description of the variable.
        - `example` string, nullable — Example of the variable.
        - `required` boolean, nullable — Whether the variable is required.

## Response `200`

200

- AttachActionResponse200
  - `status` string
  - `response` ActionsAttachPostResponsesContentApplicationJsonSchemaResponse

## Other responses

- `400` — 400

---

[API](https://skmtc.dev/synthflow/apis/platform-api.md) · [All operations](https://skmtc.dev/synthflow/apis/platform-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/synthflow/platform-api/revisions/6976456ad422/schema)
