List Question Categories
List Question Categories
List top-level categories with their direct children, including disabled categories. Pagination applies to the top level.
A child category’s enabled setting controls whether it participates in automatic matching for new questions. Disabling it keeps it in the directory with enabled: false and preserves existing matches on past questions.
Request Method
GET
Request URL
https://api-sg.gptbots.ai/v1/question-categories
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 GET "https://api-sg.gptbots.ai/v1/question-categories?page=1&page_size=20" \
-H "Authorization: Bearer your_apikey"
curl -X GET "https://api-sg.gptbots.ai/v1/question-categories?page=1&page_size=20" \
-H "Authorization: Bearer your_apikey"
This code block in the floating window
Request Headers
| Field | Type | Description |
|---|---|---|
| Authorization | string | Bearer your_apikey |
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| page | int | No | Page number, starting at 1. Default 1. |
| page_size | int | No | Page size from 1 to 100. Default 20. |
Response
Response Example
{
"total": 1,
"page": 1,
"page_size": 20,
"items": [
{
"id": "66a1b2c3d4e5f60001000001",
"name": "After-sales support",
"level": 1,
"parent_id": null,
"enabled": true,
"children": [
{
"id": "66a1b2c3d4e5f60001000002",
"name": "Refund status",
"level": 2,
"parent_id": "66a1b2c3d4e5f60001000001",
"enabled": true,
"description": "Questions about when a refund will arrive",
"children": []
}
]
}
]
}
{
"total": 1,
"page": 1,
"page_size": 20,
"items": [
{
"id": "66a1b2c3d4e5f60001000001",
"name": "After-sales support",
"level": 1,
"parent_id": null,
"enabled": true,
"children": [
{
"id": "66a1b2c3d4e5f60001000002",
"name": "Refund status",
"level": 2,
"parent_id": "66a1b2c3d4e5f60001000001",
"enabled": true,
"description": "Questions about when a refund will arrive",
"children": []
}
]
}
]
}
This code block in the floating window
Successful Response
| Field | Type | Description |
|---|---|---|
| total | long | Total top-level categories |
| page | int | Page number, starting at 1. Default 1. |
| page_size | int | Page size from 1 to 100. Default 20. |
| items | array | Records on this page |
| id | string | Category ID |
| name | string | Category name |
| level | int | Level: 1 for a top-level category, 2 for a child. |
| parent_id | string / null | Parent ID; null at the top level. |
| enabled | boolean | Whether the category is enabled |
| description | string / null | Description for a child only, up to 100 characters. Omit for a top-level category. |
| children | array | Direct children. Empty for a leaf. |
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 |
