Prompts API
Send instructions and knowledge to your prompt groups from your own system, as a draft to review or live straight away
Keep your AI agent's training material in sync with the system where it already lives, such as a CMS, an FAQ tool or a Git repository. Each call writes one document of one prompt group, and you choose whether the content goes live at once or waits as a draft for someone on your team to review.
Every endpoint lives under:
https://<your-domain>/app/api/v1/prompt-groupsAll request and response bodies are JSON.
1. Create an API key
- In the dashboard, open Settings → API Keys and click New API key. Organization owners and admins can do this.
- Name the key after the system that will use it, so you know which one to revoke later.
- Tick the permissions it needs:
- Edit AI training as drafts (
prompts:write) lets the key read every prompt group and write drafts. A draft never reaches customers on its own. - Publish AI training (
prompts:publish) lets the key make content live. A key needs both permissions to publish.
- Edit AI training as drafts (
- Copy the key.
It starts with
org_sk_and is shown only once.
Treat it like a password:
- Keep it on your server. Never put it in a website, browser extension or mobile app.
- A key with
prompts:publishchanges what the AI agent tells your customers, in every prompt group of your organization. Give it only to systems you trust to do that unreviewed. - Revoke it from the same page if it may have leaked. It stops working immediately.
Send it on every request:
Authorization: Bearer org_sk_…
Content-Type: application/jsonEach key may make 300 requests per minute, and your organization may write prompts 60 times per minute across all its keys.
Past that you get 429 with a Retry-After header, in seconds.
2. Find the prompt group
curl -sS "https://<your-domain>/app/api/v1/prompt-groups" \
-H "Authorization: Bearer $API_KEY"{
"success": true,
"promptGroups": [
{
"id": "6b1f0c2e-…",
"name": "Acme Store",
"description": "Main brand",
"pendingDrafts": 0,
"updatedAt": "2026-11-02T09:14:03.000Z"
}
]
}The group ID is also in the dashboard address when the group is open: /dashboard/prompt-groups/<groupId>.
3. Read a document
Every group has four documents. Name the one you want by its type in the path:
| Type | Dashboard tab |
|---|---|
instruction | AI Instructions |
knowledge | Knowledge Base |
handover | Human Handover |
template | Templates |
curl -sS "https://<your-domain>/app/api/v1/prompt-groups/$GROUP_ID/prompts/knowledge" \
-H "Authorization: Bearer $API_KEY"{
"success": true,
"prompt": {
"promptId": "a41d…",
"type": "knowledge",
"title": "Knowledge Base",
"content": "# Shipping\n…",
"version": 12,
"updatedAt": "2026-11-02T09:14:03.000Z",
"draft": null
}
}version is the number of the live version, the one the AI agent answers from.
It is 0 for a document that has never been saved.
Keep it: you send it back as baseVersion when you write (see section 6).
GET …/prompt-groups/$GROUP_ID/prompts returns all four documents at once.
4. Write a draft
A draft is the safe default. The AI agent keeps answering from the published content until someone publishes the draft.
curl -sS -X PUT "https://<your-domain>/app/api/v1/prompt-groups/$GROUP_ID/prompts/knowledge" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": "# Shipping\nWe ship within 2 working days.\n",
"baseVersion": 12,
"label": "FAQ sync 2026-11-02",
"note": "Updated shipping times",
"actorLabel": "faq-sync@acme.com"
}'{
"success": true,
"status": "draft",
"promptId": "a41d…",
"type": "knowledge",
"liveVersion": 12,
"draft": {
"content": "# Shipping\nWe ship within 2 working days.\n",
"baseVersion": 12,
"label": "FAQ sync 2026-11-02",
"note": "Updated shipping times",
"apiKeyId": "3f6c1a2e-…",
"actorLabel": "faq-sync@acme.com",
"createdAt": "2026-11-02T10:00:00.000Z",
"updatedAt": "2026-11-02T10:00:00.000Z"
}
}Your team sees the draft on the document's tab in Training, where they can review, publish or discard it.
Each document holds one draft. Writing another draft replaces the previous one.
Body fields
| Field | Required | Description |
|---|---|---|
content | Yes | The Markdown to write. It must not be empty. |
mode | No | replace (default) replaces the whole document. append adds content after a blank line. |
publish | No | true makes the content live now and needs prompts:publish. Default false: a draft. |
baseVersion | No | The version you last read. The write is refused with 409 if the document has changed since. |
label | No | A name for the version or draft, up to 120 characters. Shown in History. |
note | No | A longer note, up to 1,000 characters. |
actorLabel | No | Who or what on your side made the change, up to 128 characters. Shown next to the key's name. |
Any other field is a 400.
The whole body may be up to 512 KB.
Appending
append is for systems that add entries without owning the whole document, such as a new FAQ answer:
{ "content": "## Do you ship to Canada?\nYes, in 5 to 7 working days.", "mode": "append" }When you write a draft, append adds to the existing draft if there is one, and otherwise to the published content.
An append to a draft keeps that draft's label, note and actorLabel unless you send new ones.
When you publish, it adds to the published content.
A document can grow to at most 524,288 characters through the API.
An append that would take it past that is refused with 413 CONTENT_TOO_LARGE, and nothing is written.
5. Publish
Directly
Send "publish": true with a key that has both permissions:
curl -sS -X PUT "https://<your-domain>/app/api/v1/prompt-groups/$GROUP_ID/prompts/knowledge" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{ "content": "…", "publish": true, "baseVersion": 12 }'{
"success": true,
"status": "published",
"promptId": "a41d…",
"type": "knowledge",
"version": 13,
"changed": true
}The AI agent answers from the new content from its next reply. The change appears in the document's History with your key's name as the author, and can be restored from there like any other version.
changed is false when the content was already identical.
Then no version is created, so repeating a call is safe.
A pending draft
curl -sS -X POST "https://<your-domain>/app/api/v1/prompt-groups/$GROUP_ID/prompts/knowledge/draft/publish" \
-H "Authorization: Bearer $API_KEY"The response is the same as a direct publish, and the draft is deleted.
The body is optional: { "force": true, "actorLabel": "…" }.
If the document was published again after the draft was written, the call is refused with 409 STALE_DRAFT, because publishing would undo that newer change.
Send { "force": true } to publish the draft anyway.
Discard a draft
curl -sS -X DELETE "https://<your-domain>/app/api/v1/prompt-groups/$GROUP_ID/prompts/knowledge/draft" \
-H "Authorization: Bearer $API_KEY"The published content doesn't change.
6. Avoid overwriting someone else's change
Your team can edit the same documents in the dashboard.
Send baseVersion on every write, set to the version you last read.
If the document has changed since, nothing is written and you get:
{
"success": false,
"code": "VERSION_CONFLICT",
"error": "The prompt changed since version 12. Read it again and retry.",
"currentVersion": 13
}Read the document again, merge your change, and retry with the new version.
baseVersion also makes retries safe.
If an append timed out but actually succeeded, retrying with the same baseVersion gets 409 instead of adding the text twice.
Errors
Every error has the same shape: { "success": false, "code": "…", "error": "…" }.
| Status | code | Meaning |
|---|---|---|
| 400 | INVALID_REQUEST | The body or the document type is invalid. error says which field. |
| 401 | UNAUTHENTICATED | The key is missing, wrong or revoked. |
| 403 | FORBIDDEN | The key lacks prompts:write, or lacks prompts:publish for a publish. |
| 404 | NOT_FOUND | No such prompt group in your organization, or no draft to publish or discard. |
| 409 | VERSION_CONFLICT | The document changed since baseVersion. |
| 409 | STALE_DRAFT | The draft is older than the published content. Retry with force. |
| 413 | PAYLOAD_TOO_LARGE | The body is over 512 KB. |
| 413 | CONTENT_TOO_LARGE | The document would be over 524,288 characters. length and maxLength say by how much. |
| 429 | RATE_LIMITED | Too many requests. Wait for Retry-After seconds. |
| 500 | INTERNAL | Something failed on our side. Read the document to see whether your write landed, then retry with baseVersion. |