Incantory
Sign in

Change requests API

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

List change requests on a prompt

GET/api/v1/prompts/{owner}/{slug}/change-requestsToken optional

Newest first; status defaults to open. cursor is the last number of the previous page. counts has the totals per status.

listChangeRequests parameters
NameTypeDescription
owner pathrequiredstring
slug pathrequiredstring
status query"open" | "merged" | "closed" | "all"Default open
cursor queryinteger (…–9007199254740991)The last number of the previous page
limit queryinteger (1–100)

Responses: 200 OK304, 400, 404, 429

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

Propose a version of your fork to this prompt

POST/api/v1/prompts/{owner}/{slug}/change-requestsToken required · scope write

from must be a direct fork of this prompt that you own. One open request per fork (409 already_open); 409 no_changes when identical to the latest version; 403 blocked when the owner blocked you. Notifies the owner and all-level watchers.

openChangeRequest parameters
NameTypeDescription
owner pathrequiredstring
slug pathrequiredstring

Request body

openChangeRequest body fields
NameTypeDescription
fromrequiredstringYour fork, as owner/slug (optionally @vN)
versioninteger (…–9007199254740991)Version of the fork to propose; default its latest
titlerequiredstring
bodystringMarkdown description

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

Response fields
openChangeRequest response fields
NameTypeDescription
idrequiredstring
numberrequirednumber
titlerequiredstring
bodyrequiredstring
statusrequired"open" | "merged" | "closed"
targetrequiredstring
authorrequiredobject | null
sourcerequiredobject
mergedVersionrequirednumber | null
mergedByrequiredstring | null
mergedAtrequiredstring | null
closedByrequiredstring | null
closedAtrequiredstring | null
commentsLockedrequiredboolean
createdAtrequiredstring
updatedAtrequiredstring
Example
curl -X POST 'https://incantory.ai/api/v1/prompts/{owner}/{slug}/change-requests' \
  -H "Authorization: Bearer $INCANTORY_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"from":"from","title":"title"}'

Get a change request (with what the caller may do)

GET/api/v1/prompts/{owner}/{slug}/change-requests/{n}Token optional

getChangeRequest parameters
NameTypeDescription
owner pathrequiredstring
slug pathrequiredstring
n pathrequiredinteger (…–1000000000)Change request number

Responses: 200 OK400, 404, 429

Response fields
getChangeRequest response fields
NameTypeDescription
idrequiredstring
numberrequirednumber
titlerequiredstring
bodyrequiredstring
statusrequired"open" | "merged" | "closed"
targetrequiredstring
authorrequiredobject | null
sourcerequiredobject
mergedVersionrequirednumber | null
mergedByrequiredstring | null
mergedAtrequiredstring | null
closedByrequiredstring | null
closedAtrequiredstring | null
commentsLockedrequiredboolean
createdAtrequiredstring
updatedAtrequiredstring
viewerrequiredobject
Example
curl 'https://incantory.ai/api/v1/prompts/{owner}/{slug}/change-requests/{n}' \
  -H "Authorization: Bearer $INCANTORY_TOKEN"

Edit, close or reopen a change request

PATCH/api/v1/prompts/{owner}/{slug}/change-requests/{n}Token required · scope write

title/body/sourceVersion: the author, while open. status "closed": the author or the target owner. status "open": reopen a closed (not merged) request.

updateChangeRequest parameters
NameTypeDescription
owner pathrequiredstring
slug pathrequiredstring
n pathrequiredinteger (…–1000000000)Change request number

Request body

updateChangeRequest body fields
NameTypeDescription
titlestring
bodystring
sourceVersioninteger (…–9007199254740991)Move the request to another version of the same fork
status"open" | "closed"closed = close; open = reopen a closed request

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

Response fields
updateChangeRequest response fields
NameTypeDescription
idrequiredstring
numberrequirednumber
titlerequiredstring
bodyrequiredstring
statusrequired"open" | "merged" | "closed"
targetrequiredstring
authorrequiredobject | null
sourcerequiredobject
mergedVersionrequirednumber | null
mergedByrequiredstring | null
mergedAtrequiredstring | null
closedByrequiredstring | null
closedAtrequiredstring | null
commentsLockedrequiredboolean
createdAtrequiredstring
updatedAtrequiredstring
Example
curl -X PATCH 'https://incantory.ai/api/v1/prompts/{owner}/{slug}/change-requests/{n}' \
  -H "Authorization: Bearer $INCANTORY_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{}'

The diff a change request proposes

GET/api/v1/prompts/{owner}/{slug}/change-requests/{n}/diffToken optional

Open/closed: the target's latest version → the proposed version. Merged: the version before the merge → the merged version. Same file-level shape as GET …/diff/{a}..{b}.

diffChangeRequest parameters
NameTypeDescription
owner pathrequiredstring
slug pathrequiredstring
n pathrequiredinteger (…–1000000000)Change request number

Responses: 200 OK400, 404, 429

Response fields
diffChangeRequest response fields
NameTypeDescription
baserequirednumber | null
diffrequiredobject
Example
curl 'https://incantory.ai/api/v1/prompts/{owner}/{slug}/change-requests/{n}/diff' \
  -H "Authorization: Bearer $INCANTORY_TOKEN"

Merge a change request (target owner)

POST/api/v1/prompts/{owner}/{slug}/change-requests/{n}/mergeToken required · scope write

Creates a new version on the target authored by the merger with the request author as co-author (coAuthorIds), parented on the proposed version, and marks the request merged in the same transaction.

mergeChangeRequest parameters
NameTypeDescription
owner pathrequiredstring
slug pathrequiredstring
n pathrequiredinteger (…–1000000000)Change request number

Request body (optional)

mergeChangeRequest body fields
NameTypeDescription
messagestringExtra text appended to the merge commit message

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

Response fields
mergeChangeRequest response fields
NameTypeDescription
idrequiredstring
numberrequirednumber
titlerequiredstring
bodyrequiredstring
statusrequired"open" | "merged" | "closed"
targetrequiredstring
authorrequiredobject | null
sourcerequiredobject
mergedVersionrequirednumber | null
mergedByrequiredstring | null
mergedAtrequiredstring | null
closedByrequiredstring | null
closedAtrequiredstring | null
commentsLockedrequiredboolean
createdAtrequiredstring
updatedAtrequiredstring
Example
curl -X POST 'https://incantory.ai/api/v1/prompts/{owner}/{slug}/change-requests/{n}/merge' \
  -H "Authorization: Bearer $INCANTORY_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{}'