Create a new webhook for calls
curl --request POST \
--url https://dev-public-api.openphone.dev/v1/webhooks/calls \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://example.com/",
"events": [
"call.completed"
],
"resourceIds": [
"PN1234"
],
"userId": "US123abc",
"label": "my webhook label",
"status": "enabled"
}
'{
"data": {
"id": "WHabcd1234",
"userId": "US123abc",
"orgId": "OR1223abc",
"label": "my webhook label",
"status": "enabled",
"url": "https://example.com/",
"key": "example-key",
"createdAt": "2022-01-01T00:00:00Z",
"updatedAt": "2022-01-01T00:00:00Z",
"deletedAt": "2022-01-01T00:00:00Z",
"events": [
"call.completed"
],
"resourceIds": [
"PN1234"
]
}
}{
"message": "<string>",
"code": "0305400",
"status": 400,
"docs": "https://quo.com/docs",
"title": "Invalid Version",
"description": "Invalid Version",
"trace": "<string>",
"errors": [
{
"path": "<string>",
"message": "<string>",
"schema": {
"type": "<string>"
},
"value": "<unknown>"
}
]
}{
"message": "<string>",
"code": "0300401",
"status": 401,
"docs": "https://quo.com/docs",
"title": "Unauthorized",
"trace": "<string>",
"errors": [
{
"path": "<string>",
"message": "<string>",
"schema": {
"type": "<string>"
},
"value": "<unknown>"
}
]
}{
"message": "<string>",
"code": "0300403",
"status": 403,
"docs": "https://quo.com/docs",
"title": "Forbidden",
"trace": "<string>",
"errors": [
{
"path": "<string>",
"message": "<string>",
"schema": {
"type": "<string>"
},
"value": "<unknown>"
}
]
}{
"message": "<string>",
"code": "0300404",
"status": 404,
"docs": "https://quo.com/docs",
"title": "Not Found",
"trace": "<string>",
"errors": [
{
"path": "<string>",
"message": "<string>",
"schema": {
"type": "<string>"
},
"value": "<unknown>"
}
]
}{
"message": "<string>",
"code": "0301500",
"status": 500,
"docs": "https://quo.com/docs",
"title": "Unknown",
"trace": "<string>",
"errors": [
{
"path": "<string>",
"message": "<string>",
"schema": {
"type": "<string>"
},
"value": "<unknown>"
}
]
}Webhooks
Create a new webhook for calls
Creates a new webhook that triggers on events from calls.
POST
/
v1
/
webhooks
/
calls
Create a new webhook for calls
curl --request POST \
--url https://dev-public-api.openphone.dev/v1/webhooks/calls \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://example.com/",
"events": [
"call.completed"
],
"resourceIds": [
"PN1234"
],
"userId": "US123abc",
"label": "my webhook label",
"status": "enabled"
}
'{
"data": {
"id": "WHabcd1234",
"userId": "US123abc",
"orgId": "OR1223abc",
"label": "my webhook label",
"status": "enabled",
"url": "https://example.com/",
"key": "example-key",
"createdAt": "2022-01-01T00:00:00Z",
"updatedAt": "2022-01-01T00:00:00Z",
"deletedAt": "2022-01-01T00:00:00Z",
"events": [
"call.completed"
],
"resourceIds": [
"PN1234"
]
}
}{
"message": "<string>",
"code": "0305400",
"status": 400,
"docs": "https://quo.com/docs",
"title": "Invalid Version",
"description": "Invalid Version",
"trace": "<string>",
"errors": [
{
"path": "<string>",
"message": "<string>",
"schema": {
"type": "<string>"
},
"value": "<unknown>"
}
]
}{
"message": "<string>",
"code": "0300401",
"status": 401,
"docs": "https://quo.com/docs",
"title": "Unauthorized",
"trace": "<string>",
"errors": [
{
"path": "<string>",
"message": "<string>",
"schema": {
"type": "<string>"
},
"value": "<unknown>"
}
]
}{
"message": "<string>",
"code": "0300403",
"status": 403,
"docs": "https://quo.com/docs",
"title": "Forbidden",
"trace": "<string>",
"errors": [
{
"path": "<string>",
"message": "<string>",
"schema": {
"type": "<string>"
},
"value": "<unknown>"
}
]
}{
"message": "<string>",
"code": "0300404",
"status": 404,
"docs": "https://quo.com/docs",
"title": "Not Found",
"trace": "<string>",
"errors": [
{
"path": "<string>",
"message": "<string>",
"schema": {
"type": "<string>"
},
"value": "<unknown>"
}
]
}{
"message": "<string>",
"code": "0301500",
"status": 500,
"docs": "https://quo.com/docs",
"title": "Unknown",
"trace": "<string>",
"errors": [
{
"path": "<string>",
"message": "<string>",
"schema": {
"type": "<string>"
},
"value": "<unknown>"
}
]
}Authorizations
Body
application/json
The endpoint that receives events from the webhook.
Example:
"https://example.com/"
An event associated with the webhook.
Available options:
call.completed, call.ringing, call.recording.completed Example:
["call.completed"]
The unique identifiers of the phone numbers associated with the webhook.
Pattern:
^PN(.*)$Example:
["PN1234"]
The unique identifier of the user that creates the webhook. If not provided, default to workspace owner.
Pattern:
^US(.*)$Example:
"US123abc"
Webhook's label
Example:
"my webhook label"
The status of the webhook.
Available options:
enabled, disabled Example:
"enabled"
Response
Created
Show child attributes
Show child attributes
Was this page helpful?