Users can provide feedback in the knowledge base by adding comments to articles. The user must have a Zendesk account and their requests must be authenticated. Anonymous users can't add comments. For more information, see Anatomy of the help center.

JSON format

Article Comments are represented as JSON objects with the following properties:

Name Type Read-only Mandatory Description
author_id integer false false The id of the author of this comment. Writable on create by Help Center managers. See Create Comment
body string false true The comment made by the author. See User content
created_at string false false The time the comment was created. Writable on create by Help Center managers. See Create Comment
html_url string true false The url at which the comment is presented in Help Center
id integer true false Automatically assigned when the comment is created
locale string false true The locale in which this comment was made
non_author_editor_id integer true false The user id of whoever performed the most recent (if any) non-author edit. A non-author edit consists of an edit make by a user other than the author that creates or updates the body or author_id. Note that only edits made after May 17, 2021 will be reflected in this field. If no non-author edits have occured since May 17, 2021, then this field will be null.
non_author_updated_at string true false When the comment was last edited by a non-author user
source_id integer true false The id of the item on which this comment was made
source_type string true false The type of the item on which this comment was made. Currently only supports 'Article'
updated_at string true false The time at which the comment was last updated
url string true false The API url of this comment
vote_count integer true false The total number of upvotes and downvotes
vote_sum integer true false The sum of upvotes (+1) and downvotes (-1), which may be positive or negative

User content

End users can add their own contents in the form of community posts, post comments, or article comments. Collectively, this is called user content. The format of user content is HTML-based.

Content may contain the following standard HTML tags:

  • Paragraphs and blocks: <p>, <div>, <span>, <br>
  • Text formatting: <b>, <i>, <u>, <strong>, <em>, <sub>, <sup>
  • Links and dividers: <a>, <hr>
  • Images: <img> (where the src attribute has to reference a user-uploaded image)
  • Headers: <h1>, <h2>, <h3>, <h4>, <h5>, <h6>
  • Bullet lists: <ul>, <ol>, <li>
  • Description lists: <dl>, <dt>, <dd>
  • Tables: <table>, <thead>, <tbody>, <tfoot>, <tr>, <th>, <td>, <colgroup>, <col>
  • Quotes and code snippets: <blockquote>, <pre>
  • Semantics: <abbr>, <acronym>, <cite>, <code>, <tt>, <samp>, <kbd>, <var>, <dfn>, <address>

In addition, the content may contain these non-standard HTML tags:

  • @mentions: <x-zendesk-user>, where the contents of the tag should be the user ID of the mentioned user. Example: <x-zendesk-user>1234</x-zendesk-user> to mention the user whose ID is 1234.

Even if the content is validated, the body that's output may not be identical to the request body. For example, adjustments may be made for security or standards-compliance reasons.

Example

{  "author_id": 3465,  "body": "Thanks for your help!",  "created_at": "2012-04-04T09:14:57Z",  "id": 1635,  "locale": "en-us",  "source_id": 65466,  "source_type": "Article"}

List Comments

  • GET /api/v2/help_center/{locale}/articles/{article_id}/comments
  • GET /api/v2/help_center/users/{user_id}/comments
  • GET /api/v2/help_center/articles/{article_id}/comments

Lists the comments created by a specific user, or all comments made by all users on a specific article.

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

Allowed for

  • Agents
  • End-users

End-users can only list their own comments. If listing comments by user, they must specify me as the id.

Pagination

  • Cursor pagination (recommended)
  • Offset pagination

See Pagination.

Sideloads

The following sideloads are supported:

Name Will sideload
users authors
articles articles

Parameters

Name Type In Required Description
article_id integer Path true The unique ID of the article
locale string Path true The locale the item is displayed in

Code Samples

curl
curl https://{subdomain}.zendesk.com/api/v2/help_center/users/{user_id}/comments.json \  -v -u {email_address}:{password}
Go
import (	"fmt"	"io"	"net/http")
func main() {	url := "https://support.zendesk.com/api/v2/help_center/en-us/articles/360026053753/comments"	method := "GET"	req, err := http.NewRequest(method, url, nil)
	if err != nil {		fmt.Println(err)		return	}	req.Header.Add("Content-Type", "application/json")	req.Header.Add("Authorization", "Basic <auth-value>") // Base64 encoded "username:password"
	client := &http.Client {}	res, err := client.Do(req)	if err != nil {		fmt.Println(err)		return	}	defer res.Body.Close()
	body, err := io.ReadAll(res.Body)	if err != nil {		fmt.Println(err)		return	}	fmt.Println(string(body))}
Java
import com.squareup.okhttp.*;OkHttpClient client = new OkHttpClient();HttpUrl.Builder urlBuilder = HttpUrl.parse("https://support.zendesk.com/api/v2/help_center/en-us/articles/360026053753/comments")		.newBuilder();
Request request = new Request.Builder()		.url(urlBuilder.build())		.method("GET", null)		.addHeader("Content-Type", "application/json")		.addHeader("Authorization", Credentials.basic("your-email", "your-password"))		.build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');
var config = {  method: 'GET',  url: 'https://support.zendesk.com/api/v2/help_center/en-us/articles/360026053753/comments',  headers: {	'Content-Type': 'application/json',	'Authorization': 'Basic <auth-value>', // Base64 encoded "username:password"  },};
axios(config).then(function (response) {  console.log(JSON.stringify(response.data));}).catch(function (error) {  console.log(error);});
Python
import requests
url = "https://support.zendesk.com/api/v2/help_center/en-us/articles/360026053753/comments"headers = {	"Content-Type": "application/json",}
response = requests.request(	"GET",	url,	auth=('<username>', '<password>'),	headers=headers)
print(response.text)
Ruby
require "net/http"uri = URI("https://support.zendesk.com/api/v2/help_center/en-us/articles/360026053753/comments")request = Net::HTTP::Get.new(uri, "Content-Type": "application/json")request.basic_auth "username", "password"response = Net::HTTP.start uri.hostname, uri.port, use_ssl: true do |http|	http.request(request)end

Example response(s)

200 OK
// Status 200 OK
{  "comments": [    {      "author_id": 89567,      "body": "My printer is on fire",      "id": 35467,      "locale": "en"    },    {      "author_id": 89589,      "body": "My printer is on fire too!",      "id": 36221,      "locale": "en"    }  ]}

Show Comment

  • GET /api/v2/help_center/{locale}/articles/{article_id}/comments/{comment_id}
  • GET /api/v2/help_center/articles/{article_id}/comments/{comment_id}

Shows the properties of the specified comment.

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

Allowed for

  • Agents
  • End-users
  • Anonymous users

Parameters

Name Type In Required Description
article_id integer Path true The unique ID of the article
comment_id integer Path true The unique ID of the comment
locale string Path true The locale the item is displayed in

Code Samples

curl
curl https://{subdomain}.zendesk.com/api/v2/help_center/{locale}/articles/{article_id}/comments/{comment_id}.json \-v -u {email_address}:{password}
Go
import (	"fmt"	"io"	"net/http")
func main() {	url := "https://support.zendesk.com/api/v2/help_center/en-us/articles/360026053753/comments/360004163994"	method := "GET"	req, err := http.NewRequest(method, url, nil)
	if err != nil {		fmt.Println(err)		return	}	req.Header.Add("Content-Type", "application/json")	req.Header.Add("Authorization", "Basic <auth-value>") // Base64 encoded "username:password"
	client := &http.Client {}	res, err := client.Do(req)	if err != nil {		fmt.Println(err)		return	}	defer res.Body.Close()
	body, err := io.ReadAll(res.Body)	if err != nil {		fmt.Println(err)		return	}	fmt.Println(string(body))}
Java
import com.squareup.okhttp.*;OkHttpClient client = new OkHttpClient();HttpUrl.Builder urlBuilder = HttpUrl.parse("https://support.zendesk.com/api/v2/help_center/en-us/articles/360026053753/comments/360004163994")		.newBuilder();
Request request = new Request.Builder()		.url(urlBuilder.build())		.method("GET", null)		.addHeader("Content-Type", "application/json")		.addHeader("Authorization", Credentials.basic("your-email", "your-password"))		.build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');
var config = {  method: 'GET',  url: 'https://support.zendesk.com/api/v2/help_center/en-us/articles/360026053753/comments/360004163994',  headers: {	'Content-Type': 'application/json',	'Authorization': 'Basic <auth-value>', // Base64 encoded "username:password"  },};
axios(config).then(function (response) {  console.log(JSON.stringify(response.data));}).catch(function (error) {  console.log(error);});
Python
import requests
url = "https://support.zendesk.com/api/v2/help_center/en-us/articles/360026053753/comments/360004163994"headers = {	"Content-Type": "application/json",}
response = requests.request(	"GET",	url,	auth=('<username>', '<password>'),	headers=headers)
print(response.text)
Ruby
require "net/http"uri = URI("https://support.zendesk.com/api/v2/help_center/en-us/articles/360026053753/comments/360004163994")request = Net::HTTP::Get.new(uri, "Content-Type": "application/json")request.basic_auth "username", "password"response = Net::HTTP.start uri.hostname, uri.port, use_ssl: true do |http|	http.request(request)end

Example response(s)

200 OK
// Status 200 OK
{  "comment": {    "author_id": 89567,    "body": "Good info!",    "id": 35467,    "locale": "en"  }}

Create Comment

  • POST /api/v2/help_center/{locale}/articles/{article_id}/comments
  • POST /api/v2/help_center/articles/{article_id}/comments

Adds a comment to the specified article. Because comments are associated with a specific article translation, or locale, you must specify a locale.

Allowed for

  • End users

Agents with the Help Center manager role can optionally supply a created_at as part of the comment object. If not provided, created_at is set to the current time.

Supplying a notify_subscribers property with a value of false will prevent subscribers to the comment's article from receiving a comment creation email notification. This can be helpful when creating many comments at a time. Specify the property in the root of the JSON object, not in the "comment" object.

Parameters

Name Type In Required Description
article_id integer Path true The unique ID of the article
locale string Path true The locale the item is displayed in

Code Samples

curl
curl https://{subdomain}.zendesk.com/api/v2/help_center/articles/{article_id}/comments.json \  -d '{"comment": {"body": "Good info!", "locale": "en-us"}, "notify_subscribers": false}'  -v -u {email_address}:{password} -X POST -H "Content-Type: application/json"
Go
import (	"fmt"	"io"	"net/http")
func main() {	url := "https://support.zendesk.com/api/v2/help_center/en-us/articles/360026053753/comments"	method := "POST"	req, err := http.NewRequest(method, url, nil)
	if err != nil {		fmt.Println(err)		return	}	req.Header.Add("Content-Type", "application/json")	req.Header.Add("Authorization", "Basic <auth-value>") // Base64 encoded "username:password"
	client := &http.Client {}	res, err := client.Do(req)	if err != nil {		fmt.Println(err)		return	}	defer res.Body.Close()
	body, err := io.ReadAll(res.Body)	if err != nil {		fmt.Println(err)		return	}	fmt.Println(string(body))}
Java
import com.squareup.okhttp.*;OkHttpClient client = new OkHttpClient();HttpUrl.Builder urlBuilder = HttpUrl.parse("https://support.zendesk.com/api/v2/help_center/en-us/articles/360026053753/comments")		.newBuilder();RequestBody body = RequestBody.create(MediaType.parse("application/json"),		"""""");
Request request = new Request.Builder()		.url(urlBuilder.build())		.method("POST", body)		.addHeader("Content-Type", "application/json")		.addHeader("Authorization", Credentials.basic("your-email", "your-password"))		.build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');
var config = {  method: 'POST',  url: 'https://support.zendesk.com/api/v2/help_center/en-us/articles/360026053753/comments',  headers: {	'Content-Type': 'application/json',	'Authorization': 'Basic <auth-value>', // Base64 encoded "username:password"  },};
axios(config).then(function (response) {  console.log(JSON.stringify(response.data));}).catch(function (error) {  console.log(error);});
Python
import requests
url = "https://support.zendesk.com/api/v2/help_center/en-us/articles/360026053753/comments"headers = {	"Content-Type": "application/json",}
response = requests.request(	"POST",	url,	auth=('<username>', '<password>'),	headers=headers)
print(response.text)
Ruby
require "net/http"uri = URI("https://support.zendesk.com/api/v2/help_center/en-us/articles/360026053753/comments")request = Net::HTTP::Post.new(uri, "Content-Type": "application/json")request.basic_auth "username", "password"response = Net::HTTP.start uri.hostname, uri.port, use_ssl: true do |http|	http.request(request)end

Example response(s)

200 OK
// Status 200 OK
{  "comment": {    "author_id": 89567,    "body": "Good info!",    "id": 35467,    "locale": "en"  }}

Update Comment

  • PUT /api/v2/help_center/{locale}/articles/{article_id}/comments/{comment_id}
  • PUT /api/v2/help_center/articles/{article_id}/comments/{comment_id}

Allowed for

  • Agents
  • The end user who created the comment

Parameters

Name Type In Required Description
article_id integer Path true The unique ID of the article
comment_id integer Path true The unique ID of the comment
locale string Path true The locale the item is displayed in

Code Samples

Curl
curl --request PUT https://support.zendesk.com/api/v2/help_center/en-us/articles/360026053753/comments/360004163994 \--header "Content-Type: application/json" \-u username:password
curl https://{subdomain}.zendesk.com/api/v2/help_center/articles/{article_id}/comments/{comment_id}.json \  -d '{"comment": {"body": "Did not work"}}' \  -v -u {email_address}:{password} -X PUT -H "Content-Type: application/json"
Go
import (	"fmt"	"io"	"net/http")
func main() {	url := "https://support.zendesk.com/api/v2/help_center/en-us/articles/360026053753/comments/360004163994"	method := "PUT"	req, err := http.NewRequest(method, url, nil)
	if err != nil {		fmt.Println(err)		return	}	req.Header.Add("Content-Type", "application/json")	req.Header.Add("Authorization", "Basic <auth-value>") // Base64 encoded "username:password"
	client := &http.Client {}	res, err := client.Do(req)	if err != nil {		fmt.Println(err)		return	}	defer res.Body.Close()
	body, err := io.ReadAll(res.Body)	if err != nil {		fmt.Println(err)		return	}	fmt.Println(string(body))}
Java
import com.squareup.okhttp.*;OkHttpClient client = new OkHttpClient();HttpUrl.Builder urlBuilder = HttpUrl.parse("https://support.zendesk.com/api/v2/help_center/en-us/articles/360026053753/comments/360004163994")		.newBuilder();RequestBody body = RequestBody.create(MediaType.parse("application/json"),		"""""");
Request request = new Request.Builder()		.url(urlBuilder.build())		.method("PUT", body)		.addHeader("Content-Type", "application/json")		.addHeader("Authorization", Credentials.basic("your-email", "your-password"))		.build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');
var config = {  method: 'PUT',  url: 'https://support.zendesk.com/api/v2/help_center/en-us/articles/360026053753/comments/360004163994',  headers: {	'Content-Type': 'application/json',	'Authorization': 'Basic <auth-value>', // Base64 encoded "username:password"  },};
axios(config).then(function (response) {  console.log(JSON.stringify(response.data));}).catch(function (error) {  console.log(error);});
Python
import requests
url = "https://support.zendesk.com/api/v2/help_center/en-us/articles/360026053753/comments/360004163994"headers = {	"Content-Type": "application/json",}
response = requests.request(	"PUT",	url,	auth=('<username>', '<password>'),	headers=headers)
print(response.text)
Ruby
require "net/http"uri = URI("https://support.zendesk.com/api/v2/help_center/en-us/articles/360026053753/comments/360004163994")request = Net::HTTP::Put.new(uri, "Content-Type": "application/json")request.basic_auth "username", "password"response = Net::HTTP.start uri.hostname, uri.port, use_ssl: true do |http|	http.request(request)end

Example response(s)

200 OK
// Status 200 OK
{  "comment": {    "author_id": 89567,    "body": "Good info!",    "id": 35467,    "locale": "en"  }}

Delete Comment

  • DELETE /api/v2/help_center/{locale}/articles/{article_id}/comments/{comment_id}
  • DELETE /api/v2/help_center/articles/{article_id}/comments/{comment_id}

Allowed for

  • Agents
  • The end user who created the comment

Parameters

Name Type In Required Description
article_id integer Path true The unique ID of the article
comment_id integer Path true The unique ID of the comment
locale string Path true The locale the item is displayed in

Code Samples

Curl
curl --request DELETE https://support.zendesk.com/api/v2/help_center/en-us/articles/360026053753/comments/360004163994 \--header "Content-Type: application/json" \-u username:password
curl https://{subdomain}.zendesk.com/api/v2/help_center/articles/{article_id}/comments/{comment_id}.json \  -v -u {email_address}:{password} -X DELETE
Go
import (	"fmt"	"io"	"net/http")
func main() {	url := "https://support.zendesk.com/api/v2/help_center/en-us/articles/360026053753/comments/360004163994"	method := "DELETE"	req, err := http.NewRequest(method, url, nil)
	if err != nil {		fmt.Println(err)		return	}	req.Header.Add("Content-Type", "application/json")	req.Header.Add("Authorization", "Basic <auth-value>") // Base64 encoded "username:password"
	client := &http.Client {}	res, err := client.Do(req)	if err != nil {		fmt.Println(err)		return	}	defer res.Body.Close()
	body, err := io.ReadAll(res.Body)	if err != nil {		fmt.Println(err)		return	}	fmt.Println(string(body))}
Java
import com.squareup.okhttp.*;OkHttpClient client = new OkHttpClient();HttpUrl.Builder urlBuilder = HttpUrl.parse("https://support.zendesk.com/api/v2/help_center/en-us/articles/360026053753/comments/360004163994")		.newBuilder();
Request request = new Request.Builder()		.url(urlBuilder.build())		.method("DELETE", null)		.addHeader("Content-Type", "application/json")		.addHeader("Authorization", Credentials.basic("your-email", "your-password"))		.build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');
var config = {  method: 'DELETE',  url: 'https://support.zendesk.com/api/v2/help_center/en-us/articles/360026053753/comments/360004163994',  headers: {	'Content-Type': 'application/json',	'Authorization': 'Basic <auth-value>', // Base64 encoded "username:password"  },};
axios(config).then(function (response) {  console.log(JSON.stringify(response.data));}).catch(function (error) {  console.log(error);});
Python
import requests
url = "https://support.zendesk.com/api/v2/help_center/en-us/articles/360026053753/comments/360004163994"headers = {	"Content-Type": "application/json",}
response = requests.request(	"DELETE",	url,	auth=('<username>', '<password>'),	headers=headers)
print(response.text)
Ruby
require "net/http"uri = URI("https://support.zendesk.com/api/v2/help_center/en-us/articles/360026053753/comments/360004163994")request = Net::HTTP::Delete.new(uri, "Content-Type": "application/json")request.basic_auth "username", "password"response = Net::HTTP.start uri.hostname, uri.port, use_ssl: true do |http|	http.request(request)end

Example response(s)

204 No Content
// Status 204 No Content
null