Gather Gather Lines Sign in Get started

Endpoints

Messaging (SMS)

Send and receive texts on your numbers by API, with a webhook for each text that comes in.

Messaging works on numbers you claimed from stock. Send a text from one of them, read the texts it sent and received, and get a message.received webhook for each text that comes in.

NOTE Messaging is text only for now: no MMS (pictures, video or group texts). Delivery receipts are not reported yet: submitted means the carrier accepted the text, not that the handset got it.

Every call needs a live key (gk_live_…). Sandbox keys and accounts still in review get 403 live_customer_required. Phone numbers here are E.164, with the + (+14125550123), unlike the number endpoints, which take digits only.

Send a text

POST /v1/gather/lines/message/send
Idempotency-Key: 5b0e7c4a-reminder-8812
Content-Type: application/json

{ "from": "+14125550123", "to": "+14125550188", "text": "Your table is ready." }

The body has exactly three fields, and any other field is refused:

Field Rules
from One of your numbers, live and not released.
to The recipient. Must be a different number from from.
text 1 to 1600 characters (Unicode, so emoji count as one each).

Idempotency-Key is required (up to 255 printable characters, no spaces). The same key with the same body returns the same message, so a retry never sends twice. The same key with a different body returns 409 idempotency_conflict. Use one key per text you mean to send.

The response is 202 Accepted with the message, queued to send:

{
  "id": "msg_2d711642b726b04401627ca9fbac32f5c8530fb1903cc4db02258717921a4881",
  "from": "+14125550123",
  "to": "+14125550188",
  "text": "Your table is ready.",
  "direction": "outbound",
  "status": "queued",
  "created_at": "2026-11-05T09:30:00Z",
  "expires_at": "2026-11-05T09:35:00Z"
}

202 means we have the text, not that it was sent. Read it back with its id to follow it.

Statuses

Status Meaning
queued We have it and will hand it to the carrier.
submitting Being handed to the carrier now.
submitted The carrier accepted it. This is the last status for now: delivery receipts are not reported yet.
failed Not sent. failure_code says why, for example expired.
submission_unknown We could not tell whether the carrier took it. It is never resent automatically, so check with the recipient before you send again.

A text that is not handed to the carrier within 5 minutes (expires_at) is not sent: it becomes failed with failure_code expired, so an old text never goes out late.

Get one message

GET /v1/gather/lines/message/id?id=msg_2d711642…

Returns one of your messages, sent or received, as above. A message that is not yours returns 404 not_found.

List messages

GET /v1/gather/lines/message/list?direction=inbound&number=%2B14125550123
Parameter
direction inbound (the default) or outbound.
number One of your numbers, E.164 (encode the + as %2B). Without it, all your numbers.
limit 1 to 100, default 50.
cursor The cursor from the last page.

Messages come oldest first, as data with a cursor:

{
  "data": [
    {
      "id": "msg_a1fce4363854ff888cff4b8e7875d600c2682390412a8cf79b37d0b11148b0fa",
      "from": "+14125550188",
      "to": "+14125550123",
      "text": "Thanks, on my way",
      "direction": "inbound",
      "status": "received",
      "created_at": "2026-11-05T09:31:12Z"
    }
  ],
  "cursor": "eyJwb3NpdGlvbiI6NDIsImJpbmRpbmciOiIuLi4ifQ"
}

Pass the cursor back with the same direction and number to get what came after. The cursor always comes back, even on an empty page, so you can poll with it: keep the last one and ask again later. A cursor from other filters is refused. Reading a message does not mark or delete it.

Receiving texts

Texts sent to your number show up as inbound messages with status received, in message/list and as a message.received webhook if you have set one. Use either, or both.

{
  "id": "evt_594e519ae499312b2943",
  "type": "message.received",
  "created_at": "2026-11-05T09:31:12Z",
  "data": {
    "id": "msg_a1fce4363854ff888cff4b8e7875d600c2682390412a8cf79b37d0b11148b0fa",
    "from": "+14125550188",
    "to": "+14125550123",
    "text": "Thanks, on my way",
    "direction": "inbound",
    "status": "received",
    "created_at": "2026-11-05T09:31:12Z"
  }
}

There is one event per text, and its id comes from the message, so a retried delivery has the same id: dedupe on it. Events are signed like every other webhook.

A webhook you set (or set again) starts from the next text: texts that arrived before it are not sent again, so read those with message/list. Texts older than the webhook retry window (about two days) are skipped too.

Sending limits

Each number has sending limits, so carriers keep treating it as a person's phone and don't flag or filter it:

Limit Default per number
Texts per minute 3
Texts per 24 hours 200
New contacts per 24 hours 50

Windows are rolling, not reset at midnight. A new contact is a number this line has never texted and that has never texted it, so replying to someone who texted you first does not count against it. Retrying a send that was already accepted (same Idempotency-Key) is not counted again.

A text over a limit is not queued. You get 429 rate_limited with a Retry-After header (seconds until it would fit), and the message names the limit it hit (per_minute, per_day or new_contacts_per_day):

{ "error": { "code": "rate_limited", "message": "This number reached its sending limit (per_minute: 3 a minute). Retry after 41 seconds." } }

Wait Retry-After seconds and send again with the same Idempotency-Key.

Reply ratio

Carriers watch how many texts a number sends compared with how many it gets back. A number that sends far more than it receives looks automated and gets filtered. So each number also has a reply-ratio rule: texts out per text in, over a rolling 24 hours and a rolling 6 hours.

Window Warns above Blocks new contacts above Checked once the number has sent
24 hours 1.5 texts out per text in (100+ sent) 2.0 texts out per text in 50 texts in the window
6 hours 2.0 texts out per text in 2.5 texts out per text in 50 texts in the window

Replies to people who have texted your number are never blocked by this rule. While the number is over, only texts to people who have never texted it are refused. That includes follow-ups to people you texted who never replied, since those are what push the ratio up. The refusal is 429 rate_limited naming reply_ratio, with Retry-After: 3600. That is an estimate: the number unblocks by itself as soon as both windows are back under, as replies come in or older sends age out.

Before it gets there, a number over a warning level triggers a number.sms_ratio_warning webhook, so you can slow down. You also get it if a send is refused for reply_ratio, in case the number jumped past the warning between two sends. It is sent at most once per number per 24 hours. Its data has line_id, number and sms_ratio. GET number/id shows the same sms_ratio: sent, received, people sent to, people received from, and the ratio for each window.

A failed send and an identical retry to the same number within a few seconds count as one text. The counts are per line: a number that was someone else's before starts fresh.

This rule is an early signal, not a guarantee. Carriers decide what to filter, and a number can be filtered while under every threshold here. Keep your texts conversational and reply-led.

If your use needs higher limits, tell us; we can change them for your account. See also Acceptable use.

Errors

Status Code When
403 live_customer_required A sandbox key, or an account still in review.
404 not_found from is not one of your live numbers, or the message is not yours.
409 idempotency_conflict The Idempotency-Key was used for a different text.
409 messaging_unavailable The number can't send texts right now, for example while it is suspended.
422 invalid_request A missing Idempotency-Key, an extra field, numbers that are not E.164 or are the same, or text empty or over 1600 characters.
429 rate_limited Over a sending limit. Honour Retry-After.
503 messaging_not_ready Messaging is briefly unavailable. Retry with the same Idempotency-Key.

All errors share one shape: see Errors.

1# Messaging (SMS)
2
3> Send and receive texts on your numbers by API, with a webhook for each text that comes in.
4
5Messaging works on numbers you claimed from [stock](/docs/numbers-stock). Send a text from one of
6them, read the texts it sent and received, and get a `message.received`
7[webhook](/docs/webhooks) for each text that comes in.
8
9> **NOTE** Messaging is text only for now: no MMS (pictures, video or group texts). Delivery
10> receipts are not reported yet: `submitted` means the carrier accepted the text, not that the
11> handset got it.
12
13Every call needs a live key (`gk_live_…`). Sandbox keys and accounts still in review get
14`403 live_customer_required`. Phone numbers here are E.164, with the `+` (`+14125550123`),
15unlike the number endpoints, which take digits only.
16
17## Send a text
18
19```http
20POST /v1/gather/lines/message/send
21Idempotency-Key: 5b0e7c4a-reminder-8812
22Content-Type: application/json
23
24{ "from": "+14125550123", "to": "+14125550188", "text": "Your table is ready." }
25```
26
27The body has exactly three fields, and any other field is refused:
28
29| Field | Rules |
30| --- | --- |
31| `from` | One of your numbers, live and not released. |
32| `to` | The recipient. Must be a different number from `from`. |
33| `text` | 1 to 1600 characters (Unicode, so emoji count as one each). |
34
35`Idempotency-Key` is required (up to 255 printable characters, no spaces). The same key with the
36same body returns the same message, so a retry never sends twice. The same key with a different
37body returns `409 idempotency_conflict`. Use one key per text you mean to send.
38
39The response is `202 Accepted` with the message, queued to send:
40
41```json
42{
43 "id": "msg_2d711642b726b04401627ca9fbac32f5c8530fb1903cc4db02258717921a4881",
44 "from": "+14125550123",
45 "to": "+14125550188",
46 "text": "Your table is ready.",
47 "direction": "outbound",
48 "status": "queued",
49 "created_at": "2026-11-05T09:30:00Z",
50 "expires_at": "2026-11-05T09:35:00Z"
51}
52```
53
54`202` means we have the text, not that it was sent. Read it back with its `id` to follow it.
55
56### Statuses
57
58| Status | Meaning |
59| --- | --- |
60| `queued` | We have it and will hand it to the carrier. |
61| `submitting` | Being handed to the carrier now. |
62| `submitted` | The carrier accepted it. This is the last status for now: delivery receipts are not reported yet. |
63| `failed` | Not sent. `failure_code` says why, for example `expired`. |
64| `submission_unknown` | We could not tell whether the carrier took it. It is never resent automatically, so check with the recipient before you send again. |
65
66A text that is not handed to the carrier within 5 minutes (`expires_at`) is not sent:
67it becomes `failed` with `failure_code` `expired`, so an old text never goes out late.
68
69## Get one message
70
71```http
72GET /v1/gather/lines/message/id?id=msg_2d711642…
73```
74
75Returns one of your messages, sent or received, as above. A message that is not yours returns
76`404 not_found`.
77
78## List messages
79
80```http
81GET /v1/gather/lines/message/list?direction=inbound&number=%2B14125550123
82```
83
84| Parameter | |
85| --- | --- |
86| `direction` | `inbound` (the default) or `outbound`. |
87| `number` | One of your numbers, E.164 (encode the `+` as `%2B`). Without it, all your numbers. |
88| `limit` | 1 to 100, default 50. |
89| `cursor` | The `cursor` from the last page. |
90
91Messages come oldest first, as `data` with a `cursor`:
92
93```json
94{
95 "data": [
96 {
97 "id": "msg_a1fce4363854ff888cff4b8e7875d600c2682390412a8cf79b37d0b11148b0fa",
98 "from": "+14125550188",
99 "to": "+14125550123",
100 "text": "Thanks, on my way",
101 "direction": "inbound",
102 "status": "received",
103 "created_at": "2026-11-05T09:31:12Z"
104 }
105 ],
106 "cursor": "eyJwb3NpdGlvbiI6NDIsImJpbmRpbmciOiIuLi4ifQ"
107}
108```
109
110Pass the `cursor` back with the same `direction` and `number` to get what came after. The cursor
111always comes back, even on an empty page, so you can poll with it: keep the last one and ask again
112later. A cursor from other filters is refused. Reading a message does not mark or delete it.
113
114## Receiving texts
115
116Texts sent to your number show up as `inbound` messages with status `received`, in `message/list`
117and as a `message.received` webhook if you have set one. Use either, or both.
118
119```json
120{
121 "id": "evt_594e519ae499312b2943",
122 "type": "message.received",
123 "created_at": "2026-11-05T09:31:12Z",
124 "data": {
125 "id": "msg_a1fce4363854ff888cff4b8e7875d600c2682390412a8cf79b37d0b11148b0fa",
126 "from": "+14125550188",
127 "to": "+14125550123",
128 "text": "Thanks, on my way",
129 "direction": "inbound",
130 "status": "received",
131 "created_at": "2026-11-05T09:31:12Z"
132 }
133}
134```
135
136There is one event per text, and its `id` comes from the message, so a retried delivery has the
137same `id`: dedupe on it. Events are signed like every other [webhook](/docs/webhooks).
138
139A webhook you set (or set again) starts from the next text: texts that arrived before it are not
140sent again, so read those with `message/list`. Texts older than the webhook retry window (about two
141days) are skipped too.
142
143## Sending limits
144
145Each number has sending limits, so carriers keep treating it as a person's phone and don't flag
146or filter it:
147
148| Limit | Default per number |
149| --- | --- |
150| Texts per minute | 3 |
151| Texts per 24 hours | 200 |
152| New contacts per 24 hours | 50 |
153
154Windows are rolling, not reset at midnight. A new contact is a number this line has never texted
155and that has never texted it, so replying to someone who texted you first does not count against
156it. Retrying a send that was already accepted (same `Idempotency-Key`) is not counted again.
157
158A text over a limit is not queued. You get `429 rate_limited` with a `Retry-After` header (seconds
159until it would fit), and the message names the limit it hit (`per_minute`, `per_day` or
160`new_contacts_per_day`):
161
162```json
163{ "error": { "code": "rate_limited", "message": "This number reached its sending limit (per_minute: 3 a minute). Retry after 41 seconds." } }
164```
165
166Wait `Retry-After` seconds and send again with the same `Idempotency-Key`.
167
168### Reply ratio
169
170Carriers watch how many texts a number sends compared with how many it gets back. A number
171that sends far more than it receives looks automated and gets filtered. So each number also
172has a reply-ratio rule: texts out per text in, over a rolling 24 hours and a rolling 6 hours.
173
174| Window | Warns above | Blocks new contacts above | Checked once the number has sent |
175| --- | --- | --- | --- |
176| 24 hours | 1.5 texts out per text in (100+ sent) | 2.0 texts out per text in | 50 texts in the window |
177| 6 hours | 2.0 texts out per text in | 2.5 texts out per text in | 50 texts in the window |
178
179**Replies to people who have texted your number are never blocked by this rule.** While the number
180is over, only texts to people who have never texted it are refused. That includes follow-ups to
181people you texted who never replied, since those are what push the ratio up. The refusal is
182`429 rate_limited` naming `reply_ratio`, with `Retry-After: 3600`. That is an estimate: the number
183unblocks by itself as soon as both windows are back under, as replies come in or older sends age out.
184
185Before it gets there, a number over a warning level triggers a
186`number.sms_ratio_warning` [webhook](/docs/webhooks), so you can slow down. You also get it if a
187send is refused for `reply_ratio`, in case the number jumped past the warning between two sends.
188It is sent at most once per number per 24 hours. Its `data` has `line_id`, `number` and `sms_ratio`. `GET number/id` shows the
189same `sms_ratio`: sent, received, people sent to, people received from, and the ratio for each
190window.
191
192A failed send and an identical retry to the same number within a few seconds count as one text.
193The counts are per line: a number that was someone else's before starts fresh.
194
195This rule is an early signal, not a guarantee. Carriers decide what to filter, and a number can
196be filtered while under every threshold here. Keep your texts conversational and reply-led.
197
198If your use needs higher limits, tell us; we can change them for your account. See also
199[Acceptable use](/docs/acceptable-use).
200
201## Errors
202
203| Status | Code | When |
204| --- | --- | --- |
205| 403 | `live_customer_required` | A sandbox key, or an account still in review. |
206| 404 | `not_found` | `from` is not one of your live numbers, or the message is not yours. |
207| 409 | `idempotency_conflict` | The `Idempotency-Key` was used for a different text. |
208| 409 | `messaging_unavailable` | The number can't send texts right now, for example while it is suspended. |
209| 422 | `invalid_request` | A missing `Idempotency-Key`, an extra field, numbers that are not E.164 or are the same, or `text` empty or over 1600 characters. |
210| 429 | `rate_limited` | Over a sending limit. Honour `Retry-After`. |
211| 503 | `messaging_not_ready` | Messaging is briefly unavailable. Retry with the same `Idempotency-Key`. |
212
213All errors share one shape: see [Errors](/docs/errors).
214
$ curl -s https://lines.gatherat.ai/docs/messaging.md
200 OK · text/markdown; charset=utf-8 · 8,928 bytes
# Messaging (SMS) > Send and receive texts on your numbers by API, with a webhook for each text that comes in. Messaging works on numbers you claimed from [stock](/docs/numbers-stock). Send a text from one of them, read the texts it sent and received, and get a `message.received` [webhook](/docs/webhooks) for each text that comes in. > **NOTE** Messaging is text only for now: no MMS (pictures, video or group texts). Delivery > receipts are not reported yet: `submitted` means the carrier accepted the text, not that the > handset got it. Every call needs a live key (`gk_live_…`). Sandbox keys and accounts still in review get `403 live_customer_required`. Phone numbers here are E.164, with the `+` (`+14125550123`), …