> ## 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.

# Toggle Webhook Status

> Enable or disable a webhook

## Overview

Toggles the enabled/disabled status of a webhook. This is useful for temporarily stopping webhook notifications without deleting the configuration.

## Endpoint

<ParamField path="agent_id" type="string" required>
  Agent UUID
</ParamField>

<ParamField path="webhook_id" type="string" required>
  Webhook UUID
</ParamField>

## Request

<RequestExample>
  ```bash theme={null}
  curl -X PATCH \
    'https://app.talkover.ai/api/v1/agents/9fbef0b7-8d4e-4a08-9207-66c22155721d/webhooks/9fcafbf2-7593-44d6-8cd7-1b221beba62a/toggle' \
    -H 'Authorization: Bearer YOUR_TOKEN'
  ```

  ```javascript theme={null}
  const response = await fetch('https://app.talkover.ai/api/v1/agents/9fbef0b7-8d4e-4a08-9207-66c22155721d/webhooks/9fcafbf2-7593-44d6-8cd7-1b221beba62a/toggle', {
    method: 'PATCH',
    headers: {
      'Authorization': 'Bearer YOUR_TOKEN'
    }
  });
  const data = await response.json();
  ```

  ```php theme={null}
  <?php

  $client = new \GuzzleHttp\Client();
  $response = $client->patch('https://app.talkover.ai/api/v1/agents/9fbef0b7-8d4e-4a08-9207-66c22155721d/webhooks/9fcafbf2-7593-44d6-8cd7-1b221beba62a/toggle', [
      'headers' => [
          'Authorization' => 'Bearer YOUR_TOKEN',
      ],
  ]);
  $data = json_decode($response->getBody());
  ```
</RequestExample>

## Response

<ResponseField name="success" type="boolean">
  Indicates if the webhook status was toggled successfully
</ResponseField>

<ResponseField name="message" type="string">
  Status message indicating whether webhook was enabled or disabled
</ResponseField>

<ResponseField name="data" type="object">
  Updated webhook object with new enabled status
</ResponseField>

<ResponseField name="data.id" type="string">
  Unique webhook identifier
</ResponseField>

<ResponseField name="data.agent_id" type="string">
  Agent UUID this webhook belongs to
</ResponseField>

<ResponseField name="data.name" type="string">
  Webhook name
</ResponseField>

<ResponseField name="data.webhook_url" type="string">
  Webhook URL
</ResponseField>

<ResponseField name="data.events" type="array">
  Array of configured event types
</ResponseField>

<ResponseField name="data.timeout" type="integer">
  Request timeout in seconds
</ResponseField>

<ResponseField name="data.max_retries" type="integer">
  Maximum retry attempts
</ResponseField>

<ResponseField name="data.enabled" type="boolean">
  New webhook status (toggled from previous state)
</ResponseField>

<ResponseField name="data.created_at" type="string">
  ISO 8601 timestamp when webhook was created
</ResponseField>

<ResponseField name="data.updated_at" type="string">
  ISO 8601 timestamp when webhook was last updated
</ResponseField>

<ResponseField name="data.events_count" type="integer">
  Number of events configured for this webhook
</ResponseField>

<ResponseField name="data.status" type="string">
  Current webhook status
</ResponseField>

<ResponseExample title="Webhook Enabled">
  ```json theme={null}
  {
    "success": true,
    "message": "Webhook enabled",
    "data": {
      "id": "9fcafbf2-7593-44d6-8cd7-1b221beba62a",
      "agent_id": "9fbef0b7-8d4e-4a08-9207-66c22155721d",
      "name": "My Webhook",
      "webhook_url": "https://example.com/webhook",
      "events": ["event_phone_call_started", "event_phone_call_ended"],
      "timeout": 30,
      "max_retries": 3,
      "enabled": true,
      "created_at": "2025-09-03T23:19:51.000000Z",
      "updated_at": "2025-09-03T23:50:15.000000Z",
      "events_count": 2,
      "status": "active"
    }
  }
  ```
</ResponseExample>

<ResponseExample title="Webhook Disabled">
  ```json theme={null}
  {
    "success": true,
    "message": "Webhook disabled",
    "data": {
      "id": "9fcafbf2-7593-44d6-8cd7-1b221beba62a",
      "agent_id": "9fbef0b7-8d4e-4a08-9207-66c22155721d",
      "name": "My Webhook",
      "webhook_url": "https://example.com/webhook",
      "events": ["event_phone_call_started", "event_phone_call_ended"],
      "timeout": 30,
      "max_retries": 3,
      "enabled": false,
      "created_at": "2025-09-03T23:19:51.000000Z",
      "updated_at": "2025-09-03T23:50:15.000000Z",
      "events_count": 2,
      "status": "disabled"
    }
  }
  ```
</ResponseExample>

## Error responses

<ResponseExample title="401 Unauthorized">
  ```json theme={null}
  {
    "message": "Missing Bearer Token"
  }
  ```
</ResponseExample>

<ResponseExample title="404 Not Found">
  ```json theme={null}
  {
    "success": false,
    "message": "Agent not found in this environment."
  }
  ```
</ResponseExample>

<ResponseExample title="404 Webhook Not Found">
  ```json theme={null}
  {
    "success": false,
    "message": "Webhook not found."
  }
  ```
</ResponseExample>

## Important notes

* This endpoint toggles the current enabled/disabled status of the webhook
* Disabled webhooks will not receive any events until re-enabled
* Webhook operations automatically clear the agent cache for immediate effect
* Use this endpoint for temporary webhook management without losing configuration

## Related endpoints

* [List Agent Webhooks](/api-reference/endpoints/list-agent-webhooks) - Get all webhooks for an agent
* [Create Webhook](/api-reference/endpoints/create-webhook) - Set up a new webhook
* [Get Webhook Details](/api-reference/endpoints/get-webhook-details) - Retrieve specific webhook information
* [Update Webhook](/api-reference/endpoints/update-webhook) - Modify webhook configuration
* [Delete Webhook](/api-reference/endpoints/delete-webhook) - Remove webhook configuration
* [Test Webhook](/api-reference/endpoints/test-webhook) - Send test payload to verify connectivity
