Long-lived SMS API guide
Every active number has one ready-to-use private API link. There are no formats or extra parameters to configure: copy the link after purchase and read it from your authorized system.
1. Copy the API link after purchase
Sign in, open Active Numbers or Order History, locate the number and select Copy API. The URL is already bound to the correct order and number.
- Choose a country, service, validity tier and available prefix.
- Confirm the final price shown at checkout.
- Select Copy API on the active-number card.
- Store the URL in a protected server-side configuration.
2. Read the response directly
Send an HTTP GET request to the private URL. The default JSON response contains the current status, latest code, code timestamp and number expiry time.
GET https://lfrelay.com/api/v1/receive/YOUR_PRIVATE_TOKEN
{
"code": 1,
"msg": "ok",
"data": {
"status": "waiting",
"code": null,
"code_time": null,
"expired_date": "2026-12-31 23:59:59"
}
}3. Poll about once every 60 seconds
A 60-second interval is suitable for normal workflows and avoids unnecessary requests. Receiving one message does not remove the number; the same URL continues to work while the order remains active.
- waiting: no new message yet; check again later.
- received: store the code and timestamp.
- expired or unavailable: stop polling and review the order.
- network error: retry with increasing delay rather than rapid loops.
4. Protect the link like a password
Anyone holding the private URL may read results for that number. Keep it in a controlled server environment and never expose it in public pages, screenshots, group chats or source repositories.
- Do not hard-code it in browser JavaScript.
- Redact full URLs and tokens from logs.
- Grant staff only the access required for their role.
- If exposed, stop using it and contact support@lfrelay.com.
