Create an API key
In the app, open Developers, then API keys. The key is shown once; keep it in your secrets.
LINES_KEY=sk_live_…f3a9
# scopes: messages:read, messages:send
A REST API with signed webhooks, live events and an MCP server. Create a key in the app and send your first message with one request.
Webhooks are signed and retried up to 6 times.
curl -X POST https://api.clyxmail.com/v1/messages \
-H "Authorization: Bearer sk_live_…" \
-H "Idempotency-Key: 7f2c…" \
-d '{"to": "+14155550142", "text": "Hi Hannah"}'
# 202 Accepted
{
"id": "msg_8Hq2…",
"status": "queued",
"service": null
}
In the app, open Developers, then API keys. The key is shown once; keep it in your secrets.
LINES_KEY=sk_live_…f3a9
# scopes: messages:read, messages:send
POST to /v1/messages with an Idempotency-Key. The answer is 202 with the message id.
await fetch(API + "/v1/messages", {
method: "POST", headers,
body: JSON.stringify({ to, text })
})
Add a webhook URL. Replies, receipts and reactions arrive signed, retried until you answer 2xx.
X-Signature: t=1795382…,v1=9c1f…
{ "type": "message.received",
"data": { "message": { … } } }
The same event JSON goes to your webhook and to the live stream at /v1/events. Webhooks are stored first and retried for about 10 minutes.
Check X-Signature: an HMAC-SHA256 of the timestamp and raw body with your secret. Reject anything older than 5 minutes.
message.receivedSomeone texted the line: text, attachments and the chat.
message.sent · delivered · readEach step of a message you sent. Read receipts come from iMessage.
message.fallbackiMessage couldn't reach them, so the message went as SMS.
message.failedIt couldn't be sent, with a reason such as recipient_not_allowed.
message.reactionA reaction was added to or removed from a message.
draft.created · approved · rejectedAn agent's draft and what the team did with it.
profile.online · offlineThe line started or stopped working.
Point Claude Code, Cursor or any MCP client that sends a header at /mcp with an API key. Each tool is an API call with that key, so its limits apply.
{ "mcpServers": { "lines": {
"url": "https://api.clyxmail.com/mcp",
"headers": { "Authorization": "Bearer sk_live_…" }
} } }
list_chats · read_messages · search_messagesRead the line's conversations and search them.
send_message · react · set_typing · mark_readAct in a chat. A drafts-only key makes a draft instead.
list_draftsSee what is waiting for a person to approve.
place_call · transfer_call · hangup_callStart and steer calls on the same number.
Approving draftsNot a tool on purpose: a person approves in the app.
Every error has a code and a sentence on what to do. Calls use the same keys, scopes and events as messages.
Calling covers the US and Canada; emergency numbers are refused on every path.
429 rate_limitedThe key's sends per hour are used up.
403 recipient_not_allowedThe number isn't on this key's list.
403 draft_only_keyThis key can make drafts, not send.
402 payment_requiredBilling needs attention; reading still works.
409 idempotency_key_reusedSame key, different body: nothing was sent.
503 line_unavailableThe line is having trouble; queued sends wait 15 minutes.