Update a webhook
Updates a webhook's name, URL, subscribed events, channels, custom headers, mailbox scope, or status and returns the updated endpoint.
PATCH
Updates a webhook's name, URL, subscribed events, channels, custom headers, mailbox scope, or status and returns the updated endpoint. A change to mailboxIds or namespaceId is checked as the endpoint will stand afterward: every mailbox must belong to the namespace when both are set.
apiKeyheader
x-api-key<token>id*stringMatch
^wep_[0-9a-hjkmnp-tv-z]{16,24}$application/json- body
name?|nullurl?string|nulleventTypes?array<>|nullchannels?array<>|null|nullmailboxIds?array<>|null|nullnamespaceId?|null|nullheaders?|nullstatus?|nullWebhookEndpoint
application/json- response
id*WebhookEndpointIdMatch
^wep_[0-9a-hjkmnp-tv-z]{16,24}$name*stringurl*stringeventTypes*array<>channels*array<>|nullmailboxIds*array<>|nullnamespaceId*|nullstatus*stringValue in
"active""disabled"hasCustomHeaders*booleanfailureStartedAt*string|nulllastSucceededAt*string|nullcreatedAt*stringupdatedAt*stringimport { createClient } from "samva";
const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });
const result = await samva.webhooks.update({
"id": "example"
});Example Response
{
"id": "string",
"name": "string",
"url": "string",
"eventTypes": [
"message.sent"
],
"channels": [
"sms"
],
"mailboxIds": [
"string"
],
"namespaceId": "string",
"status": "active",
"hasCustomHeaders": true,
"failureStartedAt": "string",
"lastSucceededAt": "string",
"createdAt": "string",
"updatedAt": "string"
}