# Actualizar acción

**PUT**\
`https://api.anunzi.net/v2/actions/{action_id}`

Update an existing custom action by modifying its parameters, such as appointment scheduling, live transfers, SMS messages, or API requests.

***

#### **Path Parameters**

| Parameter   | Type   | Required | Description                                                                                                |
| ----------- | ------ | -------- | ---------------------------------------------------------------------------------------------------------- |
| `action_id` | string | Yes      | The unique ID of the action to update. This can be obtained by opening the action in the Anunzi dashboard. |

***

#### **Body Parameters**

**Real-Time Booking (`REAL_TIME_BOOKING`)**

| Parameter         | Type   | Description                                                                         |
| ----------------- | ------ | ----------------------------------------------------------------------------------- |
| `first_appt_date` | date   | The initial date used to start searching for available appointments (`YYYY-MM-DD`). |
| `max_time_slots`  | int32  | The number of slots the assistant will suggest per day (max `3`).                   |
| `min_hours_diff`  | int32  | Minimum hours between suggested appointments.                                       |
| `no_of_days`      | int32  | The number of days the assistant will suggest appointments.                         |
| `timezone`        | string | The timezone for booking (e.g., `US/Central`).                                      |

**Live Transfer (`LIVE_TRANSFER`)**

| Parameter        | Type   | Description                                                                                    |
| ---------------- | ------ | ---------------------------------------------------------------------------------------------- |
| `phone`          | string | The phone number to transfer the call to.                                                      |
| `instructions`   | string | The trigger phrase(s) that will initiate the transfer (e.g., "I want to talk with a manager"). |
| `timeout`        | int32  | How long to wait before stopping the transfer attempt.                                         |
| `digits`         | string | Extension digits for the transfer call.                                                        |
| `initiating_msg` | string | Message the assistant will say before initiating the transfer.                                 |
| `goodbye_msg`    | string | Message the assistant will say before leaving the call.                                        |
| `failed_msg`     | string | Message the assistant will say if the transfer fails.                                          |

**Send SMS (`SEND_SMS`)**

| Parameter      | Type   | Description                                                              |
| -------------- | ------ | ------------------------------------------------------------------------ |
| `content`      | string | The content of the SMS message.                                          |
| `instructions` | string | The conditions that will trigger the SMS (e.g., "Send during the call"). |

**Custom Action (`CUSTOM_ACTION`)**

| Parameter                      | Type    | Description                                                    |
| ------------------------------ | ------- | -------------------------------------------------------------- |
| `http_mode`                    | string  | Defaults to `"GET"`. The HTTP method for the API call.         |
| `url`                          | string  | The URL endpoint for the action.                               |
| `name`                         | string  | Name of the action.                                            |
| `description`                  | string  | A brief description of the action.                             |
| `run_action_before_call_start` | boolean | Whether the action should execute before the call starts.      |
| `speech_while_using_the_tool`  | string  | The message the assistant will say while executing the action. |
| `integration`                  | string  | Possible integrations to retrieve information.                 |
| `custom_auth`                  | object  | Custom authentication parameters.                              |
| `variables_before_the_call`    | array   | Variables to be set before the call starts.                    |
| `variables_during_the_call`    | array   | Variables that can be updated during the call.                 |
| `headers`                      | array   | HTTP headers to include in the request.                        |
| `query_parameters`             | array   | Query parameters to send with the request.                     |
| `json_body_stringified`        | string  | A JSON stringified payload/body for the action.                |
| `prompt`                       | string  | A prompt that will be used if set.                             |

***

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

```bash
curl --request PUT \
     --url https://api.anunzi.net/v2/actions/2115312315z1315654 \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --header 'Authorization: Bearer API_KEY' \
     --data '
{
  "LIVE_TRANSFER": {
    "phone": "+5412315156",
    "instructions": "I want to talk with a manager",
    "timeout": 5
  },
  "SEND_SMS": {
    "content": "Hey man",
    "instructions": "Send during the call"
  }
}
'
```

***

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

```json
{
  "status": "success",
  "response": {
    "action_id": "1726463549273x939752486981929300"
  }
}
```

***

#### **Status Codes**

| Code | Description                                 |
| ---- | ------------------------------------------- |
| 200  | Action updated 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/update-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.
