Incantory
Sign in

Prompts API

23 operations. Authentication, errors and pagination work as described in the REST API overview.

List and search prompts

GET/api/v1/promptsToken optional

Keyset-paginated. q runs full-text + trigram search ordered by relevance unless sort is given. Drafts, private and unlisted prompts are listed only to their owner.

listPrompts parameters
NameTypeDescription
q querystring
owner querystring
tag querystring
kind query"text" | "chat" | "image" | "video" | "skill" | "rules" | "agent"
model querystring
source querystring
sort query"new" | "top" | "updated"
cursor querystring
limit queryinteger (1–100)

Responses: 200 OK304, 400, 404, 429

Response fields
listPrompts response fields
NameTypeDescription
itemsrequiredobject[]
nextCursorrequiredstring | null
Example
curl 'https://incantory.ai/api/v1/prompts' \
  -H "Authorization: Bearer $INCANTORY_TOKEN"

Create a prompt (published v1, or a draft with publish=false)

POST/api/v1/promptsToken required · scope write

Request body

createPrompt body fields
NameTypeDescription
slugrequiredstring
titlerequiredstring
summarystring
kind"text" | "chat" | "image" | "video" | "skill" | "rules" | "agent"
licenseSpdx"CC0-1.0" | "CC-BY-4.0" | "CC-BY-SA-4.0" | "MIT" | "Apache-2.0"Defaults to CC-BY-4.0
tagsstring[]
contentRating"general" | "mature"
visibility"public" | "unlisted"
publishbooleanfalse keeps the prompt as a draft (PLAN §14c.3). Default true.
messagestring
filesrequiredobject[]
frontmatterobject

Responses: 201 OK400, 401, 403, 404, 409, 413, 422, 429

Response fields
createPrompt response fields
NameTypeDescription
idrequiredstring
refrequiredstring
ownerrequiredobject
slugrequiredstring
titlerequiredstring
summaryrequiredstring
kindrequired"text" | "chat" | "image" | "video" | "skill" | "rules" | "agent"
licenseSpdxrequiredstring
contentRatingrequired"general" | "mature" | "explicit"
visibilityrequired"public" | "unlisted" | "private"
publishStaterequired"draft" | "published"
tagsrequiredstring[]
starCountrequiredinteger (-9007199254740991–9007199254740991)
forkCountrequiredinteger (-9007199254740991–9007199254740991)
makeCountrequiredinteger (-9007199254740991–9007199254740991)
latestVersionrequiredinteger (-9007199254740991–9007199254740991) | null
riskLevelrequired"unscanned" | "low" | "med" | "high"
updatedAtrequiredstring
publishedAtrequiredstring | null
versionrequiredobject
labelsrequiredobject[]
forkedFromrequiredobject | null
attributionrequiredobject | null
attributionChainrequiredobject[]
unmodifiedForkrequiredboolean
canonicalPathrequiredstring
viewerrequiredobject
hasDraftrequiredboolean
Example
curl -X POST 'https://incantory.ai/api/v1/prompts' \
  -H "Authorization: Bearer $INCANTORY_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"slug":"slug","title":"title","files":[{"path":"path","content":"content"}]}'

Get a prompt at its latest version, a pinned version or a label

GET/api/v1/prompts/{owner}/{slug}Token optional

Pinned versions are served with Cache-Control: immutable; yanked versions carry a Deprecation header. With format= the response is a download instead of JSON. A renamed slug answers 301.

getPrompt parameters
NameTypeDescription
owner pathrequiredstring
slug pathrequiredstring
version queryinteger (…–999999999)
label querystring
format query"zip" | "tar" | "skill" | "cursor-mdc" | "copilot-instructions" | "copilot-agent" | "claude-agent" | "agents-md" | "claude-md" | "gemini-md" | "plain"Return a download in this format instead of JSON (PLAN §14c.12)

Responses: 200 OK301, 304, 400, 404, 410, 429

Response fields
getPrompt response fields
NameTypeDescription
idrequiredstring
refrequiredstring
ownerrequiredobject
slugrequiredstring
titlerequiredstring
summaryrequiredstring
kindrequired"text" | "chat" | "image" | "video" | "skill" | "rules" | "agent"
licenseSpdxrequiredstring
contentRatingrequired"general" | "mature" | "explicit"
visibilityrequired"public" | "unlisted" | "private"
publishStaterequired"draft" | "published"
tagsrequiredstring[]
starCountrequiredinteger (-9007199254740991–9007199254740991)
forkCountrequiredinteger (-9007199254740991–9007199254740991)
makeCountrequiredinteger (-9007199254740991–9007199254740991)
latestVersionrequiredinteger (-9007199254740991–9007199254740991) | null
riskLevelrequired"unscanned" | "low" | "med" | "high"
updatedAtrequiredstring
publishedAtrequiredstring | null
versionrequiredobject
labelsrequiredobject[]
forkedFromrequiredobject | null
attributionrequiredobject | null
attributionChainrequiredobject[]
unmodifiedForkrequiredboolean
canonicalPathrequiredstring
viewerrequiredobject
hasDraftrequiredboolean
Example
curl 'https://incantory.ai/api/v1/prompts/{owner}/{slug}' \
  -H "Authorization: Bearer $INCANTORY_TOKEN"

Edit metadata (title, summary, tags, license, visibility, rating, slug)

PATCH/api/v1/prompts/{owner}/{slug}Token required · scope write

Renaming the slug writes a 301 redirect from the old path (and every sub-path). Forks may only relicense within their parent's fork policy.

updatePrompt parameters
NameTypeDescription
owner pathrequiredstring
slug pathrequiredstring

Request body

updatePrompt body fields
NameTypeDescription
slugstring
titlestring
summarystring
licenseSpdxstring
tagsstring[]
contentRating"general" | "mature"
visibility"public" | "unlisted"

Responses: 200 OK400, 401, 403, 404, 409, 410, 422, 429

Response fields
updatePrompt response fields
NameTypeDescription
idrequiredstring
refrequiredstring
ownerrequiredobject
slugrequiredstring
titlerequiredstring
summaryrequiredstring
kindrequired"text" | "chat" | "image" | "video" | "skill" | "rules" | "agent"
licenseSpdxrequiredstring
contentRatingrequired"general" | "mature" | "explicit"
visibilityrequired"public" | "unlisted" | "private"
publishStaterequired"draft" | "published"
tagsrequiredstring[]
starCountrequiredinteger (-9007199254740991–9007199254740991)
forkCountrequiredinteger (-9007199254740991–9007199254740991)
makeCountrequiredinteger (-9007199254740991–9007199254740991)
latestVersionrequiredinteger (-9007199254740991–9007199254740991) | null
riskLevelrequired"unscanned" | "low" | "med" | "high"
updatedAtrequiredstring
publishedAtrequiredstring | null
versionrequiredobject
labelsrequiredobject[]
forkedFromrequiredobject | null
attributionrequiredobject | null
attributionChainrequiredobject[]
unmodifiedForkrequiredboolean
canonicalPathrequiredstring
viewerrequiredobject
hasDraftrequiredboolean
Example
curl -X PATCH 'https://incantory.ai/api/v1/prompts/{owner}/{slug}' \
  -H "Authorization: Bearer $INCANTORY_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{}'

Soft-delete a prompt (it answers 410 afterwards)

DELETE/api/v1/prompts/{owner}/{slug}Token required · scope write

deletePrompt parameters
NameTypeDescription
owner pathrequiredstring
slug pathrequiredstring

Responses: 204 OK400, 401, 403, 404, 429

Example
curl -X DELETE 'https://incantory.ai/api/v1/prompts/{owner}/{slug}' \
  -H "Authorization: Bearer $INCANTORY_TOKEN"

Diff two versions (`{range}` is `a..b`)

GET/api/v1/prompts/{owner}/{slug}/diff/{range}Token optional

File-level status with both texts, plus frontmatter and variables before/after. Unchanged files omit their content.

diffVersions parameters
NameTypeDescription
owner pathrequiredstring
slug pathrequiredstring
range pathrequiredstring

Responses: 200 OK304, 400, 404, 429

Response fields
diffVersions response fields
NameTypeDescription
fromrequiredinteger (-9007199254740991–9007199254740991)
torequiredinteger (-9007199254740991–9007199254740991)
filesrequiredobject[]
frontmatterrequiredobject
variablesrequiredobject
Example
curl 'https://incantory.ai/api/v1/prompts/{owner}/{slug}/diff/{range}' \
  -H "Authorization: Bearer $INCANTORY_TOKEN"

Download as zip / tar.gz or converted to a tool format

GET/api/v1/prompts/{owner}/{slug}/downloadToken optional

Lossy conversions list what was dropped in the X-Incantory-Warnings header.

downloadPrompt parameters
NameTypeDescription
owner pathrequiredstring
slug pathrequiredstring
version queryinteger (…–999999999)
label querystring
format query"zip" | "tar" | "skill" | "cursor-mdc" | "copilot-instructions" | "copilot-agent" | "claude-agent" | "agents-md" | "claude-md" | "gemini-md" | "plain"

Responses: 200 The file or archive304, 400, 404, 429

Example
curl 'https://incantory.ai/api/v1/prompts/{owner}/{slug}/download' \
  -H "Authorization: Bearer $INCANTORY_TOKEN"

Get the working draft (owner only; null when none)

GET/api/v1/prompts/{owner}/{slug}/draftToken required

getDraft parameters
NameTypeDescription
owner pathrequiredstring
slug pathrequiredstring

Responses: 200 OK400, 401, 403, 404, 429

Example
curl 'https://incantory.ai/api/v1/prompts/{owner}/{slug}/draft' \
  -H "Authorization: Bearer $INCANTORY_TOKEN"

Save the working draft

PUT/api/v1/prompts/{owner}/{slug}/draftToken required · scope write

saveDraft parameters
NameTypeDescription
owner pathrequiredstring
slug pathrequiredstring

Request body

saveDraft body fields
NameTypeDescription
filesrequiredobject[]
frontmatterobject
messagestring

Responses: 204 OK400, 401, 403, 404, 410, 413, 422, 429

Example
curl -X PUT 'https://incantory.ai/api/v1/prompts/{owner}/{slug}/draft' \
  -H "Authorization: Bearer $INCANTORY_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"files":[{"path":"path","content":"content"}]}'

Discard the working draft

DELETE/api/v1/prompts/{owner}/{slug}/draftToken required · scope write

discardDraft parameters
NameTypeDescription
owner pathrequiredstring
slug pathrequiredstring

Responses: 204 OK400, 401, 403, 404, 409, 429

Example
curl -X DELETE 'https://incantory.ai/api/v1/prompts/{owner}/{slug}/draft' \
  -H "Authorization: Bearer $INCANTORY_TOKEN"

Fork into your namespace

POST/api/v1/prompts/{owner}/{slug}/forksToken required · scope write

Copies a version (default: latest) into a new prompt. The license follows the parent's fork policy; a taken slug gets a numeric suffix.

forkPrompt parameters
NameTypeDescription
owner pathrequiredstring
slug pathrequiredstring

Request body (optional)

forkPrompt body fields
NameTypeDescription
versioninteger (…–9007199254740991)
slugstring
licenseSpdxstring

Responses: 201 OK400, 401, 403, 404, 409, 422, 429

Response fields
forkPrompt response fields
NameTypeDescription
idrequiredstring
refrequiredstring
ownerrequiredobject
slugrequiredstring
titlerequiredstring
summaryrequiredstring
kindrequired"text" | "chat" | "image" | "video" | "skill" | "rules" | "agent"
licenseSpdxrequiredstring
contentRatingrequired"general" | "mature" | "explicit"
visibilityrequired"public" | "unlisted" | "private"
publishStaterequired"draft" | "published"
tagsrequiredstring[]
starCountrequiredinteger (-9007199254740991–9007199254740991)
forkCountrequiredinteger (-9007199254740991–9007199254740991)
makeCountrequiredinteger (-9007199254740991–9007199254740991)
latestVersionrequiredinteger (-9007199254740991–9007199254740991) | null
riskLevelrequired"unscanned" | "low" | "med" | "high"
updatedAtrequiredstring
publishedAtrequiredstring | null
versionrequiredobject
labelsrequiredobject[]
forkedFromrequiredobject | null
attributionrequiredobject | null
attributionChainrequiredobject[]
unmodifiedForkrequiredboolean
canonicalPathrequiredstring
viewerrequiredobject
hasDraftrequiredboolean
Example
curl -X POST 'https://incantory.ai/api/v1/prompts/{owner}/{slug}/forks' \
  -H "Authorization: Bearer $INCANTORY_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{}'

List labels

GET/api/v1/prompts/{owner}/{slug}/labelsToken optional

listLabels parameters
NameTypeDescription
owner pathrequiredstring
slug pathrequiredstring

Responses: 200 OK304, 400, 404, 429

Example
curl 'https://incantory.ai/api/v1/prompts/{owner}/{slug}/labels' \
  -H "Authorization: Bearer $INCANTORY_TOKEN"

Create or move a label

PUT/api/v1/prompts/{owner}/{slug}/labels/{name}Token required · scope write

A label cannot point at a yanked version (403 version_yanked). With requirePassingEval the target version needs a passing EvalRun: the latest finished run decides (403 eval_required). evalDatasetId narrows that to the latest run over one dataset of this prompt (404 dataset_not_found if it is not one). Every move is recorded in the label history.

setLabel parameters
NameTypeDescription
owner pathrequiredstring
slug pathrequiredstring
name pathrequiredstring

Request body

setLabel body fields
NameTypeDescription
versionrequiredinteger (…–9007199254740991)
protectedboolean
requirePassingEvalboolean
evalDatasetIdstring
reasonstring

Responses: 200 OK400, 401, 403, 404, 410, 422, 429

Response fields
setLabel response fields
NameTypeDescription
namerequiredstring
versionNumberrequiredinteger (-9007199254740991–9007199254740991)
protectedrequiredboolean
requirePassingEvalrequiredboolean
updatedAtrequiredstring
Example
curl -X PUT 'https://incantory.ai/api/v1/prompts/{owner}/{slug}/labels/{name}' \
  -H "Authorization: Bearer $INCANTORY_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"version":1}'

Delete a label

DELETE/api/v1/prompts/{owner}/{slug}/labels/{name}Token required · scope write

deleteLabel parameters
NameTypeDescription
owner pathrequiredstring
slug pathrequiredstring
name pathrequiredstring

Responses: 204 OK400, 401, 403, 404, 410, 429

Example
curl -X DELETE 'https://incantory.ai/api/v1/prompts/{owner}/{slug}/labels/{name}' \
  -H "Authorization: Bearer $INCANTORY_TOKEN"

Label move history, newest first

GET/api/v1/prompts/{owner}/{slug}/labels/{name}/historyToken optional

labelHistory parameters
NameTypeDescription
owner pathrequiredstring
slug pathrequiredstring
name pathrequiredstring

Responses: 200 OK304, 400, 404, 429

Example
curl 'https://incantory.ai/api/v1/prompts/{owner}/{slug}/labels/{name}/history' \
  -H "Authorization: Bearer $INCANTORY_TOKEN"

The entry file as text (or `?path=`)

GET/api/v1/prompts/{owner}/{slug}/rawToken optional

rawEntry parameters
NameTypeDescription
owner pathrequiredstring
slug pathrequiredstring
version queryinteger (…–999999999)
label querystring
path querystring

Responses: 200 The file304, 400, 404, 429

Example
curl 'https://incantory.ai/api/v1/prompts/{owner}/{slug}/raw' \
  -H "Authorization: Bearer $INCANTORY_TOKEN"

One file of a version as text

GET/api/v1/prompts/{owner}/{slug}/raw/{path}Token optional

rawFile parameters
NameTypeDescription
owner pathrequiredstring
slug pathrequiredstring
path pathrequiredstringFile path within the package (may contain "/")
version queryinteger (…–999999999)
label querystring

Responses: 200 The file304, 400, 404, 429

Example
curl 'https://incantory.ai/api/v1/prompts/{owner}/{slug}/raw/{path}' \
  -H "Authorization: Bearer $INCANTORY_TOKEN"

List versions, newest first (yanked versions only for the owner)

GET/api/v1/prompts/{owner}/{slug}/versionsToken optional

listVersions parameters
NameTypeDescription
owner pathrequiredstring
slug pathrequiredstring
cursor querystring
limit queryinteger (1–100)

Responses: 200 OK304, 400, 404, 429

Response fields
listVersions response fields
NameTypeDescription
itemsrequiredobject[]
nextCursorrequiredstring | null
Example
curl 'https://incantory.ai/api/v1/prompts/{owner}/{slug}/versions' \
  -H "Authorization: Bearer $INCANTORY_TOKEN"

Commit a new immutable version (from the body, or the saved draft when files are omitted)

POST/api/v1/prompts/{owner}/{slug}/versionsToken required · scope write

commitVersion parameters
NameTypeDescription
owner pathrequiredstring
slug pathrequiredstring

Request body (optional)

commitVersion body fields
NameTypeDescription
filesobject[]Omit to commit the saved draft
frontmatterobject
messagestring
baseVersioninteger (…–9007199254740991)Optimistic concurrency: the version you edited from; 409 stale_base if it is not the latest

Responses: 201 OK400, 401, 403, 404, 409, 410, 413, 422, 429

Response fields
commitVersion response fields
NameTypeDescription
numberrequiredinteger (-9007199254740991–9007199254740991)
messagerequiredstring
authorrequiredobject | null
contentHashrequiredstring
createdAtrequiredstring
yankedrequiredboolean
labelsrequiredstring[]
Example
curl -X POST 'https://incantory.ai/api/v1/prompts/{owner}/{slug}/versions' \
  -H "Authorization: Bearer $INCANTORY_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{}'

Get one version with its files (immutable)

GET/api/v1/prompts/{owner}/{slug}/versions/{n}Token optional

getVersion parameters
NameTypeDescription
owner pathrequiredstring
slug pathrequiredstring
n pathrequiredinteger (…–999999999)

Responses: 200 OK304, 400, 404, 429

Response fields
getVersion response fields
NameTypeDescription
numberrequiredinteger (-9007199254740991–9007199254740991)
messagerequiredstring
authorrequiredobject | null
contentHashrequiredstring
createdAtrequiredstring
yankedrequiredboolean
labelsrequiredstring[]
filesrequiredobject[]
frontmatterrequiredobject
variablesrequiredobject[]
targetModelsrequiredstring[]
Example
curl 'https://incantory.ai/api/v1/prompts/{owner}/{slug}/versions/{n}' \
  -H "Authorization: Bearer $INCANTORY_TOKEN"

Restore an old version as a new version

POST/api/v1/prompts/{owner}/{slug}/versions/{n}/restoreToken required · scope write

restoreVersion parameters
NameTypeDescription
owner pathrequiredstring
slug pathrequiredstring
n pathrequiredinteger (…–999999999)

Request body (optional)

restoreVersion body fields
NameTypeDescription
messagestring

Responses: 201 OK400, 401, 403, 404, 409, 410, 429

Response fields
restoreVersion response fields
NameTypeDescription
numberrequiredinteger (-9007199254740991–9007199254740991)
messagerequiredstring
authorrequiredobject | null
contentHashrequiredstring
createdAtrequiredstring
yankedrequiredboolean
labelsrequiredstring[]
Example
curl -X POST 'https://incantory.ai/api/v1/prompts/{owner}/{slug}/versions/{n}/restore' \
  -H "Authorization: Bearer $INCANTORY_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{}'

Yank a version (hidden from lists, cannot be labelled; still served when pinned)

POST/api/v1/prompts/{owner}/{slug}/versions/{n}/yankToken required · scope write

yankVersion parameters
NameTypeDescription
owner pathrequiredstring
slug pathrequiredstring
n pathrequiredinteger (…–999999999)

Request body

yankVersion body fields
NameTypeDescription
reasonrequiredstring

Responses: 204 OK400, 401, 403, 404, 409, 410, 429

Example
curl -X POST 'https://incantory.ai/api/v1/prompts/{owner}/{slug}/versions/{n}/yank' \
  -H "Authorization: Bearer $INCANTORY_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"reason":"reason"}'

Unyank a version

DELETE/api/v1/prompts/{owner}/{slug}/versions/{n}/yankToken required · scope write

unyankVersion parameters
NameTypeDescription
owner pathrequiredstring
slug pathrequiredstring
n pathrequiredinteger (…–999999999)

Responses: 204 OK400, 401, 403, 404, 410, 429

Example
curl -X DELETE 'https://incantory.ai/api/v1/prompts/{owner}/{slug}/versions/{n}/yank' \
  -H "Authorization: Bearer $INCANTORY_TOKEN"