Add a webhook endpoint
POST
/v1/webhooks
const url = 'https://api.orvoca.com/v1/webhooks';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"url":"example","events":["call.started"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.orvoca.com/v1/webhooks \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "url": "example", "events": [ "call.started" ] }'Events are POSTed as JSON with Orvoca-Signature: t=<unix>,v1=<hex HMAC-SHA256 of "t.body">. Reject events older than 5 minutes. Failed deliveries retry with backoff for 24 hours.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
url
required
string
events
required
Array<string>
Responses
Section titled “Responses”Added
Media typeapplication/json
object
id
required
string
url
required
string
events
required
Array<string>
status
required
string
created_at
required
string
secret
required
Shown only now. Verify Orvoca-Signature with it.
string
Example
{ "events": [ "call.started" ], "status": "active"}Invalid request
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
param
string
request_id
required
string
Example generated
{ "error": { "code": "example", "message": "example", "param": "example", "request_id": "example" }}Not signed in or bad API key
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
param
string
request_id
required
string
Example generated
{ "error": { "code": "example", "message": "example", "param": "example", "request_id": "example" }}Not allowed
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
param
string
request_id
required
string
Example generated
{ "error": { "code": "example", "message": "example", "param": "example", "request_id": "example" }}Not found
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
param
string
request_id
required
string
Example generated
{ "error": { "code": "example", "message": "example", "param": "example", "request_id": "example" }}