Skip to content
DocsThreads API

Theme

Threads API

Every /v1/threads endpoint: list the Threads of this Project, read one Thread by its key.

Base URL: https://api.nibify.app.

List the Threads of this Project

GET/v1/threads

Every conversation this key can see, the one that last spoke first. Metadata only: lastMessage is the notification block of the newest Message, never anything read out of a surface. One-shot Requests are Threads of one and are listed too — their threadKey is null. The list is scoped to the half of the Project the key belongs to: a sk_test_… never sees a live conversation.

Headers

Headers
FieldDescription
Authorizationstring · requiredBearer sk_test_…: an API key of your project.

Query parameters

Query parameters
FieldDescription
limitintegerHow many Threads a page holds. Between 1 and 100. Defaults to 30.
cursorstringThe nextCursor of the previous page. Omit it for the first page. Not empty.

Responses

Responses
StatusDescription
200One page, newest activity first, and the cursor for the next one.
401unauthorized for a missing or unusable key, api_key_revoked for a revoked one.
422invalid_request_body. limit must be between 1 and 100; cursor must be a nextCursor this endpoint returned.
429rate_limited. This project is over its requests-per-second ceiling or its daily volume in the environment this key speaks for; the message says which of the two it was. The budget is the project’s and not the key’s, so another API key of the same project shares it — the test and live halves are counted apart. Nothing was created and nothing was counted: retrying after Retry-After is safe. Header Retry-After: how many seconds to wait before retrying. Always a whole number, never below 1.

Response body, 200

Response body, 200
FieldDescription
itemsarray of objects · requiredThe Threads of this page, the one that last spoke first.
items[].threadIdstring · requiredThe Thread’s id.
items[].threadKeystring or null · requiredThe key the Thread was named with, or null for a one-shot Request’s own.
items[].environmentstring · requiredThe Environment the Thread belongs to. One of test, live.
items[].messageCountinteger · requiredHow many Messages the Thread holds.
items[].createdAtstring · requiredWhen the Thread was created, by its first Message. An RFC 3339 timestamp.
items[].lastMessageobject · requiredA Message of a Thread: what the push said and its receipts, never its Surface.
items[].lastMessage.messageIdstring · requiredThe Message’s id. For a Request, the same as its requestId.
items[].lastMessage.sequenceinteger · requiredThe Message’s position in its Thread, starting at 1.
items[].lastMessage.interactionTypestring · requiredWhat the Message asks for: informational nothing, action an answer, conversation the next turn of the exchange. One of informational, action, conversation.
items[].lastMessage.statusstring or null · requiredThe Request’s status, or null for a Notification, which has none. One of pending, answered, expired, dismissed, cancelled.
items[].lastMessage.senderobject · requiredWho the Message was sent as.
items[].lastMessage.sender.namestring · requiredThe name the person sees.
items[].lastMessage.sender.iconstring or null · requiredThe icon it was sent with, or null.
items[].lastMessage.notificationobject · requiredWhat the push said. Empty once the person has deleted the content.
items[].lastMessage.notification.titlestring · requiredThe title of the push and of its Inbox row.
items[].lastMessage.notification.bodystring · requiredThe text of the push and of its Inbox row.
items[].lastMessage.notification.quickActionsarray of objects · requiredThe buttons on the push, empty when it had none.
items[].lastMessage.notification.quickActions[].namestring · requiredThe action the button dispatches.
items[].lastMessage.notification.quickActions[].labelstring · requiredThe button’s text on the notification.
items[].lastMessage.minCatalogVersioninteger or null · requiredThe lowest catalog version that can draw its Surface. Null when it has none, or once the content is deleted.
items[].lastMessage.createdAtstring · requiredWhen the Message was sent. An RFC 3339 timestamp.
items[].lastMessage.expiresAtstring or null · requiredWhen the Request expires, or null if it never does. An RFC 3339 timestamp.
items[].lastMessage.deliveredAtstring or null · requiredWhen a phone of the recipient first confirmed the push arrived. Null means not confirmed yet, not that it was not sent. An RFC 3339 timestamp.
items[].lastMessage.readAtstring or null · requiredWhen the person first opened it, or null. Never set while deliveredAt is not. An RFC 3339 timestamp.
items[].lastMessage.contentDeletedAtstring or null · requiredWhen the person deleted what was said in this Message, or null. The Message stays in the Thread, emptied. An RFC 3339 timestamp.
nextCursorstring or null · requiredThe cursor of the next page, or null on the last one.

Read one Thread by its key

GET/v1/threads/{key}

The conversation the agent named, and its history in order — oldest first, mixed: the notification of a plain Request and the metadata of an interactive card read the same way, told apart by interactionType. Page forward with after, which is the sequence of the last Message you hold; nextAfter is null when the page reached the end. A one-shot Thread has no key and is not reachable here — read its Request with GET /v1/requests/{id}.

Headers

Headers
FieldDescription
Authorizationstring · requiredBearer sk_test_…: an API key of your project.

Path parameters

Path parameters
FieldDescription
keystring · requiredThe threadKey sent with the Requests of this conversation. URL-encode it: it is the agent’s own string and this API never parses it.

Query parameters

Query parameters
FieldDescription
afterintegerThe sequence of the last Message you hold: the page starts after it. 0 reads from the beginning. At least 0. Defaults to 0.
limitintegerHow many Messages a page holds. Between 1 and 100. Defaults to 30.

Responses

Responses
StatusDescription
200The Thread and one page of its Messages.
401unauthorized for a missing or unusable key, api_key_revoked for a revoked one.
404thread_not_found. A Thread of another Project — or of the other half of this one — answers the same way as a key nobody has used.
422invalid_request_body. after must be a whole number; limit 1 to 100.
429rate_limited. This project is over its requests-per-second ceiling or its daily volume in the environment this key speaks for; the message says which of the two it was. The budget is the project’s and not the key’s, so another API key of the same project shares it — the test and live halves are counted apart. Nothing was created and nothing was counted: retrying after Retry-After is safe. Header Retry-After: how many seconds to wait before retrying. Always a whole number, never below 1.

Response body, 200

Response body, 200
FieldDescription
threadIdstring · requiredThe Thread’s id.
threadKeystring or null · requiredThe key the Thread was named with, or null for a one-shot Request’s own.
environmentstring · requiredThe Environment the Thread belongs to. One of test, live.
messageCountinteger · requiredHow many Messages the Thread holds.
createdAtstring · requiredWhen the Thread was created, by its first Message. An RFC 3339 timestamp.
lastMessageobject · requiredA Message of a Thread: what the push said and its receipts, never its Surface.
lastMessage.messageIdstring · requiredThe Message’s id. For a Request, the same as its requestId.
lastMessage.sequenceinteger · requiredThe Message’s position in its Thread, starting at 1.
lastMessage.interactionTypestring · requiredWhat the Message asks for: informational nothing, action an answer, conversation the next turn of the exchange. One of informational, action, conversation.
lastMessage.statusstring or null · requiredThe Request’s status, or null for a Notification, which has none. One of pending, answered, expired, dismissed, cancelled.
lastMessage.senderobject · requiredWho the Message was sent as.
lastMessage.sender.namestring · requiredThe name the person sees.
lastMessage.sender.iconstring or null · requiredThe icon it was sent with, or null.
lastMessage.notificationobject · requiredWhat the push said. Empty once the person has deleted the content.
lastMessage.notification.titlestring · requiredThe title of the push and of its Inbox row.
lastMessage.notification.bodystring · requiredThe text of the push and of its Inbox row.
lastMessage.notification.quickActionsarray of objects · requiredThe buttons on the push, empty when it had none.
lastMessage.notification.quickActions[].namestring · requiredThe action the button dispatches.
lastMessage.notification.quickActions[].labelstring · requiredThe button’s text on the notification.
lastMessage.minCatalogVersioninteger or null · requiredThe lowest catalog version that can draw its Surface. Null when it has none, or once the content is deleted.
lastMessage.createdAtstring · requiredWhen the Message was sent. An RFC 3339 timestamp.
lastMessage.expiresAtstring or null · requiredWhen the Request expires, or null if it never does. An RFC 3339 timestamp.
lastMessage.deliveredAtstring or null · requiredWhen a phone of the recipient first confirmed the push arrived. Null means not confirmed yet, not that it was not sent. An RFC 3339 timestamp.
lastMessage.readAtstring or null · requiredWhen the person first opened it, or null. Never set while deliveredAt is not. An RFC 3339 timestamp.
lastMessage.contentDeletedAtstring or null · requiredWhen the person deleted what was said in this Message, or null. The Message stays in the Thread, emptied. An RFC 3339 timestamp.
messagesobject · requiredOne page of the Thread’s Messages, oldest first.
messages.itemsarray of objects · requiredThe Messages of this page, oldest first.
messages.items[].messageIdstring · requiredThe Message’s id. For a Request, the same as its requestId.
messages.items[].sequenceinteger · requiredThe Message’s position in its Thread, starting at 1.
messages.items[].interactionTypestring · requiredWhat the Message asks for: informational nothing, action an answer, conversation the next turn of the exchange. One of informational, action, conversation.
messages.items[].statusstring or null · requiredThe Request’s status, or null for a Notification, which has none. One of pending, answered, expired, dismissed, cancelled.
messages.items[].senderobject · requiredWho the Message was sent as.
messages.items[].sender.namestring · requiredThe name the person sees.
messages.items[].sender.iconstring or null · requiredThe icon it was sent with, or null.
messages.items[].notificationobject · requiredWhat the push said. Empty once the person has deleted the content.
messages.items[].notification.titlestring · requiredThe title of the push and of its Inbox row.
messages.items[].notification.bodystring · requiredThe text of the push and of its Inbox row.
messages.items[].notification.quickActionsarray of objects · requiredThe buttons on the push, empty when it had none.
messages.items[].notification.quickActions[].namestring · requiredThe action the button dispatches.
messages.items[].notification.quickActions[].labelstring · requiredThe button’s text on the notification.
messages.items[].minCatalogVersioninteger or null · requiredThe lowest catalog version that can draw its Surface. Null when it has none, or once the content is deleted.
messages.items[].createdAtstring · requiredWhen the Message was sent. An RFC 3339 timestamp.
messages.items[].expiresAtstring or null · requiredWhen the Request expires, or null if it never does. An RFC 3339 timestamp.
messages.items[].deliveredAtstring or null · requiredWhen a phone of the recipient first confirmed the push arrived. Null means not confirmed yet, not that it was not sent. An RFC 3339 timestamp.
messages.items[].readAtstring or null · requiredWhen the person first opened it, or null. Never set while deliveredAt is not. An RFC 3339 timestamp.
messages.items[].contentDeletedAtstring or null · requiredWhen the person deleted what was said in this Message, or null. The Message stays in the Thread, emptied. An RFC 3339 timestamp.
messages.nextAfterinteger or null · requiredThe after of the next page, or null when this page reached the end of the Thread.