# Asignar acción a agente

**POST**\
`https://api.anunzi.net/v2/actions/attach`

Attach one or more custom actions to an AI assistant in your Anunzi environment.

***

#### **Body Parameters**

| Parameter  | Type             | Required | Description                                                      |
| ---------- | ---------------- | -------- | ---------------------------------------------------------------- |
| `model_id` | string           | Yes      | The Model ID of the assistant to which actions will be attached. |
| `actions`  | array of strings | Yes      | A list of Action IDs that will be attached to the assistant.     |

***

#### **Example Request (cURL)**

```bash
curl --request POST \
     --url https://api.anunzi.net/v2/actions/attach \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --header 'Authorization: Bearer API_KEY' \
     --data '
{
  "model_id": "151531531x15361351",
  "actions": [
    "161861531x1531681"
  ]
}
'
```

***

#### **Example Response (200 OK)**

```json
{
  "status": "success",
  "response": {}
}
```

***

#### **Status Codes**

| Code | Description                                 |
| ---- | ------------------------------------------- |
| 200  | Actions attached successfully.              |
| 400  | Bad Request. Invalid or missing parameters. |


---

# 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://doc.anunzi.net/api-widgets/trabajar-con-la-api-de-llamadas/actions/attach-action.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.
