Every /v1/requests endpoint: list the Requests of this Project, create a Request, read a Request, withdraw a Request, re-notify a pending Request, await the outcome of a Request.
Base URL: https://api.nibify.app.
List the Requests of this Project
GET/v1/requests
Every Request this key can see, newest first — the answer to "what did I leave hanging" for an agent that was switched off and lost the ids it was holding. Narrow with status (pending is the one that question wants), with threadKey, and with createdAfter/createdBefore, both exclusive. Rows are the same RequestGET /v1/requests/{id} returns, response included, so a settled page needs no second call. Notifications sent with no question attached are not Requests and are not here. The list is scoped to the half of the Project the key belongs to: an sk_test_… never sees a live Request, and no key ever sees another Project.
Headers
Headers
Field
Description
Authorizationstring · required
Bearer sk_test_…: an API key of your project.
Query parameters
Query parameters
Field
Description
statusstring
Only the Requests in this status. One of pending, answered, expired, dismissed, cancelled.
threadKeystring
Only the Requests of the Thread with this key. Not empty.
createdAfterstring
Only the Requests created after this instant, not at it. An RFC 3339 timestamp.
createdBeforestring
Only the Requests created before this instant, not at it. An RFC 3339 timestamp.
limitinteger
How many Requests 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
Responses
Status
Description
200
One page, newest first, and the cursor for the next one.
invalid_request_body. limit must be between 1 and 100; cursor must be a nextCursor this endpoint returned; createdAfter and createdBefore must be RFC 3339 timestamps.
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
Response body, 200
Field
Description
itemsarray of objects · required
The Requests of this page, newest first.
items[].requestIdstring · required
The Request’s id.
items[].statusstring · required
Where the Request is: pending until it reaches one of the four terminal states. One of pending, answered, expired, dismissed, cancelled.
items[].createdAtstring · required
When the Request was created. An RFC 3339 timestamp.
items[].expiresAtstring or null · required
When the Request expires, or null if it never does. An RFC 3339 timestamp.
items[].environmentstring · required
The Environment of the API key that created it. One of test, live.
items[].deliveredAtstring 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[].readAtstring or null · required
When the person first opened it, or null. Never set while deliveredAt is not. An RFC 3339 timestamp.
items[].contentDeletedAtstring or null · required
When the person deleted what was said in this Request, or null. From then on response.context is null. An RFC 3339 timestamp.
items[].responseobject or null · required
The person’s answer: present exactly when status is answered.
The id of the component the person answered with, or notification for a quick action on the push.
items[].response.contextobject or null · required
The values the action sent back, or null when it sent none or the person has since deleted the content.
items[].response.clientTimestampstring · required
When the person answered, by the phone’s clock. An RFC 3339 timestamp.
items[].response.answeredAtstring · required
When the answer reached Nibify. An RFC 3339 timestamp.
nextCursorstring or null · required
The cursor of the next page, or null on the last one.
Create a Request
POST/v1/requests
Creates a pending Request and validates its Surface against the catalog. Send Idempotency-Key only if you retry automatically: the returned requestId is already the identity of the Request. Send callbackUrl to be called once, with a signed POST, when the Request reaches a terminal state — a workflow that pauses can resume on it, instead of holding a long poll open.
Headers
Headers
Field
Description
Authorizationstring · required
Bearer sk_test_…: an API key of your project.
Idempotency-Keystring
Send only if you retry automatically. The same key with the same request returns the Request already created, with 200; with a different request it is a 422.
Request body
Request body
Field
Description
senderobject · required
Who the person sees the Request as coming from.
sender.namestring · required
The name the person sees, free text. Not empty.
sender.iconstring
An icon for the sender, free text, kept and returned as sent. Nothing draws it: the person sees the sender by its name. Not empty.
notificationobject · required
What the push says, and the buttons it offers.
notification.titlestring · required
The title of the push and of its Inbox row. Not empty.
notification.bodystring · required
The text of the push and of its Inbox row. Not empty.
notification.quickActionsarray of objects
Buttons on the push itself, answerable from the lock screen. Not empty.
notification.quickActions[].namestring · required
The action the button dispatches, and the actionName of the Response it produces. With a surface, it must be an action the Surface dispatches. Not empty.
How loudly the Request announces itself: low only in the Inbox, normal with a push, high with a push that may break through the person’s quiet hours. One of low, normal, high. Defaults to normal.
threadKeystring
Your name for a conversation: Requests sent with the same key join one Thread. Without it, the Request is a Thread of its own. 1 to 200 characters.
surfaceobject
The interactive UI the person answers in, checked against the catalog. Without it, the push and its quickActions are the whole Request.
surface.rootstring · required
The id of the component the Surface is drawn from: always root, and one of components must carry it. Not empty.
surface.dataModelobject · required
The flat JSON state the components bind to by JSON Pointer, and the source of the values an action sends back.
surface.componentsarray of objects · required
The components, as a flat list, each one checked against the catalog. Not empty.
expiresAtstring
When the Request expires if nobody has answered it, in the future. Without it, the Request waits indefinitely. An RFC 3339 timestamp.
callbackUrlstring
A public https URL called once, with a signed POST, when the Request reaches a terminal state. A URL. At most 2048 characters.
Example
import { Nibify } from'@nibify/sdk';
const nibify = newNibify({ apiKey: 'sk_test_…' });
const result = await nibify.ask({
sender: { name: 'invoice-flow' },
notification: {
title: 'Kiwi Studio invoice: $1,240, due Oct 30',
body: 'Read from the PDF. File it as consulting, or fix it first.',
quickActions: [
{ name: 'file', label: 'File it' },
{ name: 'fix', label: 'Fix it' },
],
},
});
if (result.status === 'answered') {
result.response.actionName; // 'file'
}
Responses
Responses
Status
Description
200
This Idempotency-Key had already created this exact Request. Nothing was created; the original Request is returned as it stands now.
plan_limit_reached. The Messages the account’s plan allows this month in this key’s Environment are spent — Requests and notifications together, across every Project of the account, counted from the first day of the month in UTC. test and live have a monthly allowance each, counted apart, so a spent test never refuses a live key, nor the other way round. The message names the Environment, the plan, its limit, the day the count starts again and where to upgrade. Nothing was created. Unlike a 429 there is no Retry-After: retrying is refused the same way until the month turns or the plan changes.
422
surface_invalid names the component and property at fault, the root the renderer would not find, or the quick action whose name is not an action the surface dispatches; idempotency_conflict means this key was already used for a different request; callback_url_invalid means the callbackUrl is not a public https endpoint this API is willing to call; invalid_request_body is a malformed envelope.
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 and 201
Response body, 200 and 201
Field
Description
requestIdstring · required
The Request’s id: read it, wait for it, withdraw it or nudge it by this.
threadIdstring · required
The Thread the Request joined.
sequenceinteger · required
The Request’s position in its Thread, starting at 1.
interactionTypestring · required
Inferred, never sent: conversation when the Request joined a Thread that already had Messages, action otherwise. One of action, conversation.
statusstring · required
The status the Request has now. On an idempotent replay, whatever the original has become since. One of pending, answered, expired, dismissed, cancelled.
createdAtstring · required
When the Request was created. An RFC 3339 timestamp.
expiresAtstring or null · required
When the Request expires, or null if it never does. An RFC 3339 timestamp.
environmentstring · required
The Environment of the API key that created it. One of test, live.
minCatalogVersioninteger or null · required
The lowest catalog version that can draw the Surface, worked out by the server. Null when there is no Surface.
warningsarray of objects · required
What did not stop the Message but changes how it is shown: catalog_version_too_low when no installed app can draw the Surface.
warnings[].codestring · required
What the warning is about, for a program to branch on. Always catalog_version_too_low.
warnings[].messagestring · required
The same warning, in a sentence for a person.
Read a Request
GET/v1/requests/{id}
Returns the Request as it stands now, without waiting. The same body as GET /v1/requests/{id}/response: read status to tell a Response from an outcome without one, and status: "pending" — nobody has answered yet — from expired, where the Request timed out. deliveredAt and readAt are the two receipts: a pending Request with both null never reached a phone, which is a different problem from one nobody has answered. Use the long poll instead when you intend to wait for the answer.
Headers
Headers
Field
Description
Authorizationstring · required
Bearer sk_test_…: an API key of your project.
Path parameters
Path parameters
Field
Description
idstring · required
The requestId returned when the Request was created.
Responses
Responses
Status
Description
200
The Request as it stands. response is present exactly when status is answered.
request_not_found. A Request belonging to another Project answers the same way as one that does not exist.
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
Response body, 200
Field
Description
requestIdstring · required
The Request’s id.
statusstring · required
Where the Request is: pending until it reaches one of the four terminal states. One of pending, answered, expired, dismissed, cancelled.
createdAtstring · required
When the Request was created. An RFC 3339 timestamp.
expiresAtstring or null · required
When the Request expires, or null if it never does. An RFC 3339 timestamp.
environmentstring · required
The Environment of the API key that created it. One of test, live.
deliveredAtstring 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.
readAtstring or null · required
When the person first opened it, or null. Never set while deliveredAt is not. An RFC 3339 timestamp.
contentDeletedAtstring or null · required
When the person deleted what was said in this Request, or null. From then on response.context is null. An RFC 3339 timestamp.
responseobject or null · required
The person’s answer: present exactly when status is answered.
response.responseIdstring · required
The Response’s id.
response.actionNamestring · required
The action the person chose.
response.sourceComponentIdstring · required
The id of the component the person answered with, or notification for a quick action on the push.
response.contextobject or null · required
The values the action sent back, or null when it sent none or the person has since deleted the content.
response.clientTimestampstring · required
When the person answered, by the phone’s clock. An RFC 3339 timestamp.
response.answeredAtstring · required
When the answer reached Nibify. An RFC 3339 timestamp.
Withdraw a Request
DELETE/v1/requests/{id}
Moves a pending Request to cancelled: the agent no longer needs the answer. Nothing is deleted — the Request stays readable, and cancelled is what tells the agent later that it withdrew rather than the person letting it lapse. A Request that reached any terminal state first is a 409 naming that state; request_already_answered means the person won the race and there is a Response to read.
Headers
Headers
Field
Description
Authorizationstring · required
Bearer sk_test_…: an API key of your project.
Path parameters
Path parameters
Field
Description
idstring · required
The requestId returned when the Request was created.
Responses
Responses
Status
Description
200
The Request was withdrawn. response is always null here.
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
Response body, 200
Field
Description
requestIdstring · required
The Request’s id.
statusstring · required
The terminal state the Request is in. One of answered, expired, dismissed, cancelled.
createdAtstring · required
When the Request was created. An RFC 3339 timestamp.
expiresAtstring or null · required
When the Request expires, or null if it never does. An RFC 3339 timestamp.
environmentstring · required
The Environment of the API key that created it. One of test, live.
deliveredAtstring 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.
readAtstring or null · required
When the person first opened it, or null. Never set while deliveredAt is not. An RFC 3339 timestamp.
contentDeletedAtstring or null · required
When the person deleted what was said in this Request, or null. From then on response.context is null. An RFC 3339 timestamp.
responseobject or null · required
The person’s answer: present exactly when status is answered.
response.responseIdstring · required
The Response’s id.
response.actionNamestring · required
The action the person chose.
response.sourceComponentIdstring · required
The id of the component the person answered with, or notification for a quick action on the push.
response.contextobject or null · required
The values the action sent back, or null when it sent none or the person has since deleted the content.
response.clientTimestampstring · required
When the person answered, by the phone’s clock. An RFC 3339 timestamp.
response.answeredAtstring · required
When the answer reached Nibify. An RFC 3339 timestamp.
Re-notify a pending Request
POST/v1/requests/{id}/nudge
Fires the push for a Request that is still waiting, without creating a second Request and without touching its state — no status, no sequence, no timestamp changes. Distinct from withdrawing and re-sending, which produces a cancelled Request and a new one. It obeys the priority the Request was created with and the recipient's quiet hours exactly as the first push did, so a normal Request nudged at three in the morning does not ring. A Request that already reached a terminal state is a 409 naming that state, never a silent no-op.
Headers
Headers
Field
Description
Authorizationstring · required
Bearer sk_test_…: an API key of your project.
Path parameters
Path parameters
Field
Description
idstring · required
The requestId returned when the Request was created.
Responses
Responses
Status
Description
200
The push was queued again. The Request is unchanged, and is returned as it stands.
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
Response body, 200
Field
Description
requestIdstring · required
The Request’s id.
statusstring · required
Where the Request is: pending until it reaches one of the four terminal states. One of pending, answered, expired, dismissed, cancelled.
createdAtstring · required
When the Request was created. An RFC 3339 timestamp.
expiresAtstring or null · required
When the Request expires, or null if it never does. An RFC 3339 timestamp.
environmentstring · required
The Environment of the API key that created it. One of test, live.
deliveredAtstring 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.
readAtstring or null · required
When the person first opened it, or null. Never set while deliveredAt is not. An RFC 3339 timestamp.
contentDeletedAtstring or null · required
When the person deleted what was said in this Request, or null. From then on response.context is null. An RFC 3339 timestamp.
responseobject or null · required
The person’s answer: present exactly when status is answered.
response.responseIdstring · required
The Response’s id.
response.actionNamestring · required
The action the person chose.
response.sourceComponentIdstring · required
The id of the component the person answered with, or notification for a quick action on the push.
response.contextobject or null · required
The values the action sent back, or null when it sent none or the person has since deleted the content.
response.clientTimestampstring · required
When the person answered, by the phone’s clock. An RFC 3339 timestamp.
response.answeredAtstring · required
When the answer reached Nibify. An RFC 3339 timestamp.
Await the outcome of a Request
GET/v1/requests/{id}/response
Resolves as soon as the Request reaches a terminal state, or when wait seconds have passed. Always a 200: read status to tell a Response from an outcome without one, and status: "pending" — the Wait window ran out, the Request is still waiting — from expired, where the Request itself timed out. Re-issue on pending. Waiting is free: this endpoint does not count against the project's rate limit, however long it is held open or however often it is re-issued.
Headers
Headers
Field
Description
Authorizationstring · required
Bearer sk_test_…: an API key of your project.
Path parameters
Path parameters
Field
Description
idstring · required
The requestId returned when the Request was created.
Query parameters
Query parameters
Field
Description
waitinteger
How many seconds to hold the connection open for a terminal state. 0 answers at once. Between 0 and 30. Defaults to 0.
Responses
Responses
Status
Description
200
What awaiting the Request resolved to. response is present exactly when status is answered.