cURL
Python
JavaScript
PHP
Go
Java
curl --request POST \
--url https://api.bland.ai/v1/postcall/webhooks/create \
--header 'Content-Type: application/json' \
--header 'authorization: <authorization>' \
--data '{
"call_ids": [
"<string>"
],
"webhook_url": "<string>"
}'
{
"data" : [
{
"call_id" : "<string>" ,
"payload" : { } ,
"url" : "<string>" ,
"user_id" : "<string>" ,
"created_at" : "<string>" ,
"metadata" : [
{
"sent_at" : "<string>" ,
"response_code" : 123 ,
"response_time" : "<string>" ,
"send_type" : "<string>"
}
]
}
] ,
"errors" : [
{
"error" : "<string>" ,
"message" : "<string>"
}
]
}
Overview
Create and send post call webhooks for one or more call IDs. This endpoint allows you to create webhooks for calls that don’t already have webhooks configured. The webhooks will be sent immediately after creation to the specified webhook URL. If the call has already sent a post call webhook, this endpoint will return an error.
Your API key for authentication.
Body Parameters
Array of call IDs to create and send webhooks for. Each call ID must be unique within the array.
Show Array Item Properties
The unique identifier of a call to create a webhook for.
The URL where the webhook payloads should be sent.
Response
Array of webhook objects for each created webhook.
Show Array Item Properties
The unique identifier of the call this webhook is for.
The webhook payload data that was sent.
The URL the webhook was sent to.
The ID of the user/org that owns this webhook.
Timestamp of when the webhook was created.
Array of metadata objects about webhook send attempts.
Show Array Item Properties
Timestamp of when this webhook attempt was sent.
HTTP response code received from the webhook endpoint.
Time taken to receive a response from the webhook endpoint.
How this webhook was triggered (will be “create” in this case).
Array of error objects if any errors occurred.
Show Array Item Properties
The error code. Possible values:
“invalid_parameter”: Invalid request parameters
“INTERNAL_SERVER_ERROR”: Server error occurred