Skip to content

Conversation routes: create, get, list

The Conversation Verbs create, get, list as api.sb routes, with inputs, result, refusals and an example.

Reference for Conversation, one group of Conversation routes.

Conversation.create

Creates a Conversation. Verb page.

Text
POST /{namespace}/conversations

Body, as JSON: the inputs. Emits Conversation.created.

Inputs

InputTypeRequiredDescription
subjectstringWhat the Thread is about.
answeredAtdatetimeWhen a Worker last answered.
resolutionstringHow it was resolved: the Customer said so, or 72 hours passed after an answer with no reply.
workerWorkerOne Worker owes each Conversation its next answer.
customerCustomerThe Customer a Conversation serves, so every answer reads that Customer’s records.
issueIssueThe Issue or Incident a Conversation reports; resolving it answers every linked Conversation.

Returns

OutputTypeRequiredDescription
conversationConversationrequiredThe Conversation.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

Terminal
curl -X POST https://api.sb/leaseline.app/conversations \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"subject":"Example subject"}'
JSON
{
  "api": "https://api.sb/leaseline.app",
  "conversation": {
    "$id": "https://api.sb/leaseline.app/conversations/conversation_0vg6SDjB6k",
    "$type": "Conversation",
    "subject": "Example subject",
    "answeredAt": "2026-10-22T12:00:00Z"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Conversation.create",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}

Conversation.get

Returns one Conversation by id. Verb page.

Text
GET /{namespace}/conversations/{id}

Path: id. Query: the other inputs. Reads only: it emits no Event.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Conversation.
atstringA time or Version name: the record as it stood then. Unset: as it stands now.

Returns

OutputTypeRequiredDescription
conversationConversationrequiredThe Conversation.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

Terminal
curl https://api.sb/leaseline.app/conversations/conversation_0vg6SDjB6k \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
JSON
{
  "api": "https://api.sb/leaseline.app",
  "$type": "Conversation",
  "$id": "https://api.sb/leaseline.app/conversations/conversation_0vg6SDjB6k",
  "conversation": {
    "$id": "https://api.sb/leaseline.app/conversations/conversation_0vg6SDjB6k",
    "$type": "Conversation",
    "subject": "Example subject",
    "answeredAt": "2026-10-22T12:00:00Z"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/conversations/conversation_0vg6SDjB6k",
    "up": "https://api.sb/leaseline.app/conversations"
  },
  "actions": {
    "answer": "https://api.sb/leaseline.app/conversations/conversation_0vg6SDjB6k/answer",
    "assign": "https://api.sb/leaseline.app/conversations/conversation_0vg6SDjB6k/assign",
    "close": "https://api.sb/leaseline.app/conversations/conversation_0vg6SDjB6k/close"
  }
}

Conversation.list

Returns Conversations, newest first, one page at a time. Verb page.

Text
GET /{namespace}/conversations

Query: the inputs. Reads only: it emits no Event.

Inputs

InputTypeRequiredDescription
limitintegerAt most this many records, up to 100. The default is 20.
afterstringThe cursor from the previous page.
wherestringA filter over the properties, such as paidAt = null and total.amount > 500.
sortstringProperties to sort by, comma-separated; a leading minus sorts descending.
totalbooleanTrue adds the match count as meta.total, exact up to 10,000 matches and estimated above.
facetsstringProperties to count by value, comma-separated, returned as meta.facets.
fieldsstringProperties to return on each record, comma-separated; $id and $type always return.
includestringRelated records to embed in place of their URLs, comma-separated.
depthintegerHow many levels of related records to embed. The default is 1.
qstringWords to match across the text properties, ranked by relevance.
matchstringRanks the search by words, or meaning; words is the default.

Returns

OutputTypeRequiredDescription
conversationslist of ConversationrequiredOne page of Conversations.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

Terminal
curl "https://api.sb/leaseline.app/conversations?limit=20" \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
JSON
{
  "api": "https://api.sb/leaseline.app",
  "$type": "Conversation",
  "conversations": [
    {
      "$id": "https://api.sb/leaseline.app/conversations/conversation_0vg6SDjB6k",
      "$type": "Conversation",
      "subject": "Example subject",
      "answeredAt": "2026-10-22T12:00:00Z"
    }
  ],
  "meta": {
    "limit": 20,
    "after": "conversation_0vg6SDjB6k"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/conversations?limit=20",
    "next": "https://api.sb/leaseline.app/conversations?after=conversation_0vg6SDjB6k"
  }
}