Categories are represented as simple flat JSON objects which have the following keys:
| Name | Type | Read-only | Mandatory | Comment |
|---|---|---|---|---|
| id | integer | yes | no | Automatically assigned during creation |
| url | string | yes | no | The API url of this category |
| name | string | no | yes | The name of the category |
| description | string | no | no | The description of the category |
| position | integer | no | no | The position of this category relative to other categories |
| created_at | date | yes | no | The time the category was created |
| updated_at | date | yes | no | The time of the last update of the category |
{
"id": 35436,
"url": "https://company.zendesk.com/api/v2/categories/35436.json",
"name": "Self Help Articles",
"description": null,
"position": 21,
"created_at": "2009-07-20T22:55:29Z",
"updated_at": "2011-05-05T10:38:52Z"
}
GET /api/v2/categories.json
Accounts that have forum categories
curl https://{subdomain}.zendesk.com/api/v2/categories.json \
-v -u {email_address}:{password}
Status: 200 OK
{
"categories": [
{
"id": 35436,
"name": "Self Help Articles",
"description": null,
"position": 21,
"created_at": "2009-07-20T22:55:29Z",
"updated_at": "2011-05-05T10:38:52Z"
},
{
"id": 12,
"name": "News",
"description": "Announcements about routine maintenance, scheduled downtime, and new features.",
"position": 28,
"created_at": "2011-07-20T04:31:29Z",
"updated_at": "2012-02-02T10:32:59Z"
}
]
}
GET /api/v2/categories/{id}.json
curl https://{subdomain}.zendesk.com/api/v2/categories/{id}.json \
-v -u {email_address}:{password}
Status: 200 OK
{
"category": {
"id": 12,
"name": "News",
"description": "Announcements about routine maintenance, scheduled downtime, and new features.",
"position": 28,
"created_at": "2011-07-20T04:31:29Z",
"updated_at": "2012-02-02T10:32:59Z"
}
}
POST /api/v2/categories.json
curl https://{subdomain}.zendesk.com/api/v2/categories.json \
-H "Content-Type: application/json" -d '{"category": {"name": "My Category"}}' \
-v -u {email_address}:{password} -X POST
Status: 201 Created
Location: https://{subdomain}.zendesk.com/api/v2/categories/{id}.json
{
"category": {
"id": 14215,
"name": "My Category",
"description": null,
"position": 9999,
"created_at": "2012-02-02T04:31:29Z",
"updated_at": "2012-02-02T04:31:29Z"
}
}
PUT /api/v2/category/{id}.json
curl https://{subdomain}.zendesk.com/api/v2/categories/{id}.json \
-H "Content-Type: application/json" -d '{"category": {"name": "The Category About Nothing"}}' \
-v -u {email_address}:{password} -X PUT
Status: 200 OK
{
"category": {
"id": 14215,
"name": "The Category About Nothing",
"description": null,
"position": 9999,
"created_at": "2012-02-02T04:31:29Z",
"updated_at": "2012-03-10T14:51:08Z"
}
}
DELETE /api/v2/categories/{id}.json
curl https://{subdomain}.zendesk.com/api/v2/categories/{id} \
-v -u {email_address}:{password} -X DELETE
Status: 200 OK