AI suggestions API
4 operations. Authentication, errors and pagination work as described in the REST API overview.
Pending AI suggestions for your prompt
GET/api/v1/ai-suggestionsToken required
| Name | Type | Description |
|---|---|---|
targetType queryrequired | "prompt" | |
targetId queryrequired | string |
Responses: 200 OK400, 401, 403, 404, 429
Response fields
| Name | Type | Description |
|---|---|---|
itemsrequired | object[] |
Example
curl 'https://incantory.ai/api/v1/ai-suggestions' \
-H "Authorization: Bearer $INCANTORY_TOKEN"Ask for AI suggestions (tags, summary, variables, translation, duplicates)
POST/api/v1/ai-suggestionsToken required · scope write
Queued for the background worker; suggestions appear when it has run. Nothing changes until you apply one.
Request body
| Name | Type | Description |
|---|---|---|
targetTyperequired | "prompt" | |
targetIdrequired | string | |
kinds | ("tags" | "summary" | "variables" | "translation" | "duplicate")[] | |
locale | "en" | "zh" | Target language for a translation request |
Responses: 202 OK400, 401, 403, 404, 422, 429
Response fields
| Name | Type | Description |
|---|---|---|
queuedrequired | boolean |
Example
curl -X POST 'https://incantory.ai/api/v1/ai-suggestions' \
-H "Authorization: Bearer $INCANTORY_TOKEN" \
-H 'Content-Type: application/json' \
-d '{"targetType":"prompt","targetId":"targetId"}'Apply a suggestion
POST/api/v1/ai-suggestions/{id}/applyToken required · scope write
| Name | Type | Description |
|---|---|---|
id pathrequired | string |
Responses: 200 OK400, 401, 403, 404, 409, 422, 429
Response fields
| Name | Type | Description |
|---|---|---|
idrequired | string | |
statusrequired | "applied" | |
kindrequired | string |
Example
curl -X POST 'https://incantory.ai/api/v1/ai-suggestions/{id}/apply' \
-H "Authorization: Bearer $INCANTORY_TOKEN"Dismiss a suggestion
POST/api/v1/ai-suggestions/{id}/dismissToken required · scope write
| Name | Type | Description |
|---|---|---|
id pathrequired | string |
Responses: 200 OK400, 401, 403, 404, 409, 422, 429
Response fields
| Name | Type | Description |
|---|---|---|
idrequired | string | |
statusrequired | "dismissed" |
Example
curl -X POST 'https://incantory.ai/api/v1/ai-suggestions/{id}/dismiss' \
-H "Authorization: Bearer $INCANTORY_TOKEN"