> For the complete documentation index, see [llms.txt](https://anunzi-ai.gitbook.io/anunzi-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://anunzi-ai.gitbook.io/anunzi-docs/api-widgets/trabajar-con-la-api-de-llamadas/actions/initialize-custom-action.md).

# Inicializar acción personalizada

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

Initialize a previously created custom action by providing its unique `action_id`. You can also dynamically assign variables to the action.

***

#### **Body Parameters**

| Parameter   | Type             | Required | Description                                                                |
| ----------- | ---------------- | -------- | -------------------------------------------------------------------------- |
| `action_id` | string           | Yes      | The unique ID of the action to initialize.                                 |
| `variables` | array of objects | No       | Key-value pairs of dynamic variables to be assigned during initialization. |

**Variables Object**

| Parameter | Type   | Required | Description                         |
| --------- | ------ | -------- | ----------------------------------- |
| `key`     | string | Yes      | The name of the variable.           |
| `value`   | string | Yes      | The value assigned to the variable. |

***

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

```bash
curl --request POST \
     --url https://api.anunzi.net/v2/actions/initialize \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --header 'Authorization: Bearer API_KEY' \
     --data '
{
  "action_id": "515615123123x15616515",
  "variables": [
    {"key": "customer_name", "value": "David"},
    {"key": "appointment_date", "value": "2024-03-28"}
  ]
}
'
```

***

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

```json
{
  "status": "success",
  "response": {
    "answer": "Action initialized."
  }
}
```

***

#### **Status Codes**

| Code | Description                                 |
| ---- | ------------------------------------------- |
| 200  | Action initialized successfully.            |
| 400  | Bad Request. Invalid or missing parameters. |
