Delete a Question Category
Permanently delete a category. Deleting a top-level category also removes all its direct children. Deleting a child preserves its parent and siblings.
To retain a child category’s historical matches, set enabled to false on that child. Deleting the last child leaves its parent in place.
Request Method
DELETE
Request URL
https://api-sg.gptbots.ai/v1/question-categories/delete
Authentication
Use the API key for the Agent. The project plan must include API integration and issue recognition. Use the endpoint for your organization's data center. API Overview
Request Frequency
Requests share the project's per-minute Analytics API quota. Exceeding it returns 40008.
Request
Request Example
curl -X DELETE "https://api-sg.gptbots.ai/v1/question-categories/delete?id=66a1b2c3d4e5f60001000002" \
-H "Authorization: Bearer your_apikey"
Request Headers
| Field | Type | Description |
|---|---|---|
| Authorization | string | Bearer your_apikey |
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | Category ID |
Response
Response Example
{
"id": "66a1b2c3d4e5f60001000002",
"deleted": true
}
Successful Response
| Field | Type | Description |
|---|---|---|
| id | string | Category ID |
| deleted | boolean | Whether the category was deleted |
Historical results show current names. Deleting a category removes its match from historical results. Set enabled to false to preserve those matches.
Failed Response
| Field | Type | Description |
|---|---|---|
| code | int | Error code. |
| message | string | Error description information. |
Error Codes
| Code | Message |
|---|---|
| 40000 | Invalid parameters |
| 40008 | Analytics API rate limit exceeded |
| 40100 | The Agent does not have access to the resource |
| 40101 | Missing Authorization header |
| 40127 | Invalid Agent API key |
| 20055 | API access is disabled for the Agent |
| 40353 | Plan lacks required features |
| 50000 | Internal server error |
