Article Labels

Article labels are only available on the Professional and Enterprise plans.

JSON Format

Labels have the following keys:

Name Type Read-only Mandatory Comment
id integer yes no Automatically assigned when the label is created
url string yes no The API url of this label
name string no yes The actual name of the label
created_at timestamp yes no The time at which the label was created
updated_at timestamp yes no The time at which the label was last updated
Example
{
  "id":         2003,
  "name":       "instructions",
  "created_at": "2012-04-04T09:14:57Z",
  ...
}

List All Labels

  • GET /api/v2/help_center/articles/labels.json
  • GET /api/v2/help_center/{locale}/articles/labels.json

Lists all the labels in the articles in Help Center.

Allowed for
  • Agents
Using curl
curl https://{subdomain}.zendesk.com/api/v2/help_center/{locale}/articles/labels.json \
  -v -u {email_address}:{password}
Example Response
Status: 200 OK

{
  "labels": [
    {
      "id":         2003,
      "name":       "instructions",
      "url":        "https://{subdomain}.zendesk.com/api/v2/help_center/en-us/articles/labels/42.json",
      "created_at": "2012-04-04T09:14:57Z",
      "updated_at": "2012-04-04T09:14:57Z"
    },
    ...
  ]
}

Show Label

GET /api/v2/help_center/articles/labels/{id}.json

Shows the properties of the specified label.

Allowed for
  • Agents
Using curl
curl https://{subdomain}.zendesk.com/api/v2/help_center/{locale}/articles/labels/{id}.json \
  -v -u {email_address}:{password}
Example Response
Status: 200 OK

{
  "label": {
    "id":         2003,
    "name":       "instructions",
    "url":        "https://{subdomain}.zendesk.com/api/v2/help_center/en-us/articles/labels/42.json",
    "created_at": "2012-04-04T09:14:57Z",
    "updated_at": "2012-04-04T09:14:57Z"
  }
}

List Article Labels

GET /api/v2/help_center/articles/{id}/labels.json

Lists all the labels in a given article.

Allowed for
  • Agents
Using curl
curl https://{subdomain}.zendesk.com/api/v2/help_center/{locale}/articles/{id}/labels.json \
  -v -u {email_address}:{password}
Example Response
Status: 200 OK

{
  "labels": [
    {
      "id":         2003,
      "name":       "instructions",
      "url":        "https://{subdomain}.zendesk.com/api/v2/help_center/en-us/articles/labels/42.json",
      "created_at": "2012-04-04T09:14:57Z",
      "updated_at": "2012-04-04T09:14:57Z"
    },
    ...
  ]
}

Create Label

POST /api/v2/help_center/articles/{id}/labels.json

Allowed for
  • Agents
Using curl
curl https://{subdomain}.zendesk.com/api/v2/help_center/articles/{id}/labels.json \
  -d '{"label": {"name": "instructions"}}' \
  -v -u {email_address}:{password} -X POST -H "Content-Type: application/json"
Example Response
Status: 201 Created

{
  "label": {
    "id":         2003,
    "name":       "instructions",
    "url":        "https://{subdomain}.zendesk.com/api/v2/help_center/articles/labels/42.json",
    "created_at": "2012-04-04T09:14:57Z",
    "updated_at": "2012-04-04T09:14:57Z"
  }
}

Delete Label from Article

DELETE /api/v2/help_center/articles/{article_id}/labels/{id}.json

Removes the label from the specified article's list of labels.

Allowed for
  • Agents
Using curl
curl https://{subdomain}.zendesk.com/api/v2/help_center/articles/{article_id}/labels/{id}.json \
  -v -u {email_address}:{password} -X DELETE
Example Response
Status: 204 No Content

Delete Label

DELETE /api/v2/help_center/articles/labels/{id}.json

Removes the label from all articles and deletes it.

Allowed for
  • Agents
Using curl
curl https://{subdomain}.zendesk.com/api/v2/help_center/articles/labels/{id}.json \
  -v -u {email_address}:{password} -X DELETE
Example Response
Status: 204 No Content

Search for Articles by Labels

You can use the List Articles endpoint and filter by label names. Example:

GET /api/v2/help_center/articles.json?label_names=photos,camera

On the Professional and Enterprise plans, you can also use the Search Articles endpoint to search for articles with specific labels. Example:

GET /api/v2/help_center/articles/search.json?label_names=photos,camera