curl --request POST \
--url https://api.openphone.com/v1/webhooks/messages \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"events": [
"message.received"
],
"label": "my webhook label",
"resourceIds": [
"<string>"
],
"status": "enabled",
"url": "https://example.com",
"userId": "US123abc"
}'
{
"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": [
"message.received"
],
"resourceIds": [
"<string>"
]
}
}
Creates a new webhook that triggers on events from messages.
curl --request POST \
--url https://api.openphone.com/v1/webhooks/messages \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"events": [
"message.received"
],
"label": "my webhook label",
"resourceIds": [
"<string>"
],
"status": "enabled",
"url": "https://example.com",
"userId": "US123abc"
}'
{
"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": [
"message.received"
],
"resourceIds": [
"<string>"
]
}
}
Success
The response is of type object
.
Was this page helpful?