List messages
Message history.
status?stringOne 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.
"queued""sent""delivered""read""failed""expired""unknown""received"campaign_id?stringuuidphone?stringrequest_id?stringThe X-Request-Id of the send that wrote them, or the campaign batch.
^[A-Za-z0-9._-]+$length <= 64channel?stringOne channel, as GET /channels lists them (sms, whatsapp, ...); every channel when absent. Any other is 400 invalid_value.
since?stringCreated at or after this time.
date-timeuntil?stringCreated before this time.
date-timetest?booleanLists test messages instead of live ones. Always true for a test key.
falselimit?integer1 <= value <= 20050cursor?stringThe next_cursor of the previous page. Opaque.
X-Request-Id?stringYour 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 } ]}Get usage cycle GET
This cycle's usage against the workspace's plan. Cycles start when the plan was assigned (or the workspace was made, with no plan) and run the plan's cycle_days, 30 by default. Sent units per kind, per number and campaigns, against the plan's allowances. Counted, never enforced.
Send message POST
Send one body to up to 1,000 numbers, now. SMS by default. WhatsApp carries an approved template and nothing else: name one from `GET /v1/messages/templates` and fill its placeholders in order. Instagram sends one message to one person who wrote first: `to` is their Instagram-scoped id, from `GET /v1/conversations?channel=instagram`. Every type goes the same way and answers `{status, channel, messages}`. A test key is refused with `not_configured`. Send an `Idempotency-Key`. Without one, each request is a new send, so a retry after a timeout may send and charge twice. Send `from` and `content`, or the older `body`, `sender_id` and `template`. Both make the same send; one request in both is refused. A `503 provider_unavailable` does not prove the messages were not sent. Look for them before sending again.