---
title: "updateWebhook"
---

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

# updateWebhook

Path: agenthold API › triggers

`PUT /webhooks/{webhookId}`

URL: `/api/v1/webhooks/{webhookId}`

## Authentication

Requires one of the following:

- `session`, apiKey, in cookie
- `token`, http bearer, header `Authorization`

## Path parameters

- `webhookId` (`updateWebhook.path.webhookId`; string, required)

## Request body

_Required._

- `name` (`updateWebhook.name`; string, required)
  - maxLength: `100` · minLength: `1`
- `promptTemplate` (`updateWebhook.promptTemplate`; string, required) — {{payload}} marks where the delimited request body goes; otherwise it is appended.
  - minLength: `1`
- `signingSecret` (`updateWebhook.signingSecret`; string, optional) — Set to require HMAC-SHA256 signatures; "" removes it; omit to keep.
- `signatureHeader` (`updateWebhook.signatureHeader`; string, optional) — Header holding the signature. Default X-Hub-Signature-256.
- `enabled` (`updateWebhook.enabled`; boolean, optional)

## Example request

```json
{
  "name": "string",
  "promptTemplate": "string",
  "signingSecret": "string",
  "signatureHeader": "string",
  "enabled": true
}
```

## Code samples

### cURL

```bash
curl --request PUT \
  --url '<base-url>/api/v1/webhooks/<webhookId>' \
  --header 'Content-Type: application/json' \
  --cookie 'agenthold_session=<agenthold_session>' \
  --data '
{
  "name": "string",
  "promptTemplate": "string",
  "signingSecret": "string",
  "signatureHeader": "string",
  "enabled": true
}
'
```

### TypeScript

```typescript
const url = '<base-url>/api/v1/webhooks/<webhookId>';
const options = {
  method: 'PUT',
  headers: {
    'Content-Type': 'application/json',
    cookie: 'agenthold_session=<agenthold_session>'
  },
  body: JSON.stringify({
    name: 'string',
    promptTemplate: 'string',
    signingSecret: 'string',
    signatureHeader: 'string',
    enabled: true
  })
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "<base-url>/api/v1/webhooks/<webhookId>"

payload = {
    "name": "string",
    "promptTemplate": "string",
    "signingSecret": "string",
    "signatureHeader": "string",
    "enabled": True
}
headers = {
    "cookie": "agenthold_session=<agenthold_session>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

Updated.

#### Example

```json
{
  "id": "string",
  "agentId": "string",
  "sessionId": "string",
  "name": "string",
  "promptTemplate": "string",
  "signed": true,
  "signatureHeader": "string",
  "enabled": true,
  "createdBy": {
    "id": "string",
    "email": "string",
    "name": "string",
    "avatarUrl": "string"
  },
  "lastDeliveryAt": "2019-08-24T14:15:22Z",
  "lastError": "string",
  "createdAt": "2019-08-24T14:15:22Z"
}
```

- `id` (`updateWebhook.response.200.id`; string, required)
- `agentId` (`updateWebhook.response.200.agentId`; string, required)
- `sessionId` (`updateWebhook.response.200.sessionId`; string, required)
- `name` (`updateWebhook.response.200.name`; string, required)
- `promptTemplate` (`updateWebhook.response.200.promptTemplate`; string, required)
- `signed` (`updateWebhook.response.200.signed`; boolean, required)
- `signatureHeader` (`updateWebhook.response.200.signatureHeader`; string, required)
- `enabled` (`updateWebhook.response.200.enabled`; boolean, required)
- `createdBy` (`updateWebhook.response.200.createdBy`; object, required)
  - `id` (`updateWebhook.response.200.createdBy.id`; string, required)
  - `email` (`updateWebhook.response.200.createdBy.email`; string, required)
  - `name` (`updateWebhook.response.200.createdBy.name`; string, required)
  - `avatarUrl` (`updateWebhook.response.200.createdBy.avatarUrl`; string, required)
- `lastError` (`updateWebhook.response.200.lastError`; string, required)
- `createdAt` (`updateWebhook.response.200.createdAt`; string, required)
  - format: `date-time`
- `lastDeliveryAt` (`updateWebhook.response.200.lastDeliveryAt`; string, optional)
  - format: `date-time`

### 400

Error.

#### Example

```json
{
  "error": "string"
}
```

- `error` (`updateWebhook.response.400.error`; string, required)

### 403

Error.

#### Example

```json
{
  "error": "string"
}
```

- `error` (`updateWebhook.response.403.error`; string, required)

### 404

Error.

#### Example

```json
{
  "error": "string"
}
```

- `error` (`updateWebhook.response.404.error`; string, required)


Source: https://agenthold.dev/api/webhook/update/index.md
