Extension APIs
Every contract API a PocketOne app with its standard extensions answers, under /api/_c/<contract>/. The core API (records, collections, auth, files, settings…) is the REST API.
- Auth: an
Authorizationheader with a superuser's auth token or an API token. Each operation needs its token scope; a superuser's own auth token passes every scope. - Discovery:
GET /api/_c/remote/v1says who you are and lists every contract the app offers (remote/v1). - Input: a JSON body for
POST, query parameters forGET. Answers are JSON; streams are server-sent events. - Same as the CLI and MCP: every operation here is also a
pocketonecommand and an MCP tool, behind the same checks (how).
api-tokens.verify/v1
Contract page. Answered by API Tokens in the standard set.
| Endpoint | What it does | Token scope | Input |
|---|---|---|---|
POST /api/_c/api-tokens.verify/v1 |
Checks an API token and says who it acts as and what it may do (its scopes, with their values). | api_tokens_verify |
token (string), ip (string) |
api-tokens/v1
Its own API under /api/_c/api-tokens/v1/: see api-tokens/v1. Answered by API Tokens in the standard set.
bulkmail/v1
Contract page. Answered by Bulk Mail in the standard set.
| Endpoint | What it does | Token scope | Input |
|---|---|---|---|
POST /api/_c/bulkmail/v1/count |
Says how many recipients an audience reaches, how many of them are suppressed, and a few sample addresses. | bulkmail:read |
audience (json) |
POST /api/_c/bulkmail/v1/start |
Queues a campaign's recipients and starts sending (Limit > 0: at most that many new recipients). | bulkmail |
campaign (string), limit (int) |
POST /api/_c/bulkmail/v1/pause |
Stops sending a campaign; Resume carries on. | bulkmail |
campaign (string) |
POST /api/_c/bulkmail/v1/resume |
Carries on sending a paused campaign. | bulkmail |
campaign (string) |
POST /api/_c/bulkmail/v1/cancel |
Stops a campaign for good; recipients not yet sent to are dropped. | bulkmail |
campaign (string) |
POST /api/_c/bulkmail/v1/preview |
Renders a campaign's message for one recipient (the first in its audience when Email is empty). | bulkmail:read |
campaign (string), email (string) |
POST /api/_c/bulkmail/v1/test |
Sends a campaign's message to one address, marked as a test. | bulkmail |
campaign (string), to (string) |
cache.clear/v1
Contract page. Answered by Cache in the standard set.
| Endpoint | What it does | Token scope | Input |
|---|---|---|---|
POST /api/_c/cache.clear/v1 |
Empties one of the app's cache buckets, or every bucket it has. | cache |
bucket (string) |
deploy/v1
Its own API under /api/_c/deploy/v1/: see deploy/v1. Answered by Deploy in the standard set.
instance.watch/v1
| Endpoint | What it does | Token scope | Input |
|---|---|---|---|
GET /api/_c/instance.watch/v1/stream |
Opens this edge's stream: a hello first, then answers and changes for the hostnames it watches, the edges list when it changes, and its standing set when that changes. (stream) | fleet |
edge (string) |
POST /api/_c/instance.watch/v1/watch |
Registers a hostname on a stream and sends its answer there (or, with no live stream, in the reply). | fleet |
conn (string), edge (string), host (string) |
POST /api/_c/instance.watch/v1/unwatch |
Stops changes for a hostname on a stream. | fleet |
conn (string), host (string) |
kv/v1
Contract page. Answered by Key-Value Store in the standard set.
| Endpoint | What it does | Token scope | Input |
|---|---|---|---|
GET /api/_c/kv/v1 |
Returns the values whose names start with prefix (all of them when it's empty), sorted by name. | kv:read |
prefix (string) |
GET /api/_c/kv/v1/get |
Returns one value. | kv:read |
name (string) |
POST /api/_c/kv/v1/set |
Stores a JSON value under a name, replacing any value it had. | kv |
name (string), value (json) |
POST /api/_c/kv/v1/delete |
Removes a value. | kv |
name (string) |
llm.align/v1
Contract page. Answered by LLM in the standard set.
| Endpoint | What it does | Token scope | Input |
|---|---|---|---|
POST /api/_c/llm.align/v1/align |
Says when each line and word of the text is said in the audio. | llm |
model (string), audio (json), text (string), mode (string), language (string), options (json) |
GET /api/_c/llm.align/v1/models |
Lists the alignment models of every provider in Settings → LLM. | llm:read |
provider (string) |
llm.chat/v1
Contract page. Answered by LLM Chat in the standard set.
| Endpoint | What it does | Token scope | Input |
|---|---|---|---|
POST /api/_c/llm.chat/v1/new |
Starts a chat and returns it; its id is how the app finds it again. | chat |
title (string), meta (json) |
POST /api/_c/llm.chat/v1/send |
Asks the chat a question: the provider sends the system text, the chat's summary, its recent messages and the question (with Context after it) to llm.text/v1, saves both turns, and folds older messages into the summary when it's due. | chat |
id (string), text (string), system (string), window (int), summarizeEvery (int), context (string), schema (json), maxTokens (int), temperature (json), model (string), reasoning (string), enrich (json) |
POST /api/_c/llm.chat/v1/send-stream |
Is Send with the answer as it's written: llm.text/v1 chunks, the last one with done and the result. (stream) | chat |
id (string), text (string), system (string), window (int), summarizeEvery (int), context (string), schema (json), maxTokens (int), temperature (json), model (string), reasoning (string), enrich (json) |
POST /api/_c/llm.chat/v1/get |
Returns a chat. | chat:read |
id (string) |
POST /api/_c/llm.chat/v1/history |
Returns a chat's messages, oldest first: the last Limit before the message Before (all when 0 and ""). | chat:read |
id (string), limit (int), before (string) |
POST /api/_c/llm.chat/v1/update |
Sets a chat's title or meta (fields left out stay). | chat |
id (string), title (json), meta (json) |
POST /api/_c/llm.chat/v1/list |
Returns chats, most recently updated first; Meta keeps those whose meta has each of its top-level keys with that value. | chat:read |
meta (json), limit (int), offset (int) |
POST /api/_c/llm.chat/v1/forget |
Deletes a chat, its messages and the model's state for it. | chat |
id (string) |
POST /api/_c/llm.chat/v1/forget-where |
Deletes every chat whose meta matches (as in List), e.g. | chat |
meta (json), limit (int), offset (int) |
llm.embed/v1
Contract page. Answered by LLM in the standard set.
| Endpoint | What it does | Token scope | Input |
|---|---|---|---|
POST /api/_c/llm.embed/v1/embed |
Returns one vector per input text, in order. | llm |
model (string), input (strings), dimensions (int), options (json) |
GET /api/_c/llm.embed/v1/models |
Lists the embedding models of every provider in Settings → LLM. | llm:read |
provider (string) |
llm.image/v1
Contract page. Answered by LLM in the standard set.
| Endpoint | What it does | Token scope | Input |
|---|---|---|---|
POST /api/_c/llm.image/v1/generate |
Makes pictures from a prompt, and from the reference pictures it's given. | llm |
model (string), prompt (string), n (int), size (string), aspectRatio (string), references (json), options (json) |
GET /api/_c/llm.image/v1/models |
Lists the image models of every provider in Settings → LLM. | llm:read |
provider (string) |
llm.ledger/v1
Contract page. Answered by LLM in the standard set.
| Endpoint | What it does | Token scope | Input |
|---|---|---|---|
GET /api/_c/llm.ledger/v1/remaining |
Is, for each limit in Settings → LLM that counts the subject's calls, how much is used and left in its current window, the tightest first. | public | subject (string) |
GET /api/_c/llm.ledger/v1/spent |
Is what the subject's calls used in a window. | public | subject (string), window (string), since (string), until (string), kind (string), model (string) |
GET /api/_c/llm.ledger/v1/summary |
Is what calls used, grouped by model, kind, subject or day. | llm:read |
by (string), window (string), since (string), until (string), subject (string), kind (string), model (string), limit (int) |
GET /api/_c/llm.ledger/v1/calls |
Lists the ledger's rows, newest first. | llm:read |
window (string), since (string), until (string), subject (string), kind (string), model (string), status (string), limit (int), offset (int) |
llm.music/v1
Contract page. Answered by LLM in the standard set.
| Endpoint | What it does | Token scope | Input |
|---|---|---|---|
POST /api/_c/llm.music/v1/create |
Starts making music. | llm |
model (string), prompt (string), lyrics (string), seconds (float), wait (string), options (json) |
POST /api/_c/llm.music/v1/get |
Says how a job is going. | llm:read |
id (string) |
POST /api/_c/llm.music/v1/content |
Fetches one of a done job's files. | llm:read |
id (string), index (int) |
GET /api/_c/llm.music/v1/models |
Lists the music models of every provider in Settings → LLM. | llm:read |
provider (string) |
llm.search/v1
Contract page. Answered by LLM Search in the standard set.
| Endpoint | What it does | Token scope | Input |
|---|---|---|---|
GET /api/_c/llm.search/v1/status |
Is the app's embedding model and how far embedding has got across every bucket. | search:read |
|
POST /api/_c/llm.search/v1/set-model |
Changes the app's embedding model ("provider/model" from llm.embed/v1's models; "" picks one again). | search |
model (string) |
GET /api/_c/llm.search/v1/buckets |
Lists the app's buckets with their counts. | search:read |
|
GET /api/_c/llm.search/v1/bucket |
Returns one bucket with its counts. | search:read |
name (string) |
POST /api/_c/llm.search/v1/ensure |
Makes a bucket if it's missing and returns it. | search |
name (string), title (string), description (string), owner (string) |
POST /api/_c/llm.search/v1/update |
Changes a bucket's title, description or limits (fields left out stay). | search |
name (string), title (json), description (json), maxDocuments (json), maxBytes (json) |
POST /api/_c/llm.search/v1/delete |
Removes a bucket and everything in it. | search |
name (string) |
GET /api/_c/llm.search/v1/sources |
Lists a bucket's sources, by name. | search:read |
bucket (string) |
POST /api/_c/llm.search/v1/add |
Puts a file or pasted text in a bucket as its own source (one document), replacing the source of that name. | search |
bucket (string), name (string), text (string), kind (string), replace (string) |
POST /api/_c/llm.search/v1/upload |
Adds a file sent as the request body: ?bucket=<name>&name=<file name>[&replace=<source>]. | search |
raw body |
POST /api/_c/llm.search/v1/put |
Adds one file to a folder source (made on the first one), the way the dashboard sends a dropped folder; Prune ends it. | search |
bucket (string), source (string), path (string), text (string), replace (string) |
POST /api/_c/llm.search/v1/prune |
Removes the documents of a folder source that aren't in Keep: the files the folder no longer has. | search |
bucket (string), source (string), keep (strings) |
POST /api/_c/llm.search/v1/add-url |
Adds a web page or a Git repository as a source (named by its URL, replacing one of that name) and reads it in the background; Every keeps it current. | search |
bucket (string), url (string), kind (string), every (string), commits (int), exclude (strings) |
POST /api/_c/llm.search/v1/add-folder |
Adds a folder of the app's own files on the server (named by its path, replacing one of that name): every text file in it, read in the background and read again every few minutes, so changed files are embedded again and removed ones leave. | search |
bucket (string), path (string), include (strings), exclude (strings), url (string) |
POST /api/_c/llm.search/v1/detect-url |
Says how AddURL would read a URL: as a Git repository when its server answers the Git protocol (any host, with or without .git), otherwise as a web page. | search:read |
url (string) |
POST /api/_c/llm.search/v1/follow |
Adds one of the app's collections as a source (named by the collection): each record the filter keeps is a document, kept in sync as records are saved and deleted. | search |
bucket (string), collection (string), fields (strings), filter (string) |
POST /api/_c/llm.search/v1/refresh |
Reads a source again now: fetches a URL or repository, rereads a collection, resplits a file or zip. | search |
bucket (string), source (string) |
POST /api/_c/llm.search/v1/remove |
Takes sources out of a bucket, with their documents. | search |
bucket (string), sources (strings) |
GET /api/_c/llm.search/v1/documents |
Lists a bucket's documents (or one source's), by source and name. | search:read |
bucket (string), source (string), prefix (string) |
POST /api/_c/llm.search/v1/search |
Returns the chunks that best match a query across the buckets named, best first. | search:read |
buckets (strings), bucket (string), query (string), limit (int), prefix (string), viewer (json) |
POST /api/_c/llm.search/v1/sample |
Returns chunks picked at random from the buckets named: material to draw from ("surprise me", a topic nobody asked about), not matches. | search:read |
buckets (strings), bucket (string), count (int), prefix (string) |
llm.speech/v1
Contract page. Answered by LLM in the standard set.
| Endpoint | What it does | Token scope | Input |
|---|---|---|---|
POST /api/_c/llm.speech/v1/speak |
Reads the text aloud and returns the audio. | llm |
model (string), text (string), voice (string), format (string), speed (float), instructions (string), reference (json), options (json) |
POST /api/_c/llm.speech/v1/voices |
Lists a model's voices, when the provider says. | llm:read |
model (string) |
GET /api/_c/llm.speech/v1/models |
Lists the speech models of every provider in Settings → LLM. | llm:read |
provider (string) |
llm.text/v1
Contract page. Answered by LLM in the standard set.
| Endpoint | What it does | Token scope | Input |
|---|---|---|---|
POST /api/_c/llm.text/v1/complete |
Answers a prompt or a conversation. | llm |
model (string), system (string), prompt (string), messages (json), schema (json), maxTokens (int), temperature (json), stop (strings), reasoning (string), options (json), enrich (json) |
POST /api/_c/llm.text/v1/stream |
Answers like Complete, sending the answer as it's written: a chunk with text (or reasoning) for each piece, then one with done and the whole result. (stream) | llm |
model (string), system (string), prompt (string), messages (json), schema (json), maxTokens (int), temperature (json), stop (strings), reasoning (string), options (json), enrich (json) |
POST /api/_c/llm.text/v1/count |
Says about how many tokens a text or a conversation is, for budgeting what to send. | llm:read |
model (string), text (string), system (string), messages (json) |
GET /api/_c/llm.text/v1/models |
Lists the text models of every provider in Settings → LLM. | llm:read |
provider (string) |
llm.transcribe/v1
Contract page. Answered by LLM in the standard set.
| Endpoint | What it does | Token scope | Input |
|---|---|---|---|
POST /api/_c/llm.transcribe/v1/transcribe |
Writes down what's said in the audio. | llm |
model (string), audio (json), language (string), prompt (string), options (json) |
GET /api/_c/llm.transcribe/v1/models |
Lists the transcription models of every provider in Settings → LLM. | llm:read |
provider (string) |
llm.video/v1
Contract page. Answered by LLM in the standard set.
| Endpoint | What it does | Token scope | Input |
|---|---|---|---|
POST /api/_c/llm.video/v1/create |
Starts making a video. | llm |
model (string), prompt (string), image (json), seconds (float), size (string), aspectRatio (string), wait (string), options (json) |
POST /api/_c/llm.video/v1/get |
Says how a job is going. | llm:read |
id (string) |
POST /api/_c/llm.video/v1/content |
Fetches one of a done job's files. | llm:read |
id (string), index (int) |
GET /api/_c/llm.video/v1/models |
Lists the video models of every provider in Settings → LLM. | llm:read |
provider (string) |
mail.feedback/v1
Contract page. Answered by Bulk Mail in the standard set.
| Endpoint | What it does | Token scope | Input |
|---|---|---|---|
POST /api/_c/mail.feedback/v1/ses |
Takes an Amazon SNS delivery carrying SES bounce and complaint notifications (and confirms the topic subscription). | public | raw body |
POST /api/_c/mail.feedback/v1/webhook |
Takes {"type": "bounce|complaint|unsubscribe", "email": ..., "campaign": ...} from any provider, with the shared secret in the X-Feedback-Secret header. | public | raw body |
mail.suppression/v1
Contract page. Answered by Bulk Mail in the standard set.
| Endpoint | What it does | Token scope | Input |
|---|---|---|---|
GET /api/_c/mail.suppression/v1/check |
Says whether an address is suppressed, and why. | suppression:read |
email (string) |
POST /api/_c/mail.suppression/v1/suppress |
Adds an address (or changes its reason). | suppression |
email (string), reason (string), source (string), campaign (string) |
POST /api/_c/mail.suppression/v1/unsuppress |
Removes an address, so it receives bulk mail again. | suppression |
email (string) |
GET /api/_c/mail.suppression/v1/unsubscribe |
Is the page an unsubscribe link opens (?t=<signed token>). | public | t (string) |
POST /api/_c/mail.suppression/v1/unsubscribe |
Confirms the page's form, or a mail provider's one-click POST (List-Unsubscribe=One-Click). | public | raw body |
oauth/v1
Its own API under /api/_c/oauth/v1/: see oauth/v1. Answered by API Tokens in the standard set.
remote/v1
Contract page. Answered by Remotes in the standard set.
| Endpoint | What it does | Token scope | Input |
|---|---|---|---|
GET /api/_c/remote/v1 |
Says who the credential is, the app's name and URL, and the contracts it offers. | public | |
GET /api/_c/remote/v1/status |
Reports whether the app is running, its versions, uptime and mode. | remote:read |
|
POST /api/_c/remote/v1/restart |
Restarts the app; requests in flight finish first. | remote |
|
GET /api/_c/remote/v1/logs |
Streams the app's log: the last entries, then new ones as they're written. (stream) | remote:read |
n (int) |
restore/v1
Contract page. Answered by PITR in the standard set.
| Endpoint | What it does | Token scope | Input |
|---|---|---|---|
GET /api/_c/restore/v1 |
Says what the app's data can be restored to: a window of time (continuous history) or a list of moments (backups), and whether a restore is running. | restore:read |
|
POST /api/_c/restore/v1/restore |
Puts the app's data back as it was at the given moment, from the latest point at or before it. | restore |
at (time) |
settings/v1
Contract page. Answered by Settings in the standard set.
| Endpoint | What it does | Token scope | Input |
|---|---|---|---|
GET /api/_c/settings/v1 |
Names the extensions whose settings this app's admins can change. | settings:read |
|
GET /api/_c/settings/v1/get |
Returns one extension's settings. | settings:read |
extension (string) |
POST /api/_c/settings/v1/save |
Replaces one extension's settings and applies them. | settings |
extension (string), values (json) |
POST /api/_c/settings/v1/test |
Checks one extension's settings without saving them (a test write to a bucket, a test message). | settings |
extension (string), values (json) |
vacuum/v1
Contract page. Answered by Vacuum in the standard set.
| Endpoint | What it does | Token scope | Input |
|---|---|---|---|
GET /api/_c/vacuum/v1 |
Says who compacts the app's databases, whether and how often, and how the last run went. | vacuum:read |
Questions and comments
Comments are a GitHub Discussions thread; sign in with GitHub to post.