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
| Field | Description |
|---|---|
Authorizationstring · required | Bearer sk_test_…: an API key of your project. |
Query parameters
| Field | Description |
|---|---|
limitinteger | How many Threads a page holds. Between 1 and 100. Defaults to 30. |
cursorstring | The nextCursor of the previous page. Omit it for the first page. Not empty. |
Responses
| Status | Description |
|---|---|
200 | One page, newest activity first, and the cursor for the next one. |
401 | unauthorized for a missing or unusable key, api_key_revoked for a revoked one. |
422 | invalid_request_body. limit must be between 1 and 100; cursor must be a nextCursor this endpoint returned. |
429 | rate_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
| Field | Description |
|---|---|
itemsarray of objects · required | The Threads of this page, the one that last spoke first. |
items[].string · required | The Thread’s id. |
items[].string or null · required | The key the Thread was named with, or null for a one-shot Request’s own. |
items[].string · required | The Environment the Thread belongs to. One of test, live. |
items[].integer · required | How many Messages the Thread holds. |
items[].string · required | When the Thread was created, by its first Message. An RFC 3339 timestamp. |
items[].object · required | A Message of a Thread: what the push said and its receipts, never its Surface. |
items[].string · required | The Message’s id. For a Request, the same as its requestId. |
items[].integer · required | The Message’s position in its Thread, starting at 1. |
items[].string · required | What the Message asks for: informational nothing, action an answer, conversation the next turn of the exchange. One of informational, action, conversation. |
items[].string or null · required | The Request’s status, or null for a Notification, which has none. One of pending, answered, expired, dismissed, cancelled. |
items[].object · required | Who the Message was sent as. |
items[].string · required | The name the person sees. |
items[].string or null · required | The icon it was sent with, or null. |
items[].object · required | What the push said. Empty once the person has deleted the content. |
items[].string · required | The title of the push and of its Inbox row. |
items[].string · required | The text of the push and of its Inbox row. |
items[].array of objects · required | The buttons on the push, empty when it had none. |
items[].string · required | The action the button dispatches. |
items[].string · required | The button’s text on the notification. |
items[].integer or null · required | The lowest catalog version that can draw its Surface. Null when it has none, or once the content is deleted. |
items[].string · required | When the Message was sent. An RFC 3339 timestamp. |
items[].string or null · required | When the Request expires, or null if it never does. An RFC 3339 timestamp. |
items[].string or null · required | When 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[].string or null · required | When the person first opened it, or null. Never set while deliveredAt is not. An RFC 3339 timestamp. |
items[].string or null · required | When 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 · required | The 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
| Field | Description |
|---|---|
Authorizationstring · required | Bearer sk_test_…: an API key of your project. |
Path parameters
| Field | Description |
|---|---|
keystring · required | The 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
| Field | Description |
|---|---|
afterinteger | The sequence of the last Message you hold: the page starts after it. 0 reads from the beginning. At least 0. Defaults to 0. |
limitinteger | How many Messages a page holds. Between 1 and 100. Defaults to 30. |
Responses
| Status | Description |
|---|---|
200 | The Thread and one page of its Messages. |
401 | unauthorized for a missing or unusable key, api_key_revoked for a revoked one. |
404 | thread_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. |
422 | invalid_request_body. after must be a whole number; limit 1 to 100. |
429 | rate_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
| Field | Description |
|---|---|
threadIdstring · required | The Thread’s id. |
threadKeystring or null · required | The key the Thread was named with, or null for a one-shot Request’s own. |
environmentstring · required | The Environment the Thread belongs to. One of test, live. |
messageCountinteger · required | How many Messages the Thread holds. |
createdAtstring · required | When the Thread was created, by its first Message. An RFC 3339 timestamp. |
lastMessageobject · required | A Message of a Thread: what the push said and its receipts, never its Surface. |
lastMessage.string · required | The Message’s id. For a Request, the same as its requestId. |
lastMessage.integer · required | The Message’s position in its Thread, starting at 1. |
lastMessage.string · required | What the Message asks for: informational nothing, action an answer, conversation the next turn of the exchange. One of informational, action, conversation. |
lastMessage.string or null · required | The Request’s status, or null for a Notification, which has none. One of pending, answered, expired, dismissed, cancelled. |
lastMessage.object · required | Who the Message was sent as. |
lastMessage.string · required | The name the person sees. |
lastMessage.string or null · required | The icon it was sent with, or null. |
lastMessage.object · required | What the push said. Empty once the person has deleted the content. |
lastMessage.string · required | The title of the push and of its Inbox row. |
lastMessage.string · required | The text of the push and of its Inbox row. |
lastMessage.array of objects · required | The buttons on the push, empty when it had none. |
lastMessage.string · required | The action the button dispatches. |
lastMessage.string · required | The button’s text on the notification. |
lastMessage.integer or null · required | The lowest catalog version that can draw its Surface. Null when it has none, or once the content is deleted. |
lastMessage.string · required | When the Message was sent. An RFC 3339 timestamp. |
lastMessage.string or null · required | When the Request expires, or null if it never does. An RFC 3339 timestamp. |
lastMessage.string or null · required | When 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.string or null · required | When the person first opened it, or null. Never set while deliveredAt is not. An RFC 3339 timestamp. |
lastMessage.string or null · required | When the person deleted what was said in this Message, or null. The Message stays in the Thread, emptied. An RFC 3339 timestamp. |
messagesobject · required | One page of the Thread’s Messages, oldest first. |
messages.array of objects · required | The Messages of this page, oldest first. |
messages.string · required | The Message’s id. For a Request, the same as its requestId. |
messages.integer · required | The Message’s position in its Thread, starting at 1. |
messages.string · required | What the Message asks for: informational nothing, action an answer, conversation the next turn of the exchange. One of informational, action, conversation. |
messages.string or null · required | The Request’s status, or null for a Notification, which has none. One of pending, answered, expired, dismissed, cancelled. |
messages.object · required | Who the Message was sent as. |
messages.string · required | The name the person sees. |
messages.string or null · required | The icon it was sent with, or null. |
messages.object · required | What the push said. Empty once the person has deleted the content. |
messages.string · required | The title of the push and of its Inbox row. |
messages.string · required | The text of the push and of its Inbox row. |
messages.array of objects · required | The buttons on the push, empty when it had none. |
messages.string · required | The action the button dispatches. |
messages.string · required | The button’s text on the notification. |
messages.integer or null · required | The lowest catalog version that can draw its Surface. Null when it has none, or once the content is deleted. |
messages.string · required | When the Message was sent. An RFC 3339 timestamp. |
messages.string or null · required | When the Request expires, or null if it never does. An RFC 3339 timestamp. |
messages.string or null · required | When 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.string or null · required | When the person first opened it, or null. Never set while deliveredAt is not. An RFC 3339 timestamp. |
messages.string or null · required | When the person deleted what was said in this Message, or null. The Message stays in the Thread, emptied. An RFC 3339 timestamp. |
messages.integer or null · required | The after of the next page, or null when this page reached the end of the Thread. |