---
title: "Update a webhook"
description: "Changes a webhook's name, URL, event type, API key filter or active state. Fields you leave out keep their values."
---

**PATCH** `https://api.respan.ai/api/webhooks/{id}/`

Changes a webhook's name, URL, event type, API key filter or active state. Fields you leave out keep their values.

## Servers

`https://api.respan.ai`: Respan API Server

## Authentication

### RespanApiKey

Use your Respan API key for Respan API authentication. Enter only the Respan API key value; clients send Authorization: Bearer &lt;RESPAN_API_KEY&gt;. For /api/responses, provider credentials such as Perplexity, OpenAI, or Azure OpenAI go in Settings -&gt; Providers or respan_params.credential_override in the request body, not in this authentication field.

HTTP scheme: `bearer`; format: `Respan API key`.


```http
Authorization: Bearer $RESPAN_API_KEY
```


## Path parameters


| Parameter | Type | Required | Description and constraints |
| --- | --- | --- | --- |
| `id` | `integer` | Required | Webhook ID.<br />Example: `25` |


## Request body

A request body is required.

### application/json


| Field | Type | Requirement | Description and constraints |
| --- | --- | --- | --- |
| `$` | `object` | Required body | Send only the fields to change.<br />Reference: `#/components/schemas/WebhookUpdateRequest` |
| `name` | `string` | Optional | Display name.<br />Maximum length: `70`<br />Example: `"Log sink"` |
| `url` | `string` | Optional | HTTPS endpoint that receives the events.<br />Format: `uri`<br />Maximum length: `200`<br />Example: `"https://example.com/respan/webhook"` |
| `event_type` | `string` | Optional | Event that triggers the webhook.<br />Reference: `#/components/schemas/WebhookEventType`<br />Allowed: `"request_log"`, `"on_eval_result_ingested"`, `"trace_completed"`, `"customer_budget_limit_reached"`, `"credit_low_balance_threshold_reached"`, `"limit_policy_soft_triggered"`, `"limit_policy_hard_triggered"`<br />Default: `request_log`<br />Example: `"request_log"` |
| `active` | `boolean` | Optional | Whether events are sent.<br />Default: `true`<br />Example: `true` |
| `organization_key` | `string or null` | Optional | Only send events for this API key (its ID). `null` sends events for every key.<br />Example: `null` |


<details class="api-schema-source">
<summary>OpenAPI request schema</summary>


```json
{
  "$ref": "#/components/schemas/WebhookUpdateRequest"
}
```

</details>

##### Example


```json
{
  "active": false
}
```


## Examples

### Update a webhook

#### Headers


```json
{
  "Authorization": "Bearer YOUR_RESPAN_API_KEY"
}
```


#### Path parameters


```json
{
  "id": 25
}
```


#### Request


```json
{
  "active": false
}
```


#### Response


```json
{
  "body": {
    "id": 25,
    "name": "Log sink",
    "url": "https://example.com/respan/webhook",
    "event_type": "request_log",
    "active": false,
    "organization_key": null,
    "organization_key_name": null,
    "project": "36253bba-bb22-40f9-9f83-c87baac9a833",
    "created": "2026-11-23T01:00:00Z"
  }
}
```


## Responses

### 200

The updated webhook.

#### application/json


| Field | Type | Requirement | Description and constraints |
| --- | --- | --- | --- |
| `$` | `object` | Body | Reference: `#/components/schemas/Webhook` |
| `id` | `integer` | Required in parent | Webhook ID.<br />Read only<br />Example: `25` |
| `name` | `string` | Optional | Display name.<br />Maximum length: `70`<br />Example: `"Log sink"` |
| `url` | `string` | Required in parent | HTTPS endpoint that receives the events.<br />Format: `uri`<br />Maximum length: `200`<br />Example: `"https://example.com/respan/webhook"` |
| `event_type` | `string` | Optional | Event that triggers the webhook.<br />Reference: `#/components/schemas/WebhookEventType`<br />Allowed: `"request_log"`, `"on_eval_result_ingested"`, `"trace_completed"`, `"customer_budget_limit_reached"`, `"credit_low_balance_threshold_reached"`, `"limit_policy_soft_triggered"`, `"limit_policy_hard_triggered"`<br />Default: `request_log`<br />Example: `"request_log"` |
| `active` | `boolean` | Optional | Whether events are sent.<br />Default: `true`<br />Example: `true` |
| `organization_key` | `string or null` | Optional | Only send events for this API key (its ID). `null` sends events for every key.<br />Example: `null` |
| `organization_key_name` | `string or null` | Optional | Name of the linked API key.<br />Read only<br />Example: `null` |
| `project` | `string or null` | Optional | Project ID.<br />Read only<br />Example: `"36253bba-bb22-40f9-9f83-c87baac9a833"` |
| `created` | `string` | Optional | Format: `date-time`<br />Read only<br />Example: `"2026-11-23T01:00:00Z"` |


<details class="api-schema-source">
<summary>OpenAPI response schema</summary>


```json
{
  "$ref": "#/components/schemas/Webhook"
}
```

</details>

##### Example


```json
{
  "id": 25,
  "name": "Log sink",
  "url": "https://example.com/respan/webhook",
  "event_type": "request_log",
  "active": false,
  "organization_key": null,
  "organization_key_name": null,
  "project": "36253bba-bb22-40f9-9f83-c87baac9a833",
  "created": "2026-11-23T01:00:00Z"
}
```


### 400

Validation failed. The body maps each invalid field to its errors.

#### application/json


| Field | Type | Requirement | Description and constraints |
| --- | --- | --- | --- |
| `$` | `object` | Body | - |
| `$.<key>` | `any` | Map value | - |


<details class="api-schema-source">
<summary>OpenAPI response schema</summary>


```json
{
  "type": "object",
  "additionalProperties": {}
}
```

</details>

##### Example


```json
{
  "url": [
    "Enter a valid URL."
  ]
}
```


### 403

The API key is missing, invalid or expired.

#### application/json


| Field | Type | Requirement | Description and constraints |
| --- | --- | --- | --- |
| `$` | `object` | Body | - |
| `detail` | `string` | Required in parent | - |


<details class="api-schema-source">
<summary>OpenAPI response schema</summary>


```json
{
  "type": "object",
  "required": [
    "detail"
  ],
  "properties": {
    "detail": {
      "type": "string"
    }
  }
}
```

</details>

##### Example


```json
{
  "detail": "Your API key is invalid or expired, please check your API key in the platform settings."
}
```


### 404

No webhook with that ID in this project.

#### application/json


| Field | Type | Requirement | Description and constraints |
| --- | --- | --- | --- |
| `$` | `object` | Body | - |
| `detail` | `string` | Optional | - |


<details class="api-schema-source">
<summary>OpenAPI response schema</summary>


```json
{
  "type": "object",
  "properties": {
    "detail": {
      "type": "string"
    }
  }
}
```

</details>

##### Example


```json
{
  "detail": "No Webhook matches the given query."
}
```


## OpenAPI source

The operation and referenced components below retain the complete OpenAPI definitions, including constraints and examples.

<!-- openapi-operation:start -->
<details class="api-schema-source">
<summary>OpenAPI operation</summary>


```json
{
  "summary": "Update a webhook",
  "operationId": "updateWebhook",
  "tags": [
    "Webhooks"
  ],
  "description": "Changes a webhook's name, URL, event type, API key filter or active state. Fields you leave out keep their values.",
  "parameters": [
    {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "integer"
      },
      "description": "Webhook ID.",
      "example": 25
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/WebhookUpdateRequest"
        },
        "example": {
          "active": false
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "The updated webhook.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Webhook"
          },
          "example": {
            "id": 25,
            "name": "Log sink",
            "url": "https://example.com/respan/webhook",
            "event_type": "request_log",
            "active": false,
            "organization_key": null,
            "organization_key_name": null,
            "project": "36253bba-bb22-40f9-9f83-c87baac9a833",
            "created": "2026-11-23T01:00:00Z"
          }
        }
      }
    },
    "400": {
      "description": "Validation failed. The body maps each invalid field to its errors.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "additionalProperties": {}
          },
          "example": {
            "url": [
              "Enter a valid URL."
            ]
          }
        }
      }
    },
    "403": {
      "$ref": "#/components/responses/InvalidApiKey"
    },
    "404": {
      "description": "No webhook with that ID in this project.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "detail": {
                "type": "string"
              }
            }
          },
          "example": {
            "detail": "No Webhook matches the given query."
          }
        }
      }
    }
  },
  "security": [
    {
      "RespanApiKey": []
    }
  ],
  "x-fern-examples": [
    {
      "name": "Update a webhook",
      "headers": {
        "Authorization": "Bearer YOUR_RESPAN_API_KEY"
      },
      "path-parameters": {
        "id": 25
      },
      "request": {
        "active": false
      },
      "response": {
        "body": {
          "id": 25,
          "name": "Log sink",
          "url": "https://example.com/respan/webhook",
          "event_type": "request_log",
          "active": false,
          "organization_key": null,
          "organization_key_name": null,
          "project": "36253bba-bb22-40f9-9f83-c87baac9a833",
          "created": "2026-11-23T01:00:00Z"
        }
      }
    }
  ]
}
```

</details>
<!-- openapi-operation:end -->

<!-- openapi-path-item:start -->
<details class="api-schema-source">
<summary>OpenAPI path metadata</summary>


```json
{}
```

</details>
<!-- openapi-path-item:end -->

<!-- openapi-components:start -->
<details class="api-schema-source">
<summary>Referenced OpenAPI components</summary>


```json
{
  "responses": {
    "InvalidApiKey": {
      "description": "The API key is missing, invalid or expired.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "detail"
            ],
            "properties": {
              "detail": {
                "type": "string"
              }
            }
          },
          "example": {
            "detail": "Your API key is invalid or expired, please check your API key in the platform settings."
          }
        }
      }
    }
  },
  "schemas": {
    "Webhook": {
      "type": "object",
      "required": [
        "id",
        "url"
      ],
      "properties": {
        "id": {
          "type": "integer",
          "readOnly": true,
          "description": "Webhook ID.",
          "example": 25
        },
        "name": {
          "type": "string",
          "maxLength": 70,
          "description": "Display name.",
          "example": "Log sink"
        },
        "url": {
          "type": "string",
          "format": "uri",
          "maxLength": 200,
          "description": "HTTPS endpoint that receives the events.",
          "example": "https://example.com/respan/webhook"
        },
        "event_type": {
          "$ref": "#/components/schemas/WebhookEventType"
        },
        "active": {
          "type": "boolean",
          "default": true,
          "description": "Whether events are sent.",
          "example": true
        },
        "organization_key": {
          "type": "string",
          "nullable": true,
          "description": "Only send events for this API key (its ID). `null` sends events for every key.",
          "example": null
        },
        "organization_key_name": {
          "type": "string",
          "nullable": true,
          "readOnly": true,
          "description": "Name of the linked API key.",
          "example": null
        },
        "project": {
          "type": "string",
          "nullable": true,
          "readOnly": true,
          "description": "Project ID.",
          "example": "36253bba-bb22-40f9-9f83-c87baac9a833"
        },
        "created": {
          "type": "string",
          "format": "date-time",
          "readOnly": true,
          "example": "2026-11-23T01:00:00Z"
        }
      }
    },
    "WebhookEventType": {
      "type": "string",
      "enum": [
        "request_log",
        "on_eval_result_ingested",
        "trace_completed",
        "customer_budget_limit_reached",
        "credit_low_balance_threshold_reached",
        "limit_policy_soft_triggered",
        "limit_policy_hard_triggered"
      ],
      "default": "request_log",
      "description": "Event that triggers the webhook.",
      "example": "request_log"
    },
    "WebhookUpdateRequest": {
      "type": "object",
      "description": "Send only the fields to change.",
      "properties": {
        "name": {
          "type": "string",
          "maxLength": 70,
          "description": "Display name.",
          "example": "Log sink"
        },
        "url": {
          "type": "string",
          "format": "uri",
          "maxLength": 200,
          "description": "HTTPS endpoint that receives the events.",
          "example": "https://example.com/respan/webhook"
        },
        "event_type": {
          "$ref": "#/components/schemas/WebhookEventType"
        },
        "active": {
          "type": "boolean",
          "default": true,
          "description": "Whether events are sent.",
          "example": true
        },
        "organization_key": {
          "type": "string",
          "nullable": true,
          "description": "Only send events for this API key (its ID). `null` sends events for every key.",
          "example": null
        }
      }
    }
  },
  "securitySchemes": {
    "RespanApiKey": {
      "type": "http",
      "scheme": "bearer",
      "bearerFormat": "Respan API key",
      "description": "Use your Respan API key for Respan API authentication. Enter only the Respan API key value; clients send Authorization: Bearer <RESPAN_API_KEY>. For /api/responses, provider credentials such as Perplexity, OpenAI, or Azure OpenAI go in Settings -> Providers or respan_params.credential_override in the request body, not in this authentication field.",
      "x-fern-bearer": {
        "name": "respanApiKey",
        "env": "RESPAN_API_KEY"
      }
    }
  }
}
```

</details>
<!-- openapi-components:end -->
