Collections API
11 operations. Authentication, errors and pagination work as described in the REST API overview.
List collections
GET/api/v1/collectionsToken optional
Public collections, one owner's (owner=handle) or yours (mine=1), newest first.
| Name | Type | Description |
|---|---|---|
owner query | string | |
mine query | "1" | "true" | |
cursor query | string |
Responses: 200 OK304, 400, 404, 429
Response fields
| Name | Type | Description |
|---|---|---|
itemsrequired | object[] | |
nextCursorrequired | string | null | Opaque cursor for the next page; null at the end |
curl 'https://incantory.ai/api/v1/collections' \
-H "Authorization: Bearer $INCANTORY_TOKEN"Create a collection
POST/api/v1/collectionsToken required
Request body
| Name | Type | Description |
|---|---|---|
titlerequired | string | |
description | string | |
visibility | "public" | "unlisted" | "private" |
Responses: 201 OK400, 401, 403, 404, 429
Response fields
| Name | Type | Description |
|---|---|---|
idrequired | string | |
slugrequired | string | |
titlerequired | string | |
descriptionrequired | string | |
visibilityrequired | "public" | "unlisted" | "private" | |
itemCountrequired | integer (-9007199254740991–9007199254740991) | |
starCountrequired | integer (-9007199254740991–9007199254740991) | |
ownerrequired | object | |
urlrequired | string | |
updatedAtrequired | string | ISO 8601 timestamp (UTC) |
createdAtrequired | string | ISO 8601 timestamp (UTC) |
viewerrequired | object |
curl -X POST 'https://incantory.ai/api/v1/collections' \
-H "Authorization: Bearer $INCANTORY_TOKEN" \
-H 'Content-Type: application/json' \
-d '{"title":"title"}'A collection and the items you may see
GET/api/v1/collections/{id}Token optional
| Name | Type | Description |
|---|---|---|
id pathrequired | string | Id |
Responses: 200 OK400, 404, 429
Response fields
| Name | Type | Description |
|---|---|---|
idrequired | string | |
slugrequired | string | |
titlerequired | string | |
descriptionrequired | string | |
visibilityrequired | "public" | "unlisted" | "private" | |
itemCountrequired | integer (-9007199254740991–9007199254740991) | |
starCountrequired | integer (-9007199254740991–9007199254740991) | |
ownerrequired | object | |
urlrequired | string | |
updatedAtrequired | string | ISO 8601 timestamp (UTC) |
createdAtrequired | string | ISO 8601 timestamp (UTC) |
viewerrequired | object | |
itemsrequired | object[] |
curl 'https://incantory.ai/api/v1/collections/{id}' \
-H "Authorization: Bearer $INCANTORY_TOKEN"Edit a collection (owner or admin)
PATCH/api/v1/collections/{id}Token required
A slug change redirects the old URL.
| Name | Type | Description |
|---|---|---|
id pathrequired | string | Id |
Request body
| Name | Type | Description |
|---|---|---|
title | string | |
description | string | |
visibility | "public" | "unlisted" | "private" | |
slug | string |
Responses: 200 OK400, 401, 403, 404, 429
Response fields
| Name | Type | Description |
|---|---|---|
idrequired | string | |
slugrequired | string | |
titlerequired | string | |
descriptionrequired | string | |
visibilityrequired | "public" | "unlisted" | "private" | |
itemCountrequired | integer (-9007199254740991–9007199254740991) | |
starCountrequired | integer (-9007199254740991–9007199254740991) | |
ownerrequired | object | |
urlrequired | string | |
updatedAtrequired | string | ISO 8601 timestamp (UTC) |
createdAtrequired | string | ISO 8601 timestamp (UTC) |
viewerrequired | object |
curl -X PATCH 'https://incantory.ai/api/v1/collections/{id}' \
-H "Authorization: Bearer $INCANTORY_TOKEN" \
-H 'Content-Type: application/json' \
-d '{}'Delete a collection (owner or admin)
DELETE/api/v1/collections/{id}Token required
| Name | Type | Description |
|---|---|---|
id pathrequired | string | Id |
Responses: 204 OK400, 401, 403, 404, 429
curl -X DELETE 'https://incantory.ai/api/v1/collections/{id}' \
-H "Authorization: Bearer $INCANTORY_TOKEN"Add a prompt, make or post (idempotent)
POST/api/v1/collections/{id}/itemsToken required
| Name | Type | Description |
|---|---|---|
id pathrequired | string | Id |
Request body
| Name | Type | Description |
|---|---|---|
itemTyperequired | "prompt" | "make" | "post" | |
itemIdrequired | string | |
note | string | null |
Responses: 201 Added (200 when it was already there, `added: false`)400, 401, 403, 404, 409, 429
Response fields
| Name | Type | Description |
|---|---|---|
addedrequired | boolean | |
itemCountrequired | integer (-9007199254740991–9007199254740991) |
curl -X POST 'https://incantory.ai/api/v1/collections/{id}/items' \
-H "Authorization: Bearer $INCANTORY_TOKEN" \
-H 'Content-Type: application/json' \
-d '{"itemType":"prompt","itemId":"itemId"}'Reorder items
PUT/api/v1/collections/{id}/itemsToken required
| Name | Type | Description |
|---|---|---|
id pathrequired | string | Id |
Request body
| Name | Type | Description |
|---|---|---|
orderrequired | string[] |
Responses: 200 OK400, 401, 403, 404, 429
Response fields
| Name | Type | Description |
|---|---|---|
okrequired | true |
curl -X PUT 'https://incantory.ai/api/v1/collections/{id}/items' \
-H "Authorization: Bearer $INCANTORY_TOKEN" \
-H 'Content-Type: application/json' \
-d '{"order":["order"]}'Remove an item by its target
DELETE/api/v1/collections/{id}/itemsToken required
| Name | Type | Description |
|---|---|---|
id pathrequired | string | Id |
itemType query | "prompt" | "make" | "post" | |
itemId query | string |
Responses: 200 OK400, 401, 403, 404, 429
Response fields
| Name | Type | Description |
|---|---|---|
removedrequired | boolean | |
itemCountrequired | integer (-9007199254740991–9007199254740991) |
curl -X DELETE 'https://incantory.ai/api/v1/collections/{id}/items' \
-H "Authorization: Bearer $INCANTORY_TOKEN"Set the note on an item
PATCH/api/v1/collections/{id}/items/{itemId}Token required
| Name | Type | Description |
|---|---|---|
id pathrequired | string | Collection id |
itemId pathrequired | string | Collection item row id |
Request body
| Name | Type | Description |
|---|---|---|
noterequired | string | null |
Responses: 200 OK400, 401, 403, 404, 429
Response fields
| Name | Type | Description |
|---|---|---|
okrequired | true |
curl -X PATCH 'https://incantory.ai/api/v1/collections/{id}/items/{itemId}' \
-H "Authorization: Bearer $INCANTORY_TOKEN" \
-H 'Content-Type: application/json' \
-d '{"note":"note"}'Remove one item
DELETE/api/v1/collections/{id}/items/{itemId}Token required
| Name | Type | Description |
|---|---|---|
id pathrequired | string | Collection id |
itemId pathrequired | string | Collection item row id |
Responses: 200 OK400, 401, 403, 404, 429
Response fields
| Name | Type | Description |
|---|---|---|
removedrequired | boolean | |
itemCountrequired | integer (-9007199254740991–9007199254740991) |
curl -X DELETE 'https://incantory.ai/api/v1/collections/{id}/items/{itemId}' \
-H "Authorization: Bearer $INCANTORY_TOKEN"Your collections, flagged if they contain a target
GET/api/v1/collections/membershipToken required
| Name | Type | Description |
|---|---|---|
targetType queryrequired | "prompt" | "make" | "post" | |
targetId queryrequired | string |
Responses: 200 OK400, 401, 403, 404, 429
Response fields
| Name | Type | Description |
|---|---|---|
itemsrequired | object[] |
curl 'https://incantory.ai/api/v1/collections/membership' \
-H "Authorization: Bearer $INCANTORY_TOKEN"