Messaging
Conversations, members, messages, reactions and read state. Generated from the OpenAPI specification.
Conversations, members, messages, reactions and read state.
GET /v1/conversations
Authentication: Messaging token (Authorization: Bearer <token>), from the user’s device.
Query parameters
| Field | Type | Required | Notes |
|---|---|---|---|
limit | integer | No | ≥ 1; ≤ 100; default 50 |
cursor | string | No | max length 200 |
Response 200 OK
| Field | Type | Required | Notes |
|---|---|---|---|
items | object[] | Yes | |
items[].id | string (uuid) | Yes | |
items[].tenantId | string | Yes | |
items[].type | "dm", "group", "channel", "session" | Yes | |
items[].productConversationId | string or null | Yes | nullable |
items[].title | string or null | Yes | nullable |
items[].lastSeq | integer | Yes | |
items[].lastMessageAt | string or null | Yes | nullable |
items[].createdAt | string | Yes | |
items[].readSeq | integer | No | |
nextCursor | string or null | Yes | nullable |
Errors: 400 Invalid request · 401 Missing or invalid credentials · 403 Not permitted · 404 Not found (including resources of other projects) · 429 Rate limit or quota exceeded. Error bodies follow the error format.
POST /v1/conversations
Create a conversation the product backend has authorized (idempotent on productConversationId).
Authentication: Service key with scope messaging:write (Authorization: Bearer lynk_…), from your backend only.
Request body (application/json, required)
| Field | Type | Required | Notes |
|---|---|---|---|
tenantId | string | No | pattern ^[A-Za-z0-9._@-]{1,128}$; default "default" |
type | "dm", "group", "channel", "session" | Yes | |
productConversationId | string | No | pattern ^[A-Za-z0-9._@-]{1,128}$ |
title | string | No | max length 200 |
memberIds | string[] | Yes | at least 1 items; at most 1000 items |
Response 200 Existing
| Field | Type | Required | Notes |
|---|---|---|---|
id | string (uuid) | Yes | |
tenantId | string | Yes | |
type | "dm", "group", "channel", "session" | Yes | |
productConversationId | string or null | Yes | nullable |
title | string or null | Yes | nullable |
lastSeq | integer | Yes | |
lastMessageAt | string or null | Yes | nullable |
createdAt | string | Yes | |
readSeq | integer | No |
Response 201 Created
Same body as 200.
Errors: 400 Invalid request · 401 Missing or invalid credentials · 403 Not permitted · 404 Not found (including resources of other projects) · 429 Rate limit or quota exceeded. Error bodies follow the error format.
POST /v1/conversations/{id}/members
Authentication: Service key with scope messaging:write (Authorization: Bearer lynk_…), from your backend only.
Path parameters
| Field | Type | Required | Notes |
|---|---|---|---|
id | string (uuid) | Yes |
Request body (application/json, required)
| Field | Type | Required | Notes |
|---|---|---|---|
userIds | string[] | Yes | at least 1 items; at most 1000 items |
Response 204 No content
Errors: 400 Invalid request · 401 Missing or invalid credentials · 403 Not permitted · 404 Not found (including resources of other projects) · 429 Rate limit or quota exceeded. Error bodies follow the error format.
DELETE /v1/conversations/{id}/members/{userId}
Authentication: Service key with scope messaging:write (Authorization: Bearer lynk_…), from your backend only.
Path parameters
| Field | Type | Required | Notes |
|---|---|---|---|
id | string (uuid) | Yes | |
userId | string | Yes | pattern ^[A-Za-z0-9._@-]{1,128}$ |
Response 204 No content
Errors: 400 Invalid request · 401 Missing or invalid credentials · 403 Not permitted · 404 Not found (including resources of other projects) · 429 Rate limit or quota exceeded. Error bodies follow the error format.
GET /v1/conversations/{id}/messages
Events after after_seq (resync), or message history before before_seq.
Authentication: Messaging token (Authorization: Bearer <token>), from the user’s device.
Path parameters
| Field | Type | Required | Notes |
|---|---|---|---|
id | string (uuid) | Yes |
Query parameters
| Field | Type | Required | Notes |
|---|---|---|---|
after_seq | integer or null | No | ≥ 0 |
before_seq | integer | No | ≥ 1 |
limit | integer | No | ≥ 1; ≤ 200; default 100 |
Response 200 OK
| Field | Type | Required | Notes |
|---|---|---|---|
items | object[] | Yes | |
items[].conversationId | string (uuid) | Yes | |
items[].seq | integer | Yes | |
items[].type | "message.created", "message.updated", "message.deleted", "reaction.added", "reaction.removed" | Yes | |
items[].message | object | Yes | |
items[].message.id | string (uuid) | Yes | |
items[].message.conversationId | string (uuid) | Yes | |
items[].message.seq | integer | Yes | |
items[].message.senderId | string | Yes | |
items[].message.clientMessageId | string | Yes | |
items[].message.kind | "text", "system" | Yes | |
items[].message.body | string or null | Yes | nullable |
items[].message.attachments | object[] | Yes | |
items[].message.reactions | object[] | Yes | |
items[].message.parentMessageId | string or null | Yes | nullable |
items[].message.createdAt | string | Yes | |
items[].message.editedAt | string or null | Yes | nullable |
items[].message.deletedAt | string or null | Yes | nullable |
items[].reaction | object or null | Yes | nullable |
items[].reaction.userId | string | Yes | |
items[].reaction.emoji | string | Yes | |
items[].createdAt | string | Yes | |
lastSeq | integer | Yes | |
hasMore | boolean | Yes |
Errors: 400 Invalid request · 401 Missing or invalid credentials · 403 Not permitted · 404 Not found (including resources of other projects) · 429 Rate limit or quota exceeded. Error bodies follow the error format.
POST /v1/conversations/{id}/messages
Send a message (idempotent on clientMessageId).
Authentication: Messaging token (Authorization: Bearer <token>), from the user’s device.
Path parameters
| Field | Type | Required | Notes |
|---|---|---|---|
id | string (uuid) | Yes |
Request body (application/json, required)
| Field | Type | Required | Notes |
|---|---|---|---|
clientMessageId | string | Yes | pattern ^[A-Za-z0-9_-]{8,64}$ |
text | string | No | max length 65536; default "" |
attachmentIds | string (uuid)[] | No | at most 10 items; default [] |
parentMessageId | string (uuid) | No |
Response 200 Duplicate of an earlier send
| Field | Type | Required | Notes |
|---|---|---|---|
message | object | Yes | |
message.id | string (uuid) | Yes | |
message.conversationId | string (uuid) | Yes | |
message.seq | integer | Yes | |
message.senderId | string | Yes | |
message.clientMessageId | string | Yes | |
message.kind | "text", "system" | Yes | |
message.body | string or null | Yes | nullable |
message.attachments | object[] | Yes | |
message.attachments[].id | string (uuid) | Yes | |
message.attachments[].fileName | string | Yes | |
message.attachments[].mediaType | string | Yes | |
message.attachments[].size | integer | Yes | |
message.attachments[].status | "pending", "ready", "rejected" | Yes | |
message.attachments[].scanStatus | "not_scanned", "pending", "clean", "infected", "rejected", "failed" | No | |
message.reactions | object[] | Yes | |
message.reactions[].userId | string | Yes | |
message.reactions[].emoji | string | Yes | |
message.parentMessageId | string or null | Yes | nullable |
message.createdAt | string | Yes | |
message.editedAt | string or null | Yes | nullable |
message.deletedAt | string or null | Yes | nullable |
created | boolean | Yes | |
status | "sent" | Yes |
Response 201 Created
Same body as 200.
Errors: 400 Invalid request · 401 Missing or invalid credentials · 403 Not permitted · 404 Not found (including resources of other projects) · 429 Rate limit or quota exceeded. Error bodies follow the error format.
POST /v1/conversations/{id}/read
Advance the read watermark.
Authentication: Messaging token (Authorization: Bearer <token>), from the user’s device.
Path parameters
| Field | Type | Required | Notes |
|---|---|---|---|
id | string (uuid) | Yes |
Request body (application/json, required)
| Field | Type | Required | Notes |
|---|---|---|---|
seq | integer | Yes | ≥ 0 |
Response 200 OK
| Field | Type | Required | Notes |
|---|---|---|---|
readSeq | integer | Yes |
Errors: 400 Invalid request · 401 Missing or invalid credentials · 403 Not permitted · 404 Not found (including resources of other projects) · 429 Rate limit or quota exceeded. Error bodies follow the error format.
PATCH /v1/messages/{id}
Authentication: Messaging token (Authorization: Bearer <token>), from the user’s device.
Path parameters
| Field | Type | Required | Notes |
|---|---|---|---|
id | string (uuid) | Yes |
Request body (application/json, required)
| Field | Type | Required | Notes |
|---|---|---|---|
text | string | Yes | min length 1; max length 65536 |
Response 200 OK
| Field | Type | Required | Notes |
|---|---|---|---|
id | string (uuid) | Yes | |
conversationId | string (uuid) | Yes | |
seq | integer | Yes | |
senderId | string | Yes | |
clientMessageId | string | Yes | |
kind | "text", "system" | Yes | |
body | string or null | Yes | nullable |
attachments | object[] | Yes | |
attachments[].id | string (uuid) | Yes | |
attachments[].fileName | string | Yes | |
attachments[].mediaType | string | Yes | |
attachments[].size | integer | Yes | |
attachments[].status | "pending", "ready", "rejected" | Yes | |
attachments[].scanStatus | "not_scanned", "pending", "clean", "infected", "rejected", "failed" | No | |
reactions | object[] | Yes | |
reactions[].userId | string | Yes | |
reactions[].emoji | string | Yes | |
parentMessageId | string or null | Yes | nullable |
createdAt | string | Yes | |
editedAt | string or null | Yes | nullable |
deletedAt | string or null | Yes | nullable |
Errors: 400 Invalid request · 401 Missing or invalid credentials · 403 Not permitted · 404 Not found (including resources of other projects) · 429 Rate limit or quota exceeded. Error bodies follow the error format.
DELETE /v1/messages/{id}
Authentication: Messaging token (Authorization: Bearer <token>), from the user’s device.
Path parameters
| Field | Type | Required | Notes |
|---|---|---|---|
id | string (uuid) | Yes |
Response 204 No content
Errors: 400 Invalid request · 401 Missing or invalid credentials · 403 Not permitted · 404 Not found (including resources of other projects) · 429 Rate limit or quota exceeded. Error bodies follow the error format.
POST /v1/messages/{id}/reactions
Authentication: Messaging token (Authorization: Bearer <token>), from the user’s device.
Path parameters
| Field | Type | Required | Notes |
|---|---|---|---|
id | string (uuid) | Yes |
Request body (application/json, required)
| Field | Type | Required | Notes |
|---|---|---|---|
emoji | string | Yes | min length 1; max length 32 |
Response 204 No content
Errors: 400 Invalid request · 401 Missing or invalid credentials · 403 Not permitted · 404 Not found (including resources of other projects) · 429 Rate limit or quota exceeded. Error bodies follow the error format.
DELETE /v1/messages/{id}/reactions/{emoji}
Authentication: Messaging token (Authorization: Bearer <token>), from the user’s device.
Path parameters
| Field | Type | Required | Notes |
|---|---|---|---|
id | string (uuid) | Yes | |
emoji | string | Yes | min length 1; max length 32 |
Response 204 No content
Errors: 400 Invalid request · 401 Missing or invalid credentials · 403 Not permitted · 404 Not found (including resources of other projects) · 429 Rate limit or quota exceeded. Error bodies follow the error format.