> ## Documentation Index
> Fetch the complete documentation index at: https://docs.talkover.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete Action

> Delete a specific action for a voice agent

# Delete Action

Delete a specific action for a voice agent. This action is irreversible and will permanently remove the action configuration from the agent.

## Endpoint

```
DELETE /api/v1/agents/{agent_id}/actions/{action_id}
```

## Path parameters

<ParamField path="agent" type="string" required>
  The unique identifier of the voice agent.
</ParamField>

<ParamField path="action" type="string" required>
  The unique identifier of the action to delete. You can find this by listing the agent's actions first.
</ParamField>

## Request headers

<ParamField header="Authorization" type="string" required>
  Bearer token for authentication. Format: `Bearer talq_your_environment_token_here`
</ParamField>

## Example requests

<RequestExample>
  ```bash theme={null}
  # Request 1: Delete a specific action
  curl -X DELETE "https://app.talkover.ai/api/v1/agents/550e8400-e29b-41d4-a716-446655440000/actions/action-uuid-1" \
    -H "Authorization: Bearer talq_your_environment_token_here"
  ```

  ```javascript theme={null}
  // Request 1: Delete a specific action
  const response = await fetch('https://app.talkover.ai/api/v1/agents/550e8400-e29b-41d4-a716-446655440000/actions/action-uuid-1', {
    method: 'DELETE',
    headers: {
      'Authorization': 'Bearer talq_your_environment_token_here'
    }
  });

  const result = await response.json();
  console.log(result);
  ```
</RequestExample>

<RequestExample>
  ```bash theme={null}
  # Request 2: Delete action with error handling
  curl -X DELETE "https://app.talkover.ai/api/v1/agents/550e8400-e29b-41d4-a716-446655440000/actions/action-uuid-1" \
    -H "Authorization: Bearer talq_your_environment_token_here" \
    -w "\nHTTP Status: %{http_code}\n"
  ```

  ```javascript theme={null}
  // Request 2: Delete action with error handling
  try {
    const response = await fetch('https://app.talkover.ai/api/v1/agents/550e8400-e29b-41d4-a716-446655440000/actions/action-uuid-1', {
      method: 'DELETE',
      headers: {
        'Authorization': 'Bearer talq_your_environment_token_here'
      }
    });

    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }

    const result = await response.json();
    console.log('Action deleted successfully:', result.message);
  } catch (error) {
    console.error('Error deleting action:', error);
  }
  ```
</RequestExample>

## Response

### Success Response (200 OK)

<ResponseExample>
  ```json theme={null}
  {
    "success": true,
    "message": "Agent action deleted successfully"
  }
  ```
</ResponseExample>

### Response fields

<ResponseField name="success" type="boolean" required>
  Indicates if the operation was successful.
</ResponseField>

<ResponseField name="message" type="string" required>
  Success message confirming the action was deleted.
</ResponseField>

## Error responses

### 404 Not Found

<ResponseExample>
  ```json theme={null}
  {
    "success": false,
    "message": "Action not found"
  }
  ```
</ResponseExample>

### 401 Unauthorized

<ResponseExample>
  ```json theme={null}
  {
    "success": false,
    "message": "Unauthenticated."
  }
  ```
</ResponseExample>

### 403 Forbidden

<ResponseExample>
  ```json theme={null}
  {
    "success": false,
    "message": "You are not authorized to delete actions for this agent."
  }
  ```
</ResponseExample>

### 500 Server Error

<ResponseExample>
  ```json theme={null}
  {
    "success": false,
    "message": "Internal server error."
  }
  ```
</ResponseExample>

## Error codes

| Code               | Description                                                    | HTTP Status |
| ------------------ | -------------------------------------------------------------- | ----------- |
| `ACTION_NOT_FOUND` | Specified action does not exist                                | 404         |
| `AGENT_NOT_FOUND`  | Specified agent does not exist                                 | 404         |
| `INVALID_TOKEN`    | Authentication token is invalid or missing                     | 401         |
| `UNAUTHORIZED`     | User does not have permission to delete actions for this agent | 403         |
| `SERVER_ERROR`     | Internal server error occurred                                 | 500         |

## Important notes

<Warning>
  **This action is irreversible.** Once an action is deleted, it cannot be recovered. Make sure you have a backup if needed.
</Warning>

<Info>
  **Agent status will be set to draft.** After deleting an action, the agent will be automatically set to "draft" status and will need to be published again to become active.
</Info>

<Info>
  **No confirmation required.** The deletion happens immediately without additional confirmation steps.
</Info>

<Info>
  **Active calls may be affected.** If the deleted action is currently being used in active calls, those calls may be affected.
</Info>

## Related endpoints

* **List Actions**: `GET /api/v1/agents/{agent_id}/actions`
* **Create/Update Action**: `POST /api/v1/agents/{agent_id}/actions`
* **Get Agent**: `GET /api/v1/agents/{agent_id}`
* **Publish Agent**: `POST /api/v1/agents/{agent_id}/publish`
