Update Hook

Updates the configuration of an existing webhook, including its name, event subscriptions, or target URL.

PATCH /hooks/{hookId}
import { v0 } from 'v0-sdk'

const result = await v0.hooks.update({
  hookId: '123',
  name: 'My Updated Hook',
  events: ['chat.created', 'message.created'],
})

console.log(result)
PATCH /hooks/{hookId}
curl -X PUT https://api.v0.dev/hooks/123 \
  -H "Authorization: Bearer $V0_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "My Updated Hook",
    "events": ["chat.created", "message.created"],
    "url": "https://example.com"
  }'

Parameters

Path Parameters

hookId string Required

The ID of the webhook to update. Provided as a path parameter.


Request Body

name string

A new name for the hook.


events string[]

Updated list of event types to subscribe to.

Array items: enum


url string

A new URL to send webhook payloads to.


Response

Response Body

id string Required

A unique identifier for the webhook.


object string Required

Fixed value identifying this object as a webhook.


name string Required

A user-defined name to label the webhook.


events string[] Required

List of event types this webhook is subscribed to.

Array items: enum


chatId string

Optional ID of the chat that this webhook is scoped to.


projectId string

Optional ID of the project that this webhook is scoped to.


url string Required

Target URL that receives event payloads for this webhook.