Skip to content
Docs

Creates a webhook

POSThttps://api.vercel.com/v1/webhooks
Creates a webhook
https://api.vercel.com/v1/webhooks
const response = await fetch('https://api.vercel.com/v1/webhooks?teamId=string&slug=string', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"url": "https://example.com",
"events": [],
"projectIds": []
}),
});
const data = await response.json();
console.log(data);
Response
{
"alertRuleIds": [],
"createdAt": "1567024758130",
"events": [],
"id": "account_hook_GflD6EYyo7F4ViYS",
"ownerId": "ZspSRT4ljIEEmMHgoDwKWDei",
"projectIds": [],
"secret": "string",
"updatedAt": "1567024758130",
"url": "https://my-webhook.com"
}
AuthorizationbearerToken

Default authentication mechanism

teamIdstringOptional
The Team identifier to perform the request on behalf of.
slugstringOptional
The Team slug to perform the request on behalf of.
application/json
urlstringRequired
eventsarrayRequired
projectIdsarrayOptional
200Success
alertRuleIdsarrayOptional
createdAtnumberRequired
A number containing the date when the webhook was created in in milliseconds
eventsarrayRequired
The webhooks events
idstringRequired
The webhook id
ownerIdstringRequired
The unique ID of the team the webhook belongs to
projectIdsarrayOptional
The ID of the projects the webhook is associated with
secretstringRequired
The webhook secret used to sign the payload
updatedAtnumberRequired
A number containing the date when the webhook was updated in in milliseconds
urlstringRequired
A string with the URL of the webhook
400One of the provided values in the request body is invalid.
401The request is not authorized.
403You do not have permission to access this resource.
404Error
410Error