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.
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>"}'
| Name | In | Required | Type | Description |
|---|
auditId | path | yes | string | The audit’s id. |
| Field | Type | Required | Description |
|---|
queryIds | string[] | yes | Prompt ids of this audit. |
topicId | string | null | yes | An id of this audit’s topics, or null to file the prompts under none. |
| Field | Type | Required | Description |
|---|
success | boolean | yes | |
data | object | yes | |
data.updated | integer | yes | |
GET /audits/{auditId}/topics
Every topic with how many prompts it holds, plus the count filed under none.
curl "https://api.beket.ai/api/v1/audits/AUDIT_ID/topics" \
-H "Authorization: Bearer $BEKET_API_KEY"
| Name | In | Required | Type | Description |
|---|
auditId | path | yes | string | The audit’s id. |
| Field | Type | Required | Description |
|---|
success | boolean | yes | |
data | object | yes | |
data.topics | object[] | yes | |
data.topics[].id | string | yes | |
data.topics[].label | string | yes | |
data.topics[].sourceTopicId | string | null | | The catalog topic it was created from, if any. |
data.topics[].sortOrder | integer | | |
data.topics[].active | integer | yes | Live prompts filed under it. |
data.topics[].archived | integer | yes | Archived prompts filed under it. |
data.unassigned | integer | yes | Live prompts filed under no topic. |
data.max | integer | yes | How many topics an audit may have. |
"id": "05a00b07-68bd-4d8d-a29e-cc4359f43f28",
POST /audits/{auditId}/topics
Adds an empty topic. An audit may have at most 100.
curl -X POST "https://api.beket.ai/api/v1/audits/AUDIT_ID/topics" \
-H "Authorization: Bearer $BEKET_API_KEY" \
-H "Content-Type: application/json" \
| Name | In | Required | Type | Description |
|---|
auditId | path | yes | string | The audit’s id. |
| Field | Type | Required | Description |
|---|
label | string | yes | The topic’s name: surrounding and repeated whitespace is collapsed, then it must be 1–80 characters. |
| Field | Type | Required | Description |
|---|
success | boolean | yes | |
data | AuditTopic | yes | |
"id": "05a00b07-68bd-4d8d-a29e-cc4359f43f28",
PATCH /audits/{auditId}/topics/{topicId}
Changes the label. The prompts filed under it stay where they are.
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" \
| Name | In | Required | Type | Description |
|---|
auditId | path | yes | string | The audit’s id. |
topicId | path | yes | string | The topic’s id. |
| Field | Type | Required | Description |
|---|
label | string | yes | The topic’s name: surrounding and repeated whitespace is collapsed, then it must be 1–80 characters. |
| Field | Type | Required | Description |
|---|
success | boolean | yes | |
data | AuditTopic | yes | |
"id": "05a00b07-68bd-4d8d-a29e-cc4359f43f28",
DELETE /audits/{auditId}/topics/{topicId}
Deletes a topic that holds no prompts, live or archived. To retire one that does, merge it instead.
curl -X DELETE "https://api.beket.ai/api/v1/audits/AUDIT_ID/topics/TOPIC_ID" \
-H "Authorization: Bearer $BEKET_API_KEY"
| Name | In | Required | Type | Description |
|---|
auditId | path | yes | string | The audit’s id. |
topicId | path | yes | string | The 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.
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>"}'
| Name | In | Required | Type | Description |
|---|
auditId | path | yes | string | The audit’s id. |
topicId | path | yes | string | The topic’s id. |
| Field | Type | Required | Description |
|---|
intoTopicId | string | null | yes | The topic that receives the prompts — an id of this audit’s topics — or null to leave them in no topic. |
| Field | Type | Required | Description |
|---|
success | boolean | yes | |
data | object | yes | |
data.topic | object | null | yes | |
data.topic.id | string | yes | |
data.topic.label | string | yes | |
data.moved | integer | yes | |
| Field | Type | Required | Description |
|---|
topic | object | yes | |
topic.id | string | yes | |
topic.label | string | yes | |