Customer Communications
2 API calls in this section.
List Customer Communications
/delivery/customer-communications?page=1&limit=10&customer_id=&delivery_id=&type=&status=&tenant_id=&language=enGet a list of customer communications with filtering and pagination. Customers can only view their own communications, while admin users can view all communications.
1curl --request GET "$ONDI_BASE_URL/delivery/customer-communications?page=1&limit=10&customer_id=&delivery_id=&type=&status=&tenant_id=&language=en" \2 --header "Authorization: Bearer {{access_token}}"Query parameters
pageOptional1
Page number for pagination
limitOptional10
Number of items per page
customer_idOptionalFilter by customer ID (optional - if not provided and user is a customer, returns their own communications)
delivery_idOptionalFilter by delivery ID
typeOptionalFilter by communication type (sms, email, push_notification, call)
statusOptionalFilter by status (sent, delivered, failed, read)
tenant_idOptionalFilter by tenant ID (optional if in auth token)
languageOptionalen
Preferred language for response messages
Headers
AuthorizationOptionalBearer {{access_token}}
Responses
Create Customer Communication
/delivery/customer-communications?tenant_id=&language=enCreate a new customer communication. This requires admin permissions with manage:operations:tenant. Automatically records outbound communications and can be used to log inbound communications.
1curl --request POST "$ONDI_BASE_URL/delivery/customer-communications?tenant_id=&language=en" \2 --header "Authorization: Bearer {{access_token}}" \3 --header "Content-Type: application/json" \4 --header "Content-Type: application/json" \5 --data '{6 "customer_id": "uuid",7 "delivery_id": "uuid",8 "type": "sms",9 "direction": "outbound",10 "status": "sent",11 "content": "Your delivery #1234 is on its way and will arrive between 2-4pm today.",12 "communication_details": {13 "sender": {14 "user_id": "uuid",15 "system_component": "delivery_notifications",16 "phone": "+15551234567"17 },18 "recipient": {19 "phone": "+19876543210",20 "name": "John Doe"21 },22 "template_id": "delivery-on-way",23 "template_variables": {24 "delivery_id": "1234",25 "delivery_window": "2-4pm"26 },27 "attachments": [28 {29 "name": "delivery_details.pdf",30 "type": "application/pdf",31 "url": "https://example.com/attachments/delivery_details.pdf",32 "size": 24567833 }34 ]35 }36}'1{2 "customer_id": "uuid",3 "delivery_id": "uuid",4 "type": "sms",5 "direction": "outbound",6 "status": "sent",7 "content": "Your delivery #1234 is on its way and will arrive between 2-4pm today.",8 "communication_details": {9 "sender": {10 "user_id": "uuid",11 "system_component": "delivery_notifications",12 "phone": "+15551234567"13 },14 "recipient": {15 "phone": "+19876543210",16 "name": "John Doe"17 },18 "template_id": "delivery-on-way",19 "template_variables": {20 "delivery_id": "1234",21 "delivery_window": "2-4pm"22 },23 "attachments": [24 {25 "name": "delivery_details.pdf",26 "type": "application/pdf",27 "url": "https://example.com/attachments/delivery_details.pdf",28 "size": 24567829 }30 ]31 }32}Query parameters
tenant_idOptionalTenant ID (optional if in auth token)
languageOptionalen
Preferred language for response messages
Request body fields
customer_idExampleExample field from the request body.
delivery_idExampleExample field from the request body.
typeExampleExample field from the request body.
directionExampleExample field from the request body.
statusExampleExample field from the request body.
contentExampleExample field from the request body.
communication_detailsExampleExample field from the request body.
communication_details.senderExampleExample field from the request body.
communication_details.sender.user_idExampleExample field from the request body.
communication_details.sender.system_componentExampleExample field from the request body.
communication_details.sender.phoneExampleExample field from the request body.
communication_details.recipientExampleExample field from the request body.
communication_details.recipient.phoneExampleExample field from the request body.
communication_details.recipient.nameExampleExample field from the request body.
communication_details.template_idExampleExample field from the request body.
communication_details.template_variablesExampleExample field from the request body.
communication_details.template_variables.delivery_idExampleExample field from the request body.
communication_details.template_variables.delivery_windowExampleExample field from the request body.
communication_details.attachmentsExampleExample field from the request body.
communication_details.attachments.nameExampleExample field from the request body.
communication_details.attachments.typeExampleExample field from the request body.
communication_details.attachments.urlExampleExample field from the request body.
communication_details.attachments.sizeExampleExample field from the request body.
Headers
AuthorizationOptionalBearer {{access_token}}
Content-TypeOptionalapplication/json