Skip to main content

Customer Communications

2 API calls in this section.

List Customer Communications

Delivery & Last-Mile / Customer Communications
GET/delivery/customer-communications?page=1&limit=10&customer_id=&delivery_id=&type=&status=&tenant_id=&language=en

Get a list of customer communications with filtering and pagination. Customers can only view their own communications, while admin users can view all communications.

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
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

pageOptional
query string

1

Page number for pagination

limitOptional
query string

10

Number of items per page

customer_idOptional
query string

Filter by customer ID (optional - if not provided and user is a customer, returns their own communications)

delivery_idOptional
query string

Filter by delivery ID

typeOptional
query string

Filter by communication type (sms, email, push_notification, call)

statusOptional
query string

Filter by status (sent, delivered, failed, read)

tenant_idOptional
query string

Filter by tenant ID (optional if in auth token)

languageOptional
query string

en

Preferred language for response messages

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Responses

Success Response200OK
Error - Insufficient Permissions403Forbidden

Create Customer Communication

Delivery & Last-Mile / Customer Communications
POST/delivery/customer-communications?tenant_id=&language=en

Create a new customer communication. This requires admin permissions with manage:operations:tenant. Automatically records outbound communications and can be used to log inbound communications.

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
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}'
Request body
json
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_idOptional
query string

Tenant ID (optional if in auth token)

languageOptional
query string

en

Preferred language for response messages

Request body fields

customer_idExample
string

Example field from the request body.

delivery_idExample
string

Example field from the request body.

typeExample
string

Example field from the request body.

directionExample
string

Example field from the request body.

statusExample
string

Example field from the request body.

contentExample
string

Example field from the request body.

communication_detailsExample
object

Example field from the request body.

communication_details.senderExample
object

Example field from the request body.

communication_details.sender.user_idExample
string

Example field from the request body.

communication_details.sender.system_componentExample
string

Example field from the request body.

communication_details.sender.phoneExample
string

Example field from the request body.

communication_details.recipientExample
object

Example field from the request body.

communication_details.recipient.phoneExample
string

Example field from the request body.

communication_details.recipient.nameExample
string

Example field from the request body.

communication_details.template_idExample
string

Example field from the request body.

communication_details.template_variablesExample
object

Example field from the request body.

communication_details.template_variables.delivery_idExample
string

Example field from the request body.

communication_details.template_variables.delivery_windowExample
string

Example field from the request body.

communication_details.attachmentsExample
array<object>

Example field from the request body.

communication_details.attachments.nameExample
string

Example field from the request body.

communication_details.attachments.typeExample
string

Example field from the request body.

communication_details.attachments.urlExample
string

Example field from the request body.

communication_details.attachments.sizeExample
number

Example field from the request body.

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Content-TypeOptional
header string

application/json

Responses

Success Response201Created
Error - Invalid Communication Type400Bad Request
Error - Insufficient Permissions403Forbidden