Docs / API reference
RepLine API
Send texts, place calls and read your conversations and contacts from your own software, and get a signed webhook the moment a customer replies or a booking is made.
On this page
Overview
The API is JSON over HTTPS. Every request goes to one base URL, authenticates with a bearer API key, and works only on the workspace the key belongs to.
https://repline.net/api/v1Requests with a body must send Content-Type: application/json. Timestamps are ISO 8601 in UTC. Phone numbers are always E.164 (a +, then 8 to 15 digits).
Authentication
Create an API key in the dashboard, then send it with every request.
- Sign in to RepLine as the workspace owner and open Settings, then Connections (the API section at /admin/integrations).
- Under "API keys", type a name in "New key name", tick the scopes the integration needs, and choose when the key should stop working under "Expires" (Never expires, 30 days, 90 days, 1 year, or a date you pick), and press Create. Leave "Custom rate limit" empty unless you need a different request budget.
- Copy the key straight away. RepLine shows the full key once and stores only a hash, so it cannot be shown again. Lose it and you create a new one.
- Send it on every request as a bearer token: Authorization: Bearer repline_live_…
curl https://repline.net/api/v1/agents \
-H "Authorization: Bearer repline_live_…"- Only a workspace owner can create or revoke keys. Managers and above can see the list (name, scopes, last used) but never a key itself.
- A key belongs to one workspace and can only ever read or write that workspace. There is no way to pass a different workspace in a request.
- Keys start with repline_live_. Keep them on a server. Never put one in a mobile app, a browser page or a public repository.
- A key works until you revoke it or, if you gave it an expiry when you created it, until that moment. "Never expires" is the default, so a key you did not give an expiry keeps working until revoked. A key past its expiry is rejected with 401, and the message says the day it expired. An owner can revoke a key at any time from the same page, and a revoked key is rejected with 401 straight away.
Keys are managed at /admin/integrations inside the app.
Scopes
Each key carries scopes, chosen when the key is created, and each endpoint needs one. A key without the scope gets a 403 that names it. Give a key only what its integration uses.
| Scope | Allows | Notes |
|---|---|---|
| messages:send | Send messagesPOST /messages | |
| conversations:read | Read conversationsGET /conversations | |
| contacts:read | Read contactsGET /contacts | |
| contacts:write | Create/update contactsPOST /contacts | |
| agents:read | Read agentsGET /agents | |
| calls:originate | Originate callsPOST /calls | Also required to list calls (GET /calls), because that response includes summaries and transcripts. |
| * | Everythingall endpoints | Satisfies every capability check. Use only for a key you fully control. |
| rate_limit:NNN | Custom rate limitall endpoints | Requests per minute for this key, 1 to 100,000. Set with the "Custom rate limit" box when you create the key. |
Rate limits
- Each key may make 100 requests per minute unless it was created with a custom limit. The window slides: it counts the requests made in the last 60 seconds.
- Every request counts, including ones that are rejected with 429. Keep hammering and the window stays full, so back off when you are told to.
- A 429 response carries a Retry-After: 60 header and error.details.retryAfterSeconds: 60. Wait that long, then retry.
- There are no X-RateLimit-* headers. Count your own requests if you need to stay under the limit.
- Requests with a missing or invalid key are rejected before they are counted.
HTTP/1.1 429 Too Many Requests
Retry-After: 60
{
"error": {
"code": "RATE_LIMITED",
"message": "Rate limit exceeded",
"details": {
"retryAfterSeconds": 60
}
}
}Pagination
- GET /conversations, GET /contacts and GET /agents use cursor pagination. Pass limit (1 to 100, default 50).
- If there are more rows, the response includes nextCursor. Send it back as cursor to get the next page.
- On the last page nextCursor is left out of the response entirely (it is not null). An invalid limit gives 422.
- GET /calls is different: it takes only limit (default 50, up to 200) and returns the most recent calls with no cursor.
curl "https://repline.net/api/v1/contacts?limit=50&cursor=<nextCursor>" \
-H "Authorization: Bearer $REPLINE_API_KEY"Errors
- Every error uses the same envelope: an error object with a stable code, a human-readable message and, for validation and rate-limit errors, details.
- Switch on error.code and the HTTP status, not on message. Messages are for people and may be reworded.
- For VALIDATION_ERROR on a body or query, details is { formErrors: string[], fieldErrors: { [field]: string[] } }.
{
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid body",
"details": {
"formErrors": [],
"fieldErrors": {
"contactPhone": [
"Invalid"
]
}
}
}
}| Status | error.code | error.message | When |
|---|---|---|---|
| 401 | UNAUTHORIZED | Missing API key | No Authorization: Bearer header, or it is not in that form. |
| 401 | UNAUTHORIZED | Invalid API key | The key does not exist or is not a RepLine key. |
| 401 | UNAUTHORIZED | API key revoked | The key was revoked by an owner. |
| 401 | UNAUTHORIZED | API key expired on <YYYY-MM-DD> (UTC). Ask a workspace owner to create a new key under Messages, API, and switch your integration to it. | The key was created with an expiry and that moment has passed. Keys created without one never expire. The message names the day it expired (UTC). |
| 403 | FORBIDDEN | API key needs scope "<scope>" | The key is valid but lacks the scope the endpoint requires. The message names the scope. |
| 403 | ADDON_REQUIRED | This needs the API add-on. An account owner can add it under Billing. | The key is valid, but the workspace has not turned on the API add-on (or its billing needs attention). The response also carries addon: "api". Existing keys work again as soon as the add-on is on. |
| 422 | VALIDATION_ERROR | Invalid body | The body or query failed validation. Also "Invalid query" for GET endpoints and "Body must be JSON" for an unparseable body. |
| 429 | RATE_LIMITED | Rate limit exceeded | The key went over its per-minute budget. See Rate limits. |
| 500 | INTERNAL_ERROR | Internal error | Something failed on our side. Safe to retry after a short wait. |
Each endpoint below lists the errors specific to it as well.
Endpoints
- POST /messages Send a text message
- GET /conversations List conversations
- GET /contacts List contacts
- POST /contacts Create or update a contact
- GET /opt-outs List opted-out numbers
- GET /agents List agents
- POST /calls Place an outbound call
- GET /calls List recent calls
POST/api/v1/messages
Send a text message
Queues a text from an agent’s RepLine number to a contact and returns immediately. The message goes out a moment later. Delivery results arrive as message.sent and message.failed webhooks.
If the contact does not exist yet it is created, and the conversation between that agent’s number and the contact is found or created.
Scope: messages:send
Body (JSON)
| Name | Type | Required | Description |
|---|---|---|---|
| agentId | string | Yes | The agent whose RepLine number sends the message. Get IDs from GET /agents. |
| contactPhone | string | Yes | Recipient. E.164: a + followed by 8 to 15 digits, such as +15555550100. |
| body | string | Yes | Message text, 1 to 1,600 characters. Also the fallback text for a rich card. |
| mediaUrls | string[] | No | Up to 8 publicly reachable picture URLs. When present the message is sent as MMS. Keep them under 1 MB in total, because the carrier network refuses larger picture messages. |
| purpose | "auth_code" | "emergency" | No | Marks a text that must go out now. If the workspace delays outgoing texts during quiet hours, these are never held: a sign-in code would expire before morning. Leave it out for everything else. |
| richCard | object | No | A branded RCS card. See the table below. |
richCard
| Name | Type | Required | Description |
|---|---|---|---|
| title | string | Yes | 1 to 200 characters. |
| description | string | No | Up to 2,000 characters. |
| mediaUrl | string | No | A URL for the card image. |
| suggestions | object[] | No | Up to 4 tappable buttons. Defaults to none. Shapes below. |
richCard.suggestions[]
| Name | Type | Required | Description |
|---|---|---|---|
| kind | "reply" | "open_url" | "dial" | Yes | Selects the shape of the button. |
| text | string | Yes | Button label, 1 to 25 characters. |
| postbackData | string | No | Sent back when tapped, up to 120 characters. Required (1 to 120) when kind is "reply". |
| url | string | No | Required when kind is "open_url". |
| phoneE164 | string | No | Required when kind is "dial". E.164: a + followed by 8 to 15 digits, such as +15555550100. |
Request
curl -X POST https://repline.net/api/v1/messages \
-H "Authorization: Bearer $REPLINE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agentId": "clx4agent0001abcd",
"contactPhone": "+15555550100",
"body": "Hi Dana, this is Sam from Summit Roofing. Your inspection is confirmed for tomorrow at 10am."
}'Response: 202
{
"conversationId": "clx7convo00001abcd",
"queued": true,
"quietHoursDelayed": false,
"quietHoursDelayMinutes": 0,
"scheduledFor": null
}| Field | Type | Description |
|---|---|---|
| conversationId | string | The thread the message was added to. |
| queued | boolean | Always true. 202 means accepted for sending, not delivered. |
| quietHoursDelayed | boolean | True when the workspace holds texts during quiet hours and this one was held. It is still accepted (202) and will be sent. |
| quietHoursDelayMinutes | number | How long it is held, in minutes. 0 when it was sent right away. |
| scheduledFor | string | null | ISO 8601 time the held text will be sent, when the quiet hours end. null when it was sent right away. |
Errors
| Status | error.code | error.message | When |
|---|---|---|---|
| 403 | FORBIDDEN | API key needs scope "messages:send" | The key is valid but was not granted this scope. |
| 404 | NOT_FOUND | agent not found | agentId does not exist in your workspace. |
| 422 | VALIDATION_ERROR | Invalid body, or the agent has no phone number, or the number is not in a state that can send (it must be assigned or provisioned). | |
| 412 | CONTACT_OPTED_OUT | Contact has opted out of SMS. | The contact replied STOP. Nothing is sent. Do not retry. |
| 503 | SIGNALWIRE_NOT_CONFIGURED | SignalWire is not configured on this RepLine deployment. | Texting is not set up on the server. Checked before the scope. |
| 500 | INTERNAL_ERROR | Failed to enqueue message | The message could not be queued. Safe to retry. |
| 500 | INTERNAL_ERROR | Failed to check quiet hours | RepLine could not read the workspace’s quiet-hours setting, so nothing was queued. Safe to retry. |
Plus the errors that apply to every endpoint: 401, 422 on bad input, 429 and 500.
- Quiet hours apply here the same way they do when someone sends from the app. If your workspace turned on "delay outgoing during quiet hours" and it is inside that window where the recipient is (judged from their area code), the text is held until the window ends: you still get 202, with quietHoursDelayed true and the send time in scheduledFor. A reply to a text the contact sent in the last 15 minutes goes out right away.
- A richCard is delivered as an RCS card only if the recipient’s phone supports RCS and the agent has a verified RCS brand. Otherwise RepLine sends the text in body (with the card image as MMS if there is one), so you can always pass a card.
- Contacts who texted STOP stay blocked until they text START. Respect the 412.
GET/api/v1/conversations
List conversations
Returns conversation threads in your workspace, most recently active first. Threads with no messages sort last.
Scope: conversations:read
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
| contactPhone | string | No | Only threads with this contact. Exact match on the E.164 number. |
| agentId | string | No | Only threads owned by this agent. |
| status | "OPEN" | "ARCHIVED" | "SNOOZED" | No | Only threads in this status: OPEN, ARCHIVED or SNOOZED. Any other value is a 422. |
| limit | integer | No | 1 to 100. Default 50. |
| cursor | string | No | The nextCursor from the previous page. |
Request
curl "https://repline.net/api/v1/conversations?contactPhone=%2B15555550100&status=OPEN&limit=20" \
-H "Authorization: Bearer $REPLINE_API_KEY"Response: 200
{
"conversations": [
{
"id": "clx7convo00001abcd",
"tenantId": "clx1tenant0001abcd",
"contactId": "clx6contact001abcd",
"agentId": "clx4agent0001abcd",
"phoneNumberId": "clx5number0001abcd",
"contextTag": null,
"status": "OPEN",
"lastMessageAt": "2026-10-30T16:09:42.017Z",
"unreadCount": 1,
"kind": "DIRECT",
"createdAt": "2026-10-30T16:04:11.482Z",
"updatedAt": "2026-10-30T16:09:42.017Z",
"contact": {
"id": "clx6contact001abcd",
"phoneE164": "+15555550100",
"name": "Dana Whitfield",
"email": "[email protected]",
"partnerPortalContactId": null
},
"phoneNumber": {
"e164": "+15555550123"
}
}
],
"nextCursor": "clx7convo00002abcd"
}| Field | Type | Description |
|---|---|---|
| id | string | Conversation ID. |
| tenantId | string | Your workspace ID. |
| contactId | string | The contact this thread is with. |
| agentId | string | null | The agent (rep) who owns the thread, if any. |
| phoneNumberId | string | The RepLine number the thread runs on. |
| contextTag | string | null | Free-form tag set by a rep or an integration. |
| status | "OPEN" | "ARCHIVED" | "SNOOZED" | Thread status. |
| lastMessageAt | string | null | ISO 8601 time of the latest message. Null if nothing was ever sent or received. |
| unreadCount | integer | Inbound messages not yet read in the app. |
| kind | string | Channel kind. "DIRECT" for a normal one-to-one thread. |
| createdAt | string | ISO 8601. |
| updatedAt | string | ISO 8601. |
| contact | object | { id, phoneE164, name, email, partnerPortalContactId }. name, email and partnerPortalContactId can be null. |
| phoneNumber | object | { e164 }: the RepLine number the thread runs on. |
Errors
| Status | error.code | error.message | When |
|---|---|---|---|
| 403 | FORBIDDEN | API key needs scope "conversations:read" | The key is valid but was not granted this scope. |
| 422 | VALIDATION_ERROR | A parameter is missing, the wrong type or out of range. `error.details` lists each field (see Errors above). |
Plus the errors that apply to every endpoint: 401, 422 on bad input, 429 and 500.
- This lists threads, not the messages inside them. To react to new messages as they arrive, subscribe to the message.received webhook.
- In a URL query string a + means a space, so write the plus sign of a phone number as %2B, as the example does.
GET/api/v1/contacts
List contacts
Returns contacts in your workspace, newest first.
Scope: contacts:read
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
| search | string | No | Case-insensitive match on name or email, or a substring of the phone number. |
| limit | integer | No | 1 to 100. Default 50. |
| cursor | string | No | The nextCursor from the previous page. |
Request
curl "https://repline.net/api/v1/contacts?search=whitfield&limit=20" \
-H "Authorization: Bearer $REPLINE_API_KEY"Response: 200
{
"contacts": [
{
"id": "clx6contact001abcd",
"tenantId": "clx1tenant0001abcd",
"phoneE164": "+15555550100",
"name": "Dana Whitfield",
"email": "[email protected]",
"metadata": {
"source": "website form"
},
"rcsCapable": false,
"rcsCapableCheckedAt": null,
"partnerPortalContactId": null,
"createdAt": "2026-10-30T16:04:11.482Z",
"updatedAt": "2026-10-30T16:09:42.017Z"
}
],
"nextCursor": "clx6contact002abcd"
}| Field | Type | Description |
|---|---|---|
| id | string | Contact ID. |
| tenantId | string | Your workspace ID. |
| phoneE164 | string | The contact’s number in E.164 form. Unique within a workspace. |
| name | string | null | Display name. |
| string | null | Email address. | |
| metadata | object | Free-form JSON you attach. Empty object when none. |
| rcsCapable | boolean | Last known RCS reachability for this number. |
| rcsCapableCheckedAt | string | null | ISO 8601 time of the last RCS check, if one has run. |
| partnerPortalContactId | string | null | Your own ID for this person, if you set one. |
| createdAt | string | ISO 8601. |
| updatedAt | string | ISO 8601. |
Errors
| Status | error.code | error.message | When |
|---|---|---|---|
| 403 | FORBIDDEN | API key needs scope "contacts:read" | The key is valid but was not granted this scope. |
| 422 | VALIDATION_ERROR | A parameter is missing, the wrong type or out of range. `error.details` lists each field (see Errors above). |
Plus the errors that apply to every endpoint: 401, 422 on bad input, 429 and 500.
POST/api/v1/contacts
Create or update a contact
Creates the contact, or updates it if a contact with that phone number already exists in your workspace. The phone number is the unique key.
Scope: contacts:write
Body (JSON)
| Name | Type | Required | Description |
|---|---|---|---|
| phoneE164 | string | Yes | The contact’s number. E.164: a + followed by 8 to 15 digits, such as +15555550100. |
| name | string | No | Up to 160 characters. |
| string | No | A valid email address. | |
| metadata | object | No | Free-form JSON object to store with the contact. Leave it out to keep what is stored; send it to replace the stored object. |
| partnerPortalContactId | string | No | Your own ID for this person. Stored so you can match records later. |
Request
curl -X POST https://repline.net/api/v1/contacts \
-H "Authorization: Bearer $REPLINE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"phoneE164": "+15555550100",
"name": "Dana Whitfield",
"email": "[email protected]",
"metadata": {
"source": "website form"
}
}'Response: 201
{
"contact": {
"id": "clx6contact001abcd",
"tenantId": "clx1tenant0001abcd",
"phoneE164": "+15555550100",
"name": "Dana Whitfield",
"email": "[email protected]",
"metadata": {
"source": "website form"
},
"rcsCapable": false,
"rcsCapableCheckedAt": null,
"partnerPortalContactId": null,
"createdAt": "2026-10-30T16:04:11.482Z",
"updatedAt": "2026-10-30T16:09:42.017Z"
}
}| Field | Type | Description |
|---|---|---|
| contact | object | The saved contact. Same fields as GET /contacts. |
Errors
| Status | error.code | error.message | When |
|---|---|---|---|
| 403 | FORBIDDEN | API key needs scope "contacts:write" | The key is valid but was not granted this scope. |
| 422 | VALIDATION_ERROR | A parameter is missing, the wrong type or out of range. `error.details` lists each field (see Errors above). |
Plus the errors that apply to every endpoint: 401, 422 on bad input, 429 and 500.
- The status is 201 whether the contact was created or updated.
- On update, any field you leave out is left as it was, metadata included. When you do send metadata it replaces the stored object as a whole, not field by field, so send the complete object. Send an empty object ({}) to clear it.
GET/api/v1/opt-outs
List opted-out numbers
Returns every number in your workspace that texted a stop keyword and has not texted START since. RepLine will not text these numbers; a send to one returns 412.
This is the current list. A number that texts START drops off it, so syncing the whole list also picks up opt-ins, which have no webhook.
Scope: messages:send
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
| limit | integer | No | 1 to 1000. Default 500. |
| cursor | string | No | The nextCursor from the previous page. |
Request
curl "https://repline.net/api/v1/opt-outs?limit=500" \
-H "Authorization: Bearer $REPLINE_API_KEY"Response: 200
{
"optOuts": [
{
"phoneE164": "+15555550100",
"optedOutAt": "2026-10-30T16:04:11.482Z",
"reason": "keyword"
}
],
"nextCursor": null
}| Field | Type | Description |
|---|---|---|
| phoneE164 | string | The opted-out number, E.164. |
| optedOutAt | string | When they opted out (ISO 8601). |
| reason | string | null | keyword when they texted a stop word. |
Errors
| Status | error.code | error.message | When |
|---|---|---|---|
| 403 | FORBIDDEN | API key needs scope "messages:send" | The key is valid but was not granted this scope. |
| 422 | VALIDATION_ERROR | A parameter is missing, the wrong type or out of range. `error.details` lists each field (see Errors above). |
Plus the errors that apply to every endpoint: 401, 422 on bad input, 429 and 500.
- Needs the same scope as sending, so any key that texts people can check who refused texts.
GET/api/v1/agents
List agents
Returns the active agents (reps) in your workspace, newest first. You need an agent ID to send a message or place a call. Agents whose user account is deactivated are left out.
Scope: agents:read
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
| search | string | No | Case-insensitive match on the agent’s name or email. |
| limit | integer | No | 1 to 100. Default 50. |
| cursor | string | No | The nextCursor from the previous page. |
Request
curl "https://repline.net/api/v1/agents?search=sam&limit=20" \
-H "Authorization: Bearer $REPLINE_API_KEY"Response: 200
{
"agents": [
{
"id": "clx4agent0001abcd",
"tenantId": "clx1tenant0001abcd",
"userId": "clx4user00001abcd",
"slug": "sam-rivera",
"title": "Project Consultant",
"bio": null,
"photoUrl": null,
"photoThumbUrl": null,
"extension": "204",
"phoneNumberId": "clx5number0001abcd",
"createdAt": "2026-10-30T16:04:11.482Z",
"updatedAt": "2026-10-30T16:09:42.017Z",
"user": {
"id": "clx4user00001abcd",
"name": "Sam Rivera",
"email": "[email protected]",
"role": "REP"
},
"phoneNumber": {
"e164": "+15555550123"
}
}
]
}| Field | Type | Description |
|---|---|---|
| id | string | Agent ID. Pass it as agentId when you send a message or place a call. |
| tenantId | string | Your workspace ID. |
| userId | string | The user account behind the agent. |
| slug | string | URL slug of the agent’s public profile. |
| title | string | null | Job title. |
| bio | string | null | Short biography. |
| photoUrl | string | null | Profile photo. |
| photoThumbUrl | string | null | Thumbnail of the profile photo. |
| extension | string | null | Phone extension, if assigned. |
| phoneNumberId | string | null | The RepLine number assigned to the agent. An agent with none cannot send or call. |
| createdAt | string | ISO 8601. |
| updatedAt | string | ISO 8601. |
| user | object | { id, name, email, role }. |
| phoneNumber | object | null | { e164 }, or null when no number is assigned. |
Errors
| Status | error.code | error.message | When |
|---|---|---|---|
| 403 | FORBIDDEN | API key needs scope "agents:read" | The key is valid but was not granted this scope. |
| 422 | VALIDATION_ERROR | A parameter is missing, the wrong type or out of range. `error.details` lists each field (see Errors above). |
Plus the errors that apply to every endpoint: 401, 422 on bad input, 429 and 500.
- Each agent object also carries further profile and call-routing settings that are not listed here. Do not depend on a field that is not in this table.
POST/api/v1/calls
Place an outbound call
Dials a contact from an agent’s RepLine number. There are two modes. Without prompt, the call is answered and message is read aloud (text to speech). With prompt, the call is a two-way conversation run by the AI voice agent, following your instructions.
The call is created and dialed immediately. Results (status, summary, transcript, disposition) show up in GET /calls once the call ends.
Scope: calls:originate
Body (JSON)
| Name | Type | Required | Description |
|---|---|---|---|
| agentId | string | Yes | The agent whose RepLine number places the call. |
| toPhone | string | Yes | Who to call. E.164: a + followed by 8 to 15 digits, such as +15555550100. |
| message | string | Yes | 1 to 2,000 characters. Read aloud on answer when no prompt is given. |
| prompt | string | No | Up to 6,000 characters. Instructions for the AI voice agent. Makes the call a two-way AI conversation. |
| purpose | string | No | Up to 120 characters. A label stored on the call and returned by GET /calls. |
| voice | string | No | Up to 40 characters. English voice for AI calls, in engine.voice form, such as gcloud.en-US-Neural2-F. |
| voiceEs | string | No | Up to 40 characters. Spanish voice for AI calls. Defaults to voice. |
| timezone | string | No | Up to 64 characters. The callee’s IANA time zone, such as America/Chicago, so the AI knows what time it is for them. Worked out from the area code if you leave it out. |
Request
curl -X POST https://repline.net/api/v1/calls \
-H "Authorization: Bearer $REPLINE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agentId": "clx4agent0001abcd",
"toPhone": "+15555550100",
"message": "Hi, this is Summit Roofing calling to confirm your inspection tomorrow at 10am.",
"purpose": "appointment confirmation"
}'Response: 202
{
"callId": "clx8call000001abcd",
"signalwireCallSid": "5d1e0c2a-6f43-4b7e-9a4d-0c8f2b7e1a90",
"mode": "tts",
"queued": true
}| Field | Type | Description |
|---|---|---|
| callId | string | RepLine’s ID for the call. Find it later in GET /calls. |
| signalwireCallSid | string | null | The carrier-side call ID. Can be null for AI calls. |
| mode | "tts" | "ai" | "tts" reads message aloud. "ai" runs a two-way conversation from prompt. |
| queued | boolean | Always true. |
Errors
| Status | error.code | error.message | When |
|---|---|---|---|
| 403 | FORBIDDEN | API key needs scope "calls:originate" | The key is valid but was not granted this scope. |
| 404 | NOT_FOUND | agent not found | agentId does not exist in your workspace. |
| 422 | VALIDATION_ERROR | Invalid body, or the agent has no phone number, or the number is not in a state that can call. | |
| 412 | CONTACT_OPTED_OUT | Contact has opted out. | The contact is on your opt-out list. No call is placed. |
| 502 | AI_ORIGINATE_FAILED | prompt was given and the voice provider rejected the call. message holds the provider’s reply. The call is marked FAILED. | |
| 503 | SIGNALWIRE_NOT_CONFIGURED | SignalWire is not configured on this RepLine deployment. | Calling is not set up on the server. Checked before the scope. |
| 500 | INTERNAL_ERROR | Failed to originate call | A text-to-speech call could not be started. The call is marked FAILED. |
Plus the errors that apply to every endpoint: 401, 422 on bad input, 429 and 500.
- This places a real phone call to a real person. Test against a number you own.
GET/api/v1/calls
List recent calls
Returns the most recent calls in your workspace, newest first, with the AI summary, disposition and transcript when they have been captured.
This uses the same calls:originate scope as placing a call, because the response contains call summaries and transcripts. Grant it only to integrations that should see them.
Scope: calls:originate
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
| ai | "1" | No | Pass 1 to return only calls handled by the AI. The filter is applied before limit, so you get the newest limit AI calls, however many other calls came in between. |
| limit | integer | No | Default 50. Values above 200 are capped at 200 and values below 1 are raised to 1. Never rejected. |
Request
curl "https://repline.net/api/v1/calls?ai=1&limit=25" \
-H "Authorization: Bearer $REPLINE_API_KEY"Response: 200
{
"calls": [
{
"id": "clx8call000001abcd",
"direction": "OUTBOUND",
"from": "+15555550123",
"to": "+15555550100",
"status": "COMPLETED",
"startedAt": "2026-10-30T16:04:11.482Z",
"endedAt": "2026-10-30T16:06:02.000Z",
"durationSeconds": 111,
"agentId": "clx4agent0001abcd",
"contactId": "clx6contact001abcd",
"purpose": "appointment confirmation",
"disposition": null,
"summary": null,
"transcript": null,
"isAi": false
}
]
}| Field | Type | Description |
|---|---|---|
| id | string | Call ID. Matches the callId returned by POST /calls. |
| direction | "INBOUND" | "OUTBOUND" | Which way the call went. |
| from | string | Calling number, E.164. |
| to | string | Called number, E.164. |
| status | string | One of INITIATED, RINGING, ANSWERED, COMPLETED, FAILED, NO_ANSWER, BUSY, VOICEMAIL_DROPPED, AI_HANDLING. |
| startedAt | string | ISO 8601. |
| endedAt | string | null | ISO 8601, or null while the call is live. |
| durationSeconds | integer | null | Length of the call once it has ended. |
| agentId | string | null | The agent the call belongs to. |
| contactId | string | null | The contact on the other end. |
| purpose | string | null | The purpose you passed to POST /calls, if any. |
| disposition | string | null | Outcome recorded after an AI call. Null until recorded. |
| summary | JSON | null | The AI’s post-call summary. Null until it has been captured. |
| transcript | JSON | null | The call transcript. Null until it has been captured. |
| isAi | boolean | True for calls handled by the conversational AI. |
Errors
| Status | error.code | error.message | When |
|---|---|---|---|
| 403 | FORBIDDEN | API key needs scope "calls:originate" | The key is valid but was not granted this scope. |
Plus the errors that apply to every endpoint: 401, 422 on bad input, 429 and 500.
- There is no cursor. To see older calls than the latest 200, record call IDs as you place calls.
Webhooks
Instead of polling, give RepLine a URL and it sends you an HTTPS POST each time something you subscribed to happens. Every request is signed so you can prove it came from RepLine.
- Sign in as the workspace owner and open Settings, then Connections (/admin/integrations).
- Under "Webhooks", add your endpoint URL and choose the events you want. The URL must be a public https address. Internal and private addresses are refused.
- RepLine shows a signing secret that starts with whsec_. Store it on your server. The owner can copy it again from the same page.
- Return any 2xx status from your endpoint to acknowledge a delivery.
Request format
The body is JSON with the same envelope for every event.
| Field | Type | Description |
|---|---|---|
| id | string | Delivery ID. The same value on every retry and every manual replay, so use it to de-duplicate. |
| type | string | The event name, such as message.received. Also sent in the X-RepLine-Event header. |
| tenantId | string | Your workspace ID. |
| createdAt | string | ISO 8601 time the event was created. |
| data | object | The event payload. Its shape depends on type, see below. |
Headers
| X-RepLine-Signature | Hex HMAC-SHA256 of `${timestamp}.${rawBody}`, keyed with your whole whsec_… secret. |
| X-RepLine-Timestamp | Unix time in seconds when this attempt was signed. It is regenerated on every retry. |
| X-RepLine-Event | The event name. Same as type in the body. |
| Content-Type | application/json |
| User-Agent | RepLine-Webhooks/1.0 |
Delivery and retries
- Your endpoint has 15 seconds to answer. Any 2xx status counts as delivered. Any other status, a timeout or a connection error counts as a failure and is retried.
- RepLine tries up to 8 times. After a failed attempt it waits 30 seconds, 2 minutes, 5 minutes, 15 minutes, 1 hour, 4 hours, 12 hours, in that order, and after the eighth failure it stops.
- An address that RepLine refuses to call (a private or internal address) fails at once and is not retried.
- Retries and replays reuse the same delivery id and body, but get a fresh X-RepLine-Timestamp and signature. Make your handler idempotent: process each id once.
- Managers can see every delivery, with your endpoint’s response, and replay a failed one from Admin, Integrations, Partner portal (/admin/integrations/partner-portal).
- Deliveries are not guaranteed to arrive in order. Use occurredAt (or createdAt) to order events, not arrival time.
- Respond quickly and do the real work afterwards. Acknowledge with a 2xx first, then process.
Events
These events are sent today. Each section shows the data object inside the envelope.
message.received
A contact texted one of your numbers.
| Field | Type | Description |
|---|---|---|
| messageId | string | Message ID. |
| conversationId | string | The thread it belongs to. |
| direction | "INBOUND" | "OUTBOUND" | INBOUND is a text from the contact. |
| from | string | Sender, E.164. The contact on inbound, your RepLine number on outbound. |
| to | string | Recipient, E.164. Your RepLine number on inbound, the contact on outbound. |
| contactName | string | null | The contact’s name if RepLine has one. |
| body | string | The message text. |
| agentId | string | null | The agent that owns the thread, if any. |
| status | string | Message status when the event fired: QUEUED, SENDING, SENT, DELIVERED, FAILED or UNDELIVERED. |
| occurredAt | string | ISO 8601 time the thing happened. |
| receivedAt | string | Inbound only. The same value as occurredAt, kept for older integrations. |
| errorCode | string | Only present when the carrier reported a failure. |
| errorMessage | string | Only present when the carrier reported a failure. |
{
"id": "clxadelivery001abcd",
"type": "message.received",
"tenantId": "clx1tenant0001abcd",
"createdAt": "2026-10-30T16:04:11.482Z",
"data": {
"messageId": "clx9msg0000001abcd",
"conversationId": "clx7convo00001abcd",
"direction": "INBOUND",
"from": "+15555550100",
"to": "+15555550123",
"contactName": "Dana Whitfield",
"body": "Tomorrow at 10 works great, thanks!",
"agentId": "clx4agent0001abcd",
"status": "DELIVERED",
"occurredAt": "2026-10-30T16:04:11.000Z",
"receivedAt": "2026-10-30T16:04:11.000Z"
}
}message.sent
A text you sent was handed to the carrier, and again when the carrier confirmed delivery. Both events share the same messageId. Look at data.status: SENT, then DELIVERED.
| Field | Type | Description |
|---|---|---|
| messageId | string | Message ID. |
| conversationId | string | The thread it belongs to. |
| direction | "INBOUND" | "OUTBOUND" | INBOUND is a text from the contact. |
| from | string | Sender, E.164. The contact on inbound, your RepLine number on outbound. |
| to | string | Recipient, E.164. Your RepLine number on inbound, the contact on outbound. |
| contactName | string | null | The contact’s name if RepLine has one. |
| body | string | The message text. |
| agentId | string | null | The agent that owns the thread, if any. |
| status | string | Message status when the event fired: QUEUED, SENDING, SENT, DELIVERED, FAILED or UNDELIVERED. |
| occurredAt | string | ISO 8601 time the thing happened. |
| receivedAt | string | Inbound only. The same value as occurredAt, kept for older integrations. |
| errorCode | string | Only present when the carrier reported a failure. |
| errorMessage | string | Only present when the carrier reported a failure. |
{
"id": "clxadelivery001abcd",
"type": "message.sent",
"tenantId": "clx1tenant0001abcd",
"createdAt": "2026-10-30T16:04:11.482Z",
"data": {
"messageId": "clx9msg0000002abcd",
"conversationId": "clx7convo00001abcd",
"direction": "OUTBOUND",
"from": "+15555550123",
"to": "+15555550100",
"contactName": "Dana Whitfield",
"body": "Hi Dana, your inspection is confirmed for tomorrow at 10am.",
"agentId": "clx4agent0001abcd",
"status": "DELIVERED",
"occurredAt": "2026-10-30T16:05:03.000Z"
}
}message.failed
A text you sent could not be delivered. errorCode and errorMessage say why when the carrier gave a reason.
| Field | Type | Description |
|---|---|---|
| messageId | string | Message ID. |
| conversationId | string | The thread it belongs to. |
| direction | "INBOUND" | "OUTBOUND" | INBOUND is a text from the contact. |
| from | string | Sender, E.164. The contact on inbound, your RepLine number on outbound. |
| to | string | Recipient, E.164. Your RepLine number on inbound, the contact on outbound. |
| contactName | string | null | The contact’s name if RepLine has one. |
| body | string | The message text. |
| agentId | string | null | The agent that owns the thread, if any. |
| status | string | Message status when the event fired: QUEUED, SENDING, SENT, DELIVERED, FAILED or UNDELIVERED. |
| occurredAt | string | ISO 8601 time the thing happened. |
| receivedAt | string | Inbound only. The same value as occurredAt, kept for older integrations. |
| errorCode | string | Only present when the carrier reported a failure. |
| errorMessage | string | Only present when the carrier reported a failure. |
{
"id": "clxadelivery001abcd",
"type": "message.failed",
"tenantId": "clx1tenant0001abcd",
"createdAt": "2026-10-30T16:04:11.482Z",
"data": {
"messageId": "clx9msg0000003abcd",
"conversationId": "clx7convo00001abcd",
"direction": "OUTBOUND",
"from": "+15555550123",
"to": "+15555550100",
"contactName": "Dana Whitfield",
"body": "Hi Dana, your inspection is confirmed for tomorrow at 10am.",
"agentId": "clx4agent0001abcd",
"status": "FAILED",
"occurredAt": "2026-10-30T16:05:03.000Z",
"errorCode": "30007",
"errorMessage": "Message blocked as spam by the carrier"
}
}booking.created
A booking was made on one of your booking pages (including multi-host bookings). For a booking that needs payment up front, the event fires once the payment completes.
| Field | Type | Description |
|---|---|---|
| bookingId | string | Booking ID. |
{
"id": "clxadelivery001abcd",
"type": "booking.created",
"tenantId": "clx1tenant0001abcd",
"createdAt": "2026-10-30T16:04:11.482Z",
"data": {
"bookingId": "clxbbooking001abcd"
}
}booking.cancelled
A booking was cancelled, by staff or by the customer.
| Field | Type | Description |
|---|---|---|
| bookingId | string | Booking ID. |
| reason | string | null | The reason given, or null. |
{
"id": "clxadelivery001abcd",
"type": "booking.cancelled",
"tenantId": "clx1tenant0001abcd",
"createdAt": "2026-10-30T16:04:11.482Z",
"data": {
"bookingId": "clxbbooking001abcd",
"reason": "Customer rescheduled"
}
}booking.rescheduled
A booking was moved to a new time, by the customer from their manage link or by a rep. The booking keeps its ID. It is not cancelled and re-created, so you get this event and not booking.cancelled or booking.created.
| Field | Type | Description |
|---|---|---|
| bookingId | string | Booking ID. |
| startsAt | string | New start time, ISO 8601 (UTC). |
| endsAt | string | New end time, ISO 8601 (UTC). |
| previousStartsAt | string | Start time before the move, ISO 8601 (UTC). |
| previousEndsAt | string | End time before the move, ISO 8601 (UTC). |
| rescheduledBy | string | "attendee" when the customer moved it, "rep" when a team member did. |
{
"id": "clxadelivery001abcd",
"type": "booking.rescheduled",
"tenantId": "clx1tenant0001abcd",
"createdAt": "2026-10-30T16:04:11.482Z",
"data": {
"bookingId": "clxbbooking001abcd",
"startsAt": "2026-11-03T16:00:00.000Z",
"endsAt": "2026-11-03T16:30:00.000Z",
"previousStartsAt": "2026-11-02T15:00:00.000Z",
"previousEndsAt": "2026-11-02T15:30:00.000Z",
"rescheduledBy": "attendee"
}
}booking.completed
Staff marked a booking as completed.
| Field | Type | Description |
|---|---|---|
| bookingId | string | Booking ID. |
{
"id": "clxadelivery001abcd",
"type": "booking.completed",
"tenantId": "clx1tenant0001abcd",
"createdAt": "2026-10-30T16:04:11.482Z",
"data": {
"bookingId": "clxbbooking001abcd"
}
}booking.no_show
Staff marked a booking as a no-show.
| Field | Type | Description |
|---|---|---|
| bookingId | string | Booking ID. |
{
"id": "clxadelivery001abcd",
"type": "booking.no_show",
"tenantId": "clx1tenant0001abcd",
"createdAt": "2026-10-30T16:04:11.482Z",
"data": {
"bookingId": "clxbbooking001abcd"
}
}conversation.created
A new conversation thread was started with a contact on one of your numbers: the contact texted in for the first time, you texted them first (from the app, the API, a card, a workflow, a reminder or a booking), or a rep opened a new thread from the app. It fires once per thread, not per message. It is not sent for verification-code threads, for the thread RepLine uses to forward texts to your Default number, or for simulated messages in the number-testing tool. Delivery is at least once: if two things start the same thread at the same instant you can get the event twice, so de-duplicate on conversationId.
| Field | Type | Description |
|---|---|---|
| conversationId | string | Conversation ID. |
| contactId | string | Contact ID. |
| contactPhoneE164 | string | The contact number, E.164. |
| contactName | string | null | The contact name, or null. |
| ourPhoneE164 | string | The RepLine number the thread is on. |
| agentId | string | null | The rep who owns the thread, or null if nobody does yet. |
| startedBy | string | What started it: inbound_sms, inbound_rcs, api, compose, card_lead, send_card, workflow, reminder or booking. |
| occurredAt | string | When the conversation was created, ISO 8601 (UTC). |
{
"id": "clxadelivery001abcd",
"type": "conversation.created",
"tenantId": "clx1tenant0001abcd",
"createdAt": "2026-10-30T16:04:11.482Z",
"data": {
"conversationId": "clx7convo00001abcd",
"contactId": "clx6contact001abcd",
"contactPhoneE164": "+15555550100",
"contactName": "Dana Whitfield",
"ourPhoneE164": "+15555550123",
"agentId": "clx4agent0001abcd",
"startedBy": "inbound_sms",
"occurredAt": "2026-10-30T16:04:11.000Z"
}
}conversation.tagged
A team member changed the context tag on a conversation. It also fires when the tag is cleared, with tag set to null. Saving the tag a conversation already has sends nothing.
| Field | Type | Description |
|---|---|---|
| conversationId | string | Conversation ID. |
| contactId | string | Contact ID. |
| contactPhoneE164 | string | The contact number, E.164. |
| tag | string | null | The new tag, or null when the tag was cleared. |
| previousTag | string | null | The tag before this change, or null if there was none. |
| agentId | string | null | The rep who owns the conversation, or null. |
| taggedByUserId | string | User ID of the team member who made the change. |
| occurredAt | string | When it changed, ISO 8601 (UTC). |
{
"id": "clxadelivery001abcd",
"type": "conversation.tagged",
"tenantId": "clx1tenant0001abcd",
"createdAt": "2026-10-30T16:04:11.482Z",
"data": {
"conversationId": "clx7convo00001abcd",
"contactId": "clx6contact001abcd",
"contactPhoneE164": "+15555550100",
"tag": "estimate-sent",
"previousTag": "new-lead",
"agentId": "clx4agent0001abcd",
"taggedByUserId": "clx4user00001abcd",
"occurredAt": "2026-10-30T16:12:40.000Z"
}
}profile.updated
A rep, or a manager on their behalf, saved changes to a rep profile: title, bio, social links, certifications or the photo. changedFields lists only what really changed, and a save that changes nothing sends nothing. Changing which card template a rep uses is not a profile edit and does not fire this event.
| Field | Type | Description |
|---|---|---|
| agentId | string | Agent (rep) ID. |
| slug | string | The profile URL slug: /agents/{slug}. |
| changedFields | string[] | What changed, never empty. Any of: title, bio, socialLinks, certifications, photo. |
| updatedBy | string | "self" when the rep saved their own profile, "manager" when someone else did. |
| updatedByUserId | string | User ID of the person who saved. |
| occurredAt | string | When it was saved, ISO 8601 (UTC). |
{
"id": "clxadelivery001abcd",
"type": "profile.updated",
"tenantId": "clx1tenant0001abcd",
"createdAt": "2026-10-30T16:04:11.482Z",
"data": {
"agentId": "clx4agent0001abcd",
"slug": "dana-whitfield",
"changedFields": [
"title",
"bio"
],
"updatedBy": "self",
"updatedByUserId": "clx4user00001abcd",
"occurredAt": "2026-10-30T16:20:05.000Z"
}
}profile.viewed
Someone opened a rep public profile page, or scanned the rep QR code that lands on it. This is a sampled signal, not a page-view counter: crawlers and link-preview bots are skipped, one visitor counts once per profile per 10 minutes, and each profile sends at most 60 of these an hour. Use the analytics dashboard for exact counts.
| Field | Type | Description |
|---|---|---|
| agentId | string | Agent (rep) ID. |
| slug | string | The profile URL slug: /agents/{slug}. |
| source | string | "page" for a normal visit, "qr" when the visitor scanned the rep QR code. |
| occurredAt | string | When it was viewed, ISO 8601 (UTC). |
{
"id": "clxadelivery001abcd",
"type": "profile.viewed",
"tenantId": "clx1tenant0001abcd",
"createdAt": "2026-10-30T16:04:11.482Z",
"data": {
"agentId": "clx4agent0001abcd",
"slug": "dana-whitfield",
"source": "qr",
"occurredAt": "2026-10-30T16:31:48.000Z"
}
}optout.created
A contact texted a stop keyword (STOP, STOPALL, UNSUBSCRIBE, CANCEL, END or QUIT) to one of your numbers and was added to your opt-out list. RepLine stops texting them from then on. It fires only for a new opt-out: a second STOP from a number that is already opted out sends nothing. If the contact later texts START, there is no event for that.
| Field | Type | Description |
|---|---|---|
| contactId | string | Contact ID. |
| contactPhoneE164 | string | The contact number, E.164. |
| ourPhoneE164 | string | The RepLine number the contact texted STOP to. |
| conversationId | string | Conversation ID. |
| agentId | string | null | The rep who owns the conversation, or null. |
| keyword | string | The keyword they sent, upper-case with spaces and punctuation removed. |
| occurredAt | string | When it happened, ISO 8601 (UTC). |
{
"id": "clxadelivery001abcd",
"type": "optout.created",
"tenantId": "clx1tenant0001abcd",
"createdAt": "2026-10-30T16:04:11.482Z",
"data": {
"contactId": "clx6contact001abcd",
"contactPhoneE164": "+15555550100",
"ourPhoneE164": "+15555550123",
"conversationId": "clx7convo00001abcd",
"agentId": "clx4agent0001abcd",
"keyword": "STOP",
"occurredAt": "2026-10-30T16:40:22.000Z"
}
}Reserved event names
You can already subscribe to these names, but RepLine does not send them yet: . A subscription to one of them simply receives nothing until it ships. Check this page for their payloads when they do.
Verifying signatures
Anyone who finds your endpoint URL can POST to it, so check the signature before you trust a request.
- Read the raw request body as a string, before any JSON parsing. Re-serialising parsed JSON changes the bytes and breaks the signature.
- Take the timestamp from X-RepLine-Timestamp. Reject the request if it is more than 5 minutes away from your clock.
- Compute HMAC-SHA256 over the string `${timestamp}.${rawBody}` (the timestamp, a dot, then the raw body), keyed with the entire signing secret including the whsec_ prefix. Hex-encode it.
- Compare it with X-RepLine-Signature using a constant-time comparison.
// verify-repline.js
const crypto = require("node:crypto");
const TOLERANCE_SECONDS = 300; // reject anything older than 5 minutes
// secret: the whole whsec_... string from the API page
// rawBody: the request body exactly as received, as a string
// signature: the X-RepLine-Signature header
// timestamp: the X-RepLine-Timestamp header
function verifyRepLineSignature({ secret, rawBody, signature, timestamp }) {
const ts = Number.parseInt(timestamp, 10);
if (!Number.isFinite(ts)) return false;
if (Math.abs(Date.now() / 1000 - ts) > TOLERANCE_SECONDS) return false;
const expected = crypto
.createHmac("sha256", secret)
.update(`${timestamp}.${rawBody}`)
.digest("hex");
const a = Buffer.from(expected, "hex");
const b = Buffer.from(String(signature), "hex");
return a.length === b.length && crypto.timingSafeEqual(a, b);
}
module.exports = { verifyRepLineSignature };// server.js
const express = require("express");
const { verifyRepLineSignature } = require("./verify-repline");
const app = express();
const SECRET = process.env.REPLINE_WEBHOOK_SECRET; // the whsec_... string
const seen = new Set(); // use a database or Redis in production
// express.raw keeps the body as bytes, so the signature check sees exactly
// what RepLine signed. Do not use express.json() on this route.
app.post("/webhooks/repline", express.raw({ type: "application/json" }), (req, res) => {
const rawBody = req.body.toString("utf8");
const ok = verifyRepLineSignature({
secret: SECRET,
rawBody,
signature: req.get("X-RepLine-Signature"),
timestamp: req.get("X-RepLine-Timestamp"),
});
if (!ok) return res.status(400).send("bad signature");
const event = JSON.parse(rawBody);
// event.id is the same on every retry and replay: skip ones already handled.
if (seen.has(event.id)) return res.sendStatus(200);
switch (event.type) {
case "message.received":
console.log("Text from", event.data.from, ":", event.data.body);
break;
case "message.failed":
console.log("Send failed:", event.data.errorCode, event.data.errorMessage);
break;
case "booking.created":
console.log("New booking", event.data.bookingId);
break;
default:
break; // events you did not plan for
}
seen.add(event.id); // only after it was handled, so a crash is retried
res.sendStatus(200);
});
app.listen(3000);Need a key or stuck on an integration?