Sections contain related articles. See Organizing knowledge base content in categories and sections in Zendesk help.

JSON Format

Sections are represented as JSON objects with the following properties:

Name Type Read-only Mandatory Description
category_id integer false false The id of the category to which this section belongs
created_at string true false The time at which the section was created
description string false false The description of the section
html_url string true false The url of this section in HC
id integer true false Automatically assigned when creating subscriptions
locale string false true The locale in which the section is displayed
name string false true The name of the section
outdated boolean true false Whether the section is out of date
parent_section_id integer false false The id of the section to which this section belongs. Only writable for Guide Enterprise customers
position integer false false The position of this section in the section list. Used when sorting is set to ┬┤manual┬┤. By default the section is added to the end of the list
source_locale string true false The source (default) locale of the section
theme_template string false false The theme template name used to display this section in Help Center.
updated_at string true false The time at which the section was last updated
url string true false The API url of this section

Example

{  "category_id": 3465,  "description": "This section contains tricks for the airborne",  "id": 1635,  "locale": "en-us",  "name": "Avionics"}

List Sections

  • GET /api/v2/help_center{/locale}/sections
  • GET /api/v2/help_center/{locale}/categories/{category_id}/sections

Lists all the sections in Help Center or in a specific category.

The {locale} is required only for end users and anomynous users. Admins and agents can omit it.

Allowed for

  • Agents
  • End users
  • Anonymous users

The response will list only the sections that the requesting agent, end-user, or anonymous user can view in Help Center.

Sorting

You can sort the results with the sort_by and sort_order query string parameters.

GET /api/v2/help_center/en-us/sections.json?sort_by=updated_at&sort_order=asc

The sort_by parameter can have one of the following values:

value description
position order set manually using the Arrange Content page. Default order
created_at order by creation time
updated_at order by update time

The sort_order parameter can have one of the following values:

value description
asc ascending order
desc descending order

Sideloads

The following sideloads are supported:

Name Will sideload
categories the category
translations the section and category translations, if any

Unlike other sideloads, translations are embedded within the section because they're not shared between resources. Category translations are only sideloaded if categories are.

Parameters

Name Type In Required Description
sort_by string Query false Sorts the results by one of the accepted values. Allowed values are "position", "created_at", or "updated_at".
sort_order string Query false Selects the order of the results. Allowed values are "asc", or "desc".
locale string Path false The locale the item is displayed in

Using curl

curl https://{subdomain}.zendesk.com/api/v2/help_center/{locale}/sections.json \-v -u {email_address}:{password}

Example Response(s)

200 OK
Status 200 OK
{  "sections": [    {      "category_id": 888887,      "description": "This section contains articles on flight instruments",      "id": 35467,      "locale": "en-us",      "name": "Avionics"    },    {      "category_id": 887285,      "description": "This section contains weather resources for pilots",      "id": 36169,      "locale": "en-us",      "name": "Weather"    }  ]}

Show Section

  • GET /api/v2/help_center{/locale}/sections/{section_id}

Note: {/locale} is an optional parameter for admins and agents. End users and anonymous users must provide the parameter.

Allowed for

  • Agents
  • End users
  • Anonymous users

Sideloads

The following sideloads are supported:

Name Will sideload
categories the category
translations the section and category translations, if any

Unlike other sideloads, translations are embedded within the section since they're not shared between resources. Category translations are only sideloaded if categories are.

Parameters

Name Type In Required Description
locale string Path false The locale the item is displayed in
section_id integer Path true The unique ID of the section

Using curl

curl https://{subdomain}.zendesk.com/api/v2/help_center/{locale}/sections/{section_id}.json \  -v -u {email_address}:{password}

Example Response(s)

200 OK
Status 200 OK
{  "section": {    "description": "This section contains articles on flight instruments",    "id": 3457836,    "locale": "en-us",    "name": "Avionics",    "position": 2  }}

Create Section

  • POST /api/v2/help_center{/locale}/categories/{category_id}/sections

Creates a section in a given category. You must specify a section name and locale. The locale can be omitted if it's specified in the URL. Optionally, you can specify multiple translations for the section. The specified locales must be enabled for the current Help Center.

Allowed for

  • Agents

Parameters

Name Type In Required Description
category_id integer Path true The unique ID of the category
locale string Path false The locale the item is displayed in

Using curl

curl https://{subdomain}.zendesk.com/api/v2/help_center/categories/{category_id}/sections.json \  -d '{"section": {"position": 2, "locale": "en-us", "name": "Avionics", \    "description": "This section contains articles on flight instruments"}}' \  -v -u {email_address}:{password} -X POST -H "Content-Type: application/json"
# You can also specify multiple translations for the new section:
curl https://{subdomain}.zendesk.com/api/v2/help_center/categories/{category_id}/sections.json \  -d '{"section": {"position": 2, "translations":  \    [{"locale": "en-us", "title": "Avionics", \    "body": "This section contains articles on flight instruments"}, \    {"locale": "fr", "title": "Avionique", \    "body": "Cette section contient des articles sur les instruments de vol"}]}}' \  -v -u {email_address}:{password} -X POST -H "Content-Type: application/json"

Example Response(s)

201 Created
Status 201 Created
{  "section": {    "description": "This section contains articles on flight instruments",    "id": 3457836,    "locale": "en-us",    "name": "Avionics",    "position": 2  }}
400 Bad Request
Status 400 Bad Request
{  "errors": {    "parent_section_id": [      "cannot be assigned non-null value on this Guide plan"    ]  }}

Update Section

  • PUT /api/v2/help_center{/locale}/sections/{section_id}

Update section. This endpoint updates section-level data, specifically:

  • name (in the source locale)
  • description (in the source locale)
  • position
  • sorting
  • category_id
  • parent_section_id
  • theme_template

To update non-source section translations, see Translations.

Allowed for

  • Help Center managers

Parameters

Name Type In Required Description
locale string Path false The locale the item is displayed in
section_id integer Path true The unique ID of the section

Example Body

{  "section": {    "position": 3  }}

Using curl

curl https://{subdomain}.zendesk.com/api/v2/help_center/sections/{section_id}.json \-d '{"section": {"position": 42}}' \-v -u {email_address}:{password} -X PUT -H "Content-Type: application/json"

Example Response(s)

200 OK
Status 200 OK
{  "section": {    "description": "This section contains articles on flight instruments",    "id": 3457836,    "locale": "en-us",    "name": "Avionics",    "position": 2  }}
400 Bad Request
Status 400 Bad Request
{  "errors": {    "parent_section_id": [      "would result in a cycle"    ]  }}

Update Section Source Locale

  • PUT /api/v2/help_center{/locale}/sections/{section_id}/source_locale

This endpoint lets you set a section's source language to something other than the default language of your Help Center. For example, if the default language of your Help Center is English but your KB has a section only for Japanese customers, you can set the section's source locale to 'ja'.

Allowed for

  • Help Center managers

Parameters

Name Type In Required Description
locale string Path false The locale the item is displayed in
section_id integer Path true The unique ID of the section

Using curl

curl https://{subdomain}.zendesk.com/api/v2/help_center/sections/{section_id}/source_locale.json \-d '{"section_locale": "fr"}' -v -u {email_address}:{password} -X PUT \-H "Content-Type: application/json"

Example Response(s)

200 OK
Status 200 OK

Delete Section

  • DELETE /api/v2/help_center{/locale}/sections/{section_id}

WARNING: All articles in the section will also be deleted.

Allowed for

  • Help Center managers

Parameters

Name Type In Required Description
locale string Path false The locale the item is displayed in
section_id integer Path true The unique ID of the section

Using curl

curl https://{subdomain}.zendesk.com/api/v2/help_center/sections/{section_id}.json \  -v -u {email_address}:{password} -X DELETE

Example Response(s)

204 No Content
Status 204 No Content