Get access to the SMS API
The SMS API lets your own software send and receive texts from your Line numbers. Line must approve your workspace first. Then you create API keys in Integrations > SMS API.
The full API reference, quickstart and code samples are at /developers.
Before you start
- You need the Owner or Admin role.
- You need a Line number that can send SMS.
- You must have consent to text every recipient, and you must honour opt-outs.
Request access
- In the main menu, select Integrations.
- Select SMS API.
- Select Set up SMS API. The API access page opens.
- In Use case, describe what you will send.
- In Expected messages each month, enter a number.
- In Consent process, describe how recipients agree to get texts.
- Select the consent check box.
- Select Request access.
The Status changes to Pending. Line reviews the request. When Line approves it, the status changes to Active. If Line rejects it, the page shows the reason.
Create an API key
- Open Integrations > SMS API > API access.
- In API keys, select Create key.
- Enter a Name.
- In Environment, select Test or Live.
- In Sender, select the number that the key can send from.
- Select the Scopes that the key needs.
- Select Create key.
- Select Copy and store the key in a safe place.
Important: Line shows the full key only once. If you lose it, create a new key and revoke the old one.
Test keys start with line_sk_test_. Live keys start with line_sk_live_.
Test with the sandbox
A test key uses the same URLs as a live key. It sends no real texts and uses no credits. Its messages, events and webhooks stay apart from your live data.
The last four digits of the recipient number set the result:
| Recipient ends in | Result |
|---|---|
0002 | failed |
0003 | undelivered |
| Any other digits | delivered |
You can also simulate a customer reply, STOP or START with a test key. See the sandbox section at /developers.
Request a sender name
A sender name shows instead of a number, for example ACMEDENTAL. Recipients cannot reply to it. It sends only to UK and Irish numbers.
- Open Integrations > SMS API > API access.
- In Sender names, select Request name.
- Enter a name of 3 to 11 letters, numbers or spaces.
- Select Request name.
Line reviews each name. Use only your own business name or brand.
Costs
Live sends use credits from your credit wallet, per segment. Line reserves the credits when it accepts the message. A UK send that the network reports as failed or undelivered gets its credits back. See Credits and usage.
Common problems
I do not see SMS API in Integrations. Only Owners and Admins see it.
My request is still Pending. Line reviews each request by hand. Contact support@useline.io if you need a decision.
A live send is refused for credits. Sends stop when the wallet has fewer than 20 credits. Buy credits or turn on automatic top-up.