LineDevelopers

SMS Messaging API

v2026-10-08

The approved Line SMS API.

Every request needs an organisation-scoped test or live bearer key. A live send needs a permitted sender, a recipient who has not opted out, enough wallet credits, and an Idempotency-Key. Your account confirms consent for its recipients when it asks for access; Line enforces the opt-out list.

A send leaves for the network as soon as Line accepts it. A queued or scheduled response means Line accepted durable work. It does not mean the network or handset received it. A UK send that the network reports as failed or undelivered is refunded.

Test keys use isolated sandbox records. They never call the provider, debit the live wallet, or start live workflows. In the sandbox:

  • The last four digits of the recipient pick the outcome: 0002 ends failed, 0003 ends undelivered, and any other number ends delivered.
  • POST /api/v1/sandbox/inbound simulates a customer reply, including STOP and START.
  • Events go to webhooks created with a test key, signed the same way as live events, with livemode: false.
Base URL
https://staging.useline.io
OpenAPI 3.1.0 description

Account

Authentication, senders, and usage.

GETTest authentication and inspect limits/api/v1/accountGETList permitted SMS numbers/api/v1/phone-numbersGETList alphanumeric sender names/api/v1/sender-namesGETRead wallet, reservations, and application limits/api/v1/usage

Messages

Preview, send, schedule, batch, and inspect SMS messages.

GETList and filter SMS messages/api/v1/messagesPOSTSend or schedule one SMS/api/v1/messagesPOSTPreview encoding, segments, cost, and policy/api/v1/messages/previewPOSTSend up to 500 messages in one request/api/v1/messages/batchGETGet one SMS message/api/v1/messages/{messageId}POSTCancel a scheduled or queued message/api/v1/messages/{messageId}/cancel

Templates

Versioned message templates with variables.

GETList templates/api/v1/templatesPOSTCreate a template/api/v1/templatesGETGet a template/api/v1/templates/{templateId}PATCHRename a template or change its body/api/v1/templates/{templateId}DELArchive a template/api/v1/templates/{templateId}

Opt-outs

The account's SMS opt-out list.

GETList opt-outs/api/v1/opt-outsPOSTAdd a number to the opt-out list/api/v1/opt-outsGETCheck one number/api/v1/opt-outs/{phoneNumber}DELRemove an opt-out added through the API/api/v1/opt-outs/{phoneNumber}

Lookups

Validate and classify a number before sending.

GETValidate and classify a number/api/v1/lookups/{phoneNumber}

Events

Poll customer events.

GETPoll customer events/api/v1/eventsGETGet one authoritative event/api/v1/events/{eventId}

Webhooks

Receive signed customer events at your own URL.

GETList the account's webhooks/api/v1/webhooksPOSTCreate a signed webhook/api/v1/webhooksGETGet a webhook/api/v1/webhooks/{webhookId}PATCHChange a webhook's URL, events, senders or status/api/v1/webhooks/{webhookId}DELDelete a webhook/api/v1/webhooks/{webhookId}POSTRotate the signing secret/api/v1/webhooks/{webhookId}/rotate-secretPOSTSend a signed test event/api/v1/webhooks/{webhookId}/testGETList delivery attempts/api/v1/webhooks/{webhookId}/deliveriesPOSTReplay a finished delivery/api/v1/webhooks/{webhookId}/deliveries/{deliveryId}/replay

Sandbox

Test keys only. Simulate what a customer does.

POSTSimulate a customer reply/api/v1/sandbox/inbound