For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
HomeGet API key
DocumentationIntegrationsAPI Reference
DocumentationIntegrationsAPI Reference
  • API Reference
      • GETGet Webhook
      • POSTCreate Or Update Webhook
      • DELDelete Webhook
      • GETList Deliveries
      • GETDelivery Stats
      • GETAll Time Stats
      • POSTTest Webhook
LogoLogo
HomeGet API key
API Referencewebhooks

Create Or Update Webhook

POST
https://api.agentphone.ai/v1/webhooks
POST
/v1/webhooks
1const url = 'https://api.agentphone.ai/v1/webhooks';
2const options = {
3 method: 'POST',
4 headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
5 body: '{"url":"string"}'
6};
7
8try {
9 const response = await fetch(url, options);
10 const data = await response.json();
11 console.log(data);
12} catch (error) {
13 console.error(error);
14}
1{
2 "id": "string",
3 "url": "string",
4 "secret": "string",
5 "status": "string",
6 "contextLimit": 1,
7 "timeout": 1,
8 "createdAt": "2024-01-15T09:30:00Z"
9}

Register or update the webhook URL for this account.

If a webhook already exists, it will be updated. A new secret is generated each time.

contextLimit: Number of recent messages to include in webhook payloads (0-50, default: 10). Set to 0 to disable history in webhooks.

Was this page helpful?
Previous

Delete Webhook

Next
Built with

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Request

This endpoint expects an object.
urlstringRequiredformat: "uri"1-2083 characters
contextLimitinteger or nullOptional
timeoutinteger or nullOptional

Response

Successful Response
idstring
urlstring
secretstring
statusstring
contextLimitinteger
timeoutinteger
createdAtdatetime

Errors

422
Unprocessable Entity Error