Messages

List messages

Message history.

Query Parameters

status?string

One set for every channel, moving only forward: queued (with Ghala), sent (the provider took it), delivered, then read on channels that report it. failed and expired end a message not yet delivered, with a failure_reason. unknown is a send the provider may have taken without saying so: charged, never sent again, and moved on by a later report. received is an inbound message.

Value in"queued""sent""delivered""read""failed""expired""unknown""received"
campaign_id?string
Formatuuid
phone?string
request_id?string

The X-Request-Id of the send that wrote them, or the campaign batch.

Match^[A-Za-z0-9._-]+$
Lengthlength <= 64
channel?string

One channel, as GET /channels lists them (sms, whatsapp, ...); every channel when absent. Any other is 400 invalid_value.

since?string

Created at or after this time.

Formatdate-time
until?string

Created before this time.

Formatdate-time
test?boolean

Lists test messages instead of live ones. Always true for a test key.

Defaultfalse
limit?integer
Range1 <= value <= 200
Default50
cursor?string

The next_cursor of the previous page. Opaque.

Header Parameters

X-Request-Id?string

Your id for this request; it becomes the request_id of any error. Without it the server makes one.

curl -X GET 'https://v3.ghala.io/v1/messages'
{  "next_cursor": "string",  "has_more": true,  "data": [    {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "phone": "string",      "body": "string",      "content": {        "type": "text",        "text": "string"      },      "parts": 0,      "sender_id": "string",      "from": "string",      "channel": "sms",      "campaign_id": "78614b6c-fe7c-41e2-8e25-c9b3a3c91904",      "run_id": "dded282c-8ebd-44cf-8ba5-9a234973d1ec",      "provider_message_id": "string",      "request_id": "string",      "status": "queued",      "error": "string",      "failure_reason": "rejected",      "price_minor": 0,      "submitted_at": "2019-08-24T14:15:22Z",      "delivered_at": "2019-08-24T14:15:22Z",      "read_at": "2019-08-24T14:15:22Z",      "failed_at": "2019-08-24T14:15:22Z",      "created_at": "2019-08-24T14:15:22Z",      "test": true    }  ]}