Skip to content

Topics

The groups an audit’s prompts are filed under. Reports can be sliced by topic. Beta: these shapes may change; see the changelog.

PATCH /audits/{auditId}/prompts/topic

Moves the named prompts into one topic, or into none. All or nothing.

Terminal window
curl -X PATCH "https://api.beket.ai/api/v1/audits/AUDIT_ID/prompts/topic" \
-H "Authorization: Bearer $BEKET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"queryIds":[],"topicId":"<topicId>"}'
NameInRequiredTypeDescription
auditIdpathyesstringThe audit’s id.
FieldTypeRequiredDescription
queryIdsstring[]yesPrompt ids of this audit.
topicIdstring | nullyesAn id of this audit’s topics, or null to file the prompts under none.
FieldTypeRequiredDescription
successbooleanyes
dataobjectyes
data.updatedintegeryes
{
"success": true,
"data": {
"updated": 3
}
}

GET /audits/{auditId}/topics

Every topic with how many prompts it holds, plus the count filed under none.

Terminal window
curl "https://api.beket.ai/api/v1/audits/AUDIT_ID/topics" \
-H "Authorization: Bearer $BEKET_API_KEY"
NameInRequiredTypeDescription
auditIdpathyesstringThe audit’s id.
FieldTypeRequiredDescription
successbooleanyes
dataobjectyes
data.topicsobject[]yes
data.topics[].idstringyes
data.topics[].labelstringyes
data.topics[].sourceTopicIdstring | nullThe catalog topic it was created from, if any.
data.topics[].sortOrderinteger
data.topics[].activeintegeryesLive prompts filed under it.
data.topics[].archivedintegeryesArchived prompts filed under it.
data.unassignedintegeryesLive prompts filed under no topic.
data.maxintegeryesHow many topics an audit may have.
{
"success": true,
"data": {
"topics": [
{
"id": "05a00b07-68bd-4d8d-a29e-cc4359f43f28",
"label": "Pricing",
"sourceTopicId": null,
"sortOrder": 1,
"active": 0,
"archived": 0
}
],
"unassigned": 3,
"max": 100
}
}

POST /audits/{auditId}/topics

Adds an empty topic. An audit may have at most 100.

Terminal window
curl -X POST "https://api.beket.ai/api/v1/audits/AUDIT_ID/topics" \
-H "Authorization: Bearer $BEKET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"label":"<label>"}'
NameInRequiredTypeDescription
auditIdpathyesstringThe audit’s id.
FieldTypeRequiredDescription
labelstringyesThe topic’s name: surrounding and repeated whitespace is collapsed, then it must be 1–80 characters.
FieldTypeRequiredDescription
successbooleanyes
dataAuditTopicyes
{
"success": true,
"data": {
"topic": {
"id": "05a00b07-68bd-4d8d-a29e-cc4359f43f28",
"label": "Pricing"
}
}
}

PATCH /audits/{auditId}/topics/{topicId}

Changes the label. The prompts filed under it stay where they are.

Terminal window
curl -X PATCH "https://api.beket.ai/api/v1/audits/AUDIT_ID/topics/TOPIC_ID" \
-H "Authorization: Bearer $BEKET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"label":"<label>"}'
NameInRequiredTypeDescription
auditIdpathyesstringThe audit’s id.
topicIdpathyesstringThe topic’s id.
FieldTypeRequiredDescription
labelstringyesThe topic’s name: surrounding and repeated whitespace is collapsed, then it must be 1–80 characters.
FieldTypeRequiredDescription
successbooleanyes
dataAuditTopicyes
{
"success": true,
"data": {
"topic": {
"id": "05a00b07-68bd-4d8d-a29e-cc4359f43f28",
"label": "Pricing plans"
}
}
}

DELETE /audits/{auditId}/topics/{topicId}

Deletes a topic that holds no prompts, live or archived. To retire one that does, merge it instead.

Terminal window
curl -X DELETE "https://api.beket.ai/api/v1/audits/AUDIT_ID/topics/TOPIC_ID" \
-H "Authorization: Bearer $BEKET_API_KEY"
NameInRequiredTypeDescription
auditIdpathyesstringThe audit’s id.
topicIdpathyesstringThe topic’s id.

POST /audits/{auditId}/topics/{topicId}/merge

Moves every prompt of this topic into intoTopicId — or into no topic, when it is null — and deletes this one.

Terminal window
curl -X POST "https://api.beket.ai/api/v1/audits/AUDIT_ID/topics/TOPIC_ID/merge" \
-H "Authorization: Bearer $BEKET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"intoTopicId":"<intoTopicId>"}'
NameInRequiredTypeDescription
auditIdpathyesstringThe audit’s id.
topicIdpathyesstringThe topic’s id.
FieldTypeRequiredDescription
intoTopicIdstring | nullyesThe topic that receives the prompts — an id of this audit’s topics — or null to leave them in no topic.
FieldTypeRequiredDescription
successbooleanyes
dataobjectyes
data.topicobject | nullyes
data.topic.idstringyes
data.topic.labelstringyes
data.movedintegeryes
{
"success": true,
"data": {
"topic": null,
"moved": 3
}
}
FieldTypeRequiredDescription
topicobjectyes
topic.idstringyes
topic.labelstringyes