Comment
A comment is a reader's response to an article in a blog. Comments appear on the article page in reverse chronological order, typically after the article body. Just as a blog can have any number of articles, an article can have any number of comments.

Article comments are a target for spammers, so Shopify blogs use a spam detection system to identify comments that are likely to be spam. Shop owners can also can mark comments as spam or not spam. Comments that are marked as spam are removed from the Shopify admin and don't appear in the blog.
What you can do with Comment
The Shopify API lets you do the following with the Comment resource. More detailed versions of these general actions may be available:
- GET /admin/api/2020-01/comments.json?article_id=134645308&blog_id=241253187 Retrieves a list of comments
- GET /admin/api/2020-01/comments/count.json?article_id=134645308&blog_id=241253187 Retrieves a count of comments
- GET /admin/api/2020-01/comments/{comment_id}.json Retrieves a single comment by its ID
- POST /admin/api/2020-01/comments.json Creates a comment for an article
- PUT /admin/api/2020-01/comments/{comment_id}.json Updates a comment of an article
- POST /admin/api/2020-01/comments/{comment_id}/spam.json Marks a comment as spam
- POST /admin/api/2020-01/comments/{comment_id}/not_spam.json Marks a comment as not spam
- POST /admin/api/2020-01/comments/{comment_id}/approve.json Approves a comment
- POST /admin/api/2020-01/comments/{comment_id}/remove.json Removes a comment
- POST /admin/api/2020-01/comments/{comment_id}/restore.json Restores a previously removed comment
Comment properties
article_id |
A unique numeric identifier for the article that the comment belongs to. |
author |
The name of the author of the comment. |
blog_id |
A unique numeric identifier for the blog containing the article that the comment belongs to. |
body |
The basic Textile markup of a comment. |
body_html |
The text of the comment, complete with HTML markup. |
created_at
read-only |
The date and time (ISO 8601 format) when the comment was created. |
The email address of the author of the comment. |
|
id
read-only |
A unique numeric identifier for the comment. |
ip |
The IP address from which the comment was posted. |
published_at |
The date and time (ISO 8601 format) when the comment was published. |
status
read-only |
The status of the comment. Valid values:
|
updated_at
read-only |
The date and time (ISO 8601 format) when the comment was last modified. When the comment is created, this matches the value of |
user_agent |
The user agent string provided by the software used to create the comment (usually a browser). |
Endpoints
page
parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints.
limit
|
The maximum number of results to retrieve. (default:50 , maximum: 250 )
|
since_id
|
Restrict results to after the specified ID. |
created_at_min
|
Show comments created after date (format: 2014-04-25T16:15:47-04:00). |
created_at_max
|
Show comments created before date (format: 2014-04-25T16:15:47-04:00). |
updated_at_min
|
Show comments last updated after date (format: 2014-04-25T16:15:47-04:00). |
updated_at_max
|
Show comments last updated before date (format: 2014-04-25T16:15:47-04:00). |
published_at_min
|
Show comments published after date (format: 2014-04-25T16:15:47-04:00). |
published_at_max
|
Show comments published before date (format: 2014-04-25T16:15:47-04:00). |
fields
|
Show only certain fields, specified by a comma-separated list of field names. |
published_status
|
Filter results by their published status. (default:any )
|
status
|
Filter results by their status.
|
Retrieve all the comments for a certain article of a blog
GET /admin/api/2020-01/comments.json?article_id=134645308&blog_id=241253187
View Response
HTTP/1.1 200 OK
{
"comments": [
{
"id": 653537639,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "unapproved",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:22:39-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": null
},
{
"id": 118373535,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "published",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:22:39-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": null
}
]
}
Retrieve all the comments for all the articles of a blog
GET /admin/api/2020-01/comments.json?blog_id=241253187
View Response
HTTP/1.1 200 OK
{
"comments": [
{
"id": 653537639,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "unapproved",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:22:39-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": null
},
{
"id": 118373535,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "published",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:22:39-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": null
}
]
}
Retrieve all the comments for this shop
GET /admin/api/2020-01/comments.json
View Response
HTTP/1.1 200 OK
{
"comments": [
{
"id": 653537639,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "unapproved",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:22:39-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": null
},
{
"id": 118373535,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "published",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:22:39-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": null
}
]
}
Retrieve all comments for this shop after the specified ID
GET /admin/api/2020-01/comments.json?since_id=118373535
View Response
HTTP/1.1 200 OK
{
"comments": [
{
"id": 653537639,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "unapproved",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:22:39-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": null
}
]
}
created_at_min
|
Count comments created after date (format: 2014-04-25T16:15:47-04:00). |
created_at_max
|
Count comments created before date (format: 2014-04-25T16:15:47-04:00). |
updated_at_min
|
Count comments last updated after date (format: 2014-04-25T16:15:47-04:00). |
updated_at_max
|
Count comments last updated before date (format: 2014-04-25T16:15:47-04:00). |
published_at_min
|
Count comments published after date (format: 2014-04-25T16:15:47-04:00). |
published_at_max
|
Count comments published before date (format: 2014-04-25T16:15:47-04:00). |
published_status
|
Retrieve a count of comments with a given published status. (default:any )
|
status
|
Retrieve a count of comments with a given status.
|
Count all comments for a certain article of a blog
GET /admin/api/2020-01/comments/count.json?article_id=134645308&blog_id=241253187
View Response
HTTP/1.1 200 OK
{
"count": 2
}
Count all the comments for all the articles of a blog
GET /admin/api/2020-01/comments/count.json?blog_id=241253187
View Response
HTTP/1.1 200 OK
{
"count": 2
}
Count all the comments for this shop
GET /admin/api/2020-01/comments/count.json
View Response
HTTP/1.1 200 OK
{
"count": 2
}
fields
|
Show only certain fields, specified by a comma-separated list of field names. |
Retrieve a single comment
GET /admin/api/2020-01/comments/118373535.json
View Response
HTTP/1.1 200 OK
{
"comment": {
"id": 118373535,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "published",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:22:39-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": null
}
}
Create a comment for an article of a blog using basic Textile markup
POST /admin/api/2020-01/comments.json
{
"comment": {
"body": "I like comments\nAnd I like posting them *RESTfully*.",
"author": "Your name",
"email": "your@email.com",
"ip": "107.20.160.121",
"blog_id": 241253187,
"article_id": 134645308
}
}
View Response
HTTP/1.1 201 Created
{
"comment": {
"id": 757536352,
"body": "I like comments\nAnd I like posting them *RESTfully*.",
"body_html": "<p>I like comments<br>\nAnd I like posting them <strong>RESTfully</strong>.</p>",
"author": "Your name",
"email": "your@email.com",
"status": "pending",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:34:18-05:00",
"updated_at": "2021-01-01T14:34:18-05:00",
"ip": "107.20.160.121",
"user_agent": null,
"published_at": null
}
}
Creating a comment without a body, author, and email fails and returns an error
HTTP/1.1 422 Unprocessable Entity
{
"errors": {
"author": [
"can't be blank"
],
"body": [
"can't be blank"
],
"email": [
"must be formatted as an email"
]
}
}
Update the body of an existing comment
PUT /admin/api/2020-01/comments/118373535.json
{
"comment": {
"id": 118373535,
"body": "You can even update through a web service.",
"author": "Your new name",
"email": "your@updated-email.com",
"published_at": "2021-01-01T19:34:19.734Z"
}
}
View Response
HTTP/1.1 200 OK
{
"comment": {
"id": 118373535,
"body": "You can even update through a web service.",
"body_html": "<p>You can even update through a web service.</p>",
"author": "Your new name",
"email": "your@updated-email.com",
"status": "published",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:34:20-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": "2021-01-01T14:34:19-05:00"
}
}
Mark a comment as spam
HTTP/1.1 200 OK
{
"id": 653537639,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "spam",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:34:22-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": null
}
Mark a comment as not spam, restoring it to an unapproved or published state
HTTP/1.1 200 OK
{
"id": 653537639,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "published",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:34:25-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": "2021-01-01T14:34:25-05:00"
}
Approve a comment and publish it to the blog
HTTP/1.1 200 OK
{
"id": 653537639,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "published",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:34:27-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": "2021-01-01T14:34:27-05:00"
}
Remove a comment
HTTP/1.1 200 OK
{
"id": 653537639,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "removed",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:34:28-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": null
}
Restore a removed comment
HTTP/1.1 200 OK
{
"id": 653537639,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "published",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:34:33-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": "2021-01-01T14:34:33-05:00"
}
A comment is a reader's response to an article in a blog. Comments appear on the article page in reverse chronological order, typically after the article body. Just as a blog can have any number of articles, an article can have any number of comments.

Article comments are a target for spammers, so Shopify blogs use a spam detection system to identify comments that are likely to be spam. Shop owners can also can mark comments as spam or not spam. Comments that are marked as spam are removed from the Shopify admin and don't appear in the blog.
What you can do with Comment
The Shopify API lets you do the following with the Comment resource. More detailed versions of these general actions may be available:
- GET /admin/api/2020-04/comments.json?article_id=134645308&blog_id=241253187 Retrieves a list of comments
- GET /admin/api/2020-04/comments/count.json?article_id=134645308&blog_id=241253187 Retrieves a count of comments
- GET /admin/api/2020-04/comments/{comment_id}.json Retrieves a single comment by its ID
- POST /admin/api/2020-04/comments.json Creates a comment for an article
- PUT /admin/api/2020-04/comments/{comment_id}.json Updates a comment of an article
- POST /admin/api/2020-04/comments/{comment_id}/spam.json Marks a comment as spam
- POST /admin/api/2020-04/comments/{comment_id}/not_spam.json Marks a comment as not spam
- POST /admin/api/2020-04/comments/{comment_id}/approve.json Approves a comment
- POST /admin/api/2020-04/comments/{comment_id}/remove.json Removes a comment
- POST /admin/api/2020-04/comments/{comment_id}/restore.json Restores a previously removed comment
Comment properties
article_id |
A unique numeric identifier for the article that the comment belongs to. |
author |
The name of the author of the comment. |
blog_id |
A unique numeric identifier for the blog containing the article that the comment belongs to. |
body |
The basic Textile markup of a comment. |
body_html |
The text of the comment, complete with HTML markup. |
created_at
read-only |
The date and time (ISO 8601 format) when the comment was created. |
The email address of the author of the comment. |
|
id
read-only |
A unique numeric identifier for the comment. |
ip |
The IP address from which the comment was posted. |
published_at |
The date and time (ISO 8601 format) when the comment was published. |
status
read-only |
The status of the comment. Valid values:
|
updated_at
read-only |
The date and time (ISO 8601 format) when the comment was last modified. When the comment is created, this matches the value of |
user_agent |
The user agent string provided by the software used to create the comment (usually a browser). |
Endpoints
page
parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints.
limit
|
The maximum number of results to retrieve. (default:50 , maximum: 250 )
|
since_id
|
Restrict results to after the specified ID. |
created_at_min
|
Show comments created after date (format: 2014-04-25T16:15:47-04:00). |
created_at_max
|
Show comments created before date (format: 2014-04-25T16:15:47-04:00). |
updated_at_min
|
Show comments last updated after date (format: 2014-04-25T16:15:47-04:00). |
updated_at_max
|
Show comments last updated before date (format: 2014-04-25T16:15:47-04:00). |
published_at_min
|
Show comments published after date (format: 2014-04-25T16:15:47-04:00). |
published_at_max
|
Show comments published before date (format: 2014-04-25T16:15:47-04:00). |
fields
|
Show only certain fields, specified by a comma-separated list of field names. |
published_status
|
Filter results by their published status. (default:any )
|
status
|
Filter results by their status.
|
Retrieve all the comments for a certain article of a blog
GET /admin/api/2020-04/comments.json?article_id=134645308&blog_id=241253187
View Response
HTTP/1.1 200 OK
{
"comments": [
{
"id": 653537639,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "unapproved",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:22:39-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": null
},
{
"id": 118373535,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "published",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:22:39-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": null
}
]
}
Retrieve all the comments for all the articles of a blog
GET /admin/api/2020-04/comments.json?blog_id=241253187
View Response
HTTP/1.1 200 OK
{
"comments": [
{
"id": 653537639,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "unapproved",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:22:39-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": null
},
{
"id": 118373535,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "published",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:22:39-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": null
}
]
}
Retrieve all the comments for this shop
GET /admin/api/2020-04/comments.json
View Response
HTTP/1.1 200 OK
{
"comments": [
{
"id": 653537639,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "unapproved",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:22:39-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": null
},
{
"id": 118373535,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "published",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:22:39-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": null
}
]
}
Retrieve all comments for this shop after the specified ID
GET /admin/api/2020-04/comments.json?since_id=118373535
View Response
HTTP/1.1 200 OK
{
"comments": [
{
"id": 653537639,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "unapproved",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:22:39-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": null
}
]
}
created_at_min
|
Count comments created after date (format: 2014-04-25T16:15:47-04:00). |
created_at_max
|
Count comments created before date (format: 2014-04-25T16:15:47-04:00). |
updated_at_min
|
Count comments last updated after date (format: 2014-04-25T16:15:47-04:00). |
updated_at_max
|
Count comments last updated before date (format: 2014-04-25T16:15:47-04:00). |
published_at_min
|
Count comments published after date (format: 2014-04-25T16:15:47-04:00). |
published_at_max
|
Count comments published before date (format: 2014-04-25T16:15:47-04:00). |
published_status
|
Retrieve a count of comments with a given published status. (default:any )
|
status
|
Retrieve a count of comments with a given status.
|
Count all comments for a certain article of a blog
GET /admin/api/2020-04/comments/count.json?article_id=134645308&blog_id=241253187
View Response
HTTP/1.1 200 OK
{
"count": 2
}
Count all the comments for all the articles of a blog
GET /admin/api/2020-04/comments/count.json?blog_id=241253187
View Response
HTTP/1.1 200 OK
{
"count": 2
}
Count all the comments for this shop
GET /admin/api/2020-04/comments/count.json
View Response
HTTP/1.1 200 OK
{
"count": 2
}
fields
|
Show only certain fields, specified by a comma-separated list of field names. |
Retrieve a single comment
GET /admin/api/2020-04/comments/118373535.json
View Response
HTTP/1.1 200 OK
{
"comment": {
"id": 118373535,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "published",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:22:39-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": null
}
}
Create a comment for an article of a blog using basic Textile markup
POST /admin/api/2020-04/comments.json
{
"comment": {
"body": "I like comments\nAnd I like posting them *RESTfully*.",
"author": "Your name",
"email": "your@email.com",
"ip": "107.20.160.121",
"blog_id": 241253187,
"article_id": 134645308
}
}
View Response
HTTP/1.1 201 Created
{
"comment": {
"id": 757536352,
"body": "I like comments\nAnd I like posting them *RESTfully*.",
"body_html": "<p>I like comments<br>\nAnd I like posting them <strong>RESTfully</strong>.</p>",
"author": "Your name",
"email": "your@email.com",
"status": "pending",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:34:18-05:00",
"updated_at": "2021-01-01T14:34:18-05:00",
"ip": "107.20.160.121",
"user_agent": null,
"published_at": null
}
}
Creating a comment without a body, author, and email fails and returns an error
HTTP/1.1 422 Unprocessable Entity
{
"errors": {
"author": [
"can't be blank"
],
"body": [
"can't be blank"
],
"email": [
"must be formatted as an email"
]
}
}
Update the body of an existing comment
PUT /admin/api/2020-04/comments/118373535.json
{
"comment": {
"id": 118373535,
"body": "You can even update through a web service.",
"author": "Your new name",
"email": "your@updated-email.com",
"published_at": "2021-01-01T19:34:19.734Z"
}
}
View Response
HTTP/1.1 200 OK
{
"comment": {
"id": 118373535,
"body": "You can even update through a web service.",
"body_html": "<p>You can even update through a web service.</p>",
"author": "Your new name",
"email": "your@updated-email.com",
"status": "published",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:34:20-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": "2021-01-01T14:34:19-05:00"
}
}
Mark a comment as spam
HTTP/1.1 200 OK
{
"id": 653537639,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "spam",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:34:22-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": null
}
Mark a comment as not spam, restoring it to an unapproved or published state
HTTP/1.1 200 OK
{
"id": 653537639,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "published",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:34:25-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": "2021-01-01T14:34:25-05:00"
}
Approve a comment and publish it to the blog
HTTP/1.1 200 OK
{
"id": 653537639,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "published",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:34:27-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": "2021-01-01T14:34:27-05:00"
}
Remove a comment
HTTP/1.1 200 OK
{
"id": 653537639,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "removed",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:34:28-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": null
}
Restore a removed comment
HTTP/1.1 200 OK
{
"id": 653537639,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "published",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:34:33-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": "2021-01-01T14:34:33-05:00"
}
A comment is a reader's response to an article in a blog. Comments appear on the article page in reverse chronological order, typically after the article body. Just as a blog can have any number of articles, an article can have any number of comments.

Article comments are a target for spammers, so Shopify blogs use a spam detection system to identify comments that are likely to be spam. Shop owners can also can mark comments as spam or not spam. Comments that are marked as spam are removed from the Shopify admin and don't appear in the blog.
What you can do with Comment
The Shopify API lets you do the following with the Comment resource. More detailed versions of these general actions may be available:
- GET /admin/api/2020-07/comments.json?article_id=134645308&blog_id=241253187 Retrieves a list of comments
- GET /admin/api/2020-07/comments/count.json?article_id=134645308&blog_id=241253187 Retrieves a count of comments
- GET /admin/api/2020-07/comments/{comment_id}.json Retrieves a single comment by its ID
- POST /admin/api/2020-07/comments.json Creates a comment for an article
- PUT /admin/api/2020-07/comments/{comment_id}.json Updates a comment of an article
- POST /admin/api/2020-07/comments/{comment_id}/spam.json Marks a comment as spam
- POST /admin/api/2020-07/comments/{comment_id}/not_spam.json Marks a comment as not spam
- POST /admin/api/2020-07/comments/{comment_id}/approve.json Approves a comment
- POST /admin/api/2020-07/comments/{comment_id}/remove.json Removes a comment
- POST /admin/api/2020-07/comments/{comment_id}/restore.json Restores a previously removed comment
Comment properties
article_id |
A unique numeric identifier for the article that the comment belongs to. |
author |
The name of the author of the comment. |
blog_id |
A unique numeric identifier for the blog containing the article that the comment belongs to. |
body |
The basic Textile markup of a comment. |
body_html |
The text of the comment, complete with HTML markup. |
created_at
read-only |
The date and time (ISO 8601 format) when the comment was created. |
The email address of the author of the comment. |
|
id
read-only |
A unique numeric identifier for the comment. |
ip |
The IP address from which the comment was posted. |
published_at |
The date and time (ISO 8601 format) when the comment was published. |
status
read-only |
The status of the comment. Valid values:
|
updated_at
read-only |
The date and time (ISO 8601 format) when the comment was last modified. When the comment is created, this matches the value of |
user_agent |
The user agent string provided by the software used to create the comment (usually a browser). |
Endpoints
page
parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints.
limit
|
The maximum number of results to retrieve. (default:50 , maximum: 250 )
|
since_id
|
Restrict results to after the specified ID. |
created_at_min
|
Show comments created after date (format: 2014-04-25T16:15:47-04:00). |
created_at_max
|
Show comments created before date (format: 2014-04-25T16:15:47-04:00). |
updated_at_min
|
Show comments last updated after date (format: 2014-04-25T16:15:47-04:00). |
updated_at_max
|
Show comments last updated before date (format: 2014-04-25T16:15:47-04:00). |
published_at_min
|
Show comments published after date (format: 2014-04-25T16:15:47-04:00). |
published_at_max
|
Show comments published before date (format: 2014-04-25T16:15:47-04:00). |
fields
|
Show only certain fields, specified by a comma-separated list of field names. |
published_status
|
Filter results by their published status. (default:any )
|
status
|
Filter results by their status.
|
Retrieve all the comments for a certain article of a blog
GET /admin/api/2020-07/comments.json?article_id=134645308&blog_id=241253187
View Response
HTTP/1.1 200 OK
{
"comments": [
{
"id": 653537639,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "unapproved",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:22:39-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": null
},
{
"id": 118373535,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "published",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:22:39-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": null
}
]
}
Retrieve all the comments for all the articles of a blog
GET /admin/api/2020-07/comments.json?blog_id=241253187
View Response
HTTP/1.1 200 OK
{
"comments": [
{
"id": 653537639,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "unapproved",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:22:39-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": null
},
{
"id": 118373535,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "published",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:22:39-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": null
}
]
}
Retrieve all the comments for this shop
GET /admin/api/2020-07/comments.json
View Response
HTTP/1.1 200 OK
{
"comments": [
{
"id": 653537639,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "unapproved",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:22:39-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": null
},
{
"id": 118373535,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "published",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:22:39-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": null
}
]
}
Retrieve all comments for this shop after the specified ID
GET /admin/api/2020-07/comments.json?since_id=118373535
View Response
HTTP/1.1 200 OK
{
"comments": [
{
"id": 653537639,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "unapproved",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:22:39-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": null
}
]
}
created_at_min
|
Count comments created after date (format: 2014-04-25T16:15:47-04:00). |
created_at_max
|
Count comments created before date (format: 2014-04-25T16:15:47-04:00). |
updated_at_min
|
Count comments last updated after date (format: 2014-04-25T16:15:47-04:00). |
updated_at_max
|
Count comments last updated before date (format: 2014-04-25T16:15:47-04:00). |
published_at_min
|
Count comments published after date (format: 2014-04-25T16:15:47-04:00). |
published_at_max
|
Count comments published before date (format: 2014-04-25T16:15:47-04:00). |
published_status
|
Retrieve a count of comments with a given published status. (default:any )
|
status
|
Retrieve a count of comments with a given status.
|
Count all comments for a certain article of a blog
GET /admin/api/2020-07/comments/count.json?article_id=134645308&blog_id=241253187
View Response
HTTP/1.1 200 OK
{
"count": 2
}
Count all the comments for all the articles of a blog
GET /admin/api/2020-07/comments/count.json?blog_id=241253187
View Response
HTTP/1.1 200 OK
{
"count": 2
}
Count all the comments for this shop
GET /admin/api/2020-07/comments/count.json
View Response
HTTP/1.1 200 OK
{
"count": 2
}
fields
|
Show only certain fields, specified by a comma-separated list of field names. |
Retrieve a single comment
GET /admin/api/2020-07/comments/118373535.json
View Response
HTTP/1.1 200 OK
{
"comment": {
"id": 118373535,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "published",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:22:39-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": null
}
}
Create a comment for an article of a blog using basic Textile markup
POST /admin/api/2020-07/comments.json
{
"comment": {
"body": "I like comments\nAnd I like posting them *RESTfully*.",
"author": "Your name",
"email": "your@email.com",
"ip": "107.20.160.121",
"blog_id": 241253187,
"article_id": 134645308
}
}
View Response
HTTP/1.1 201 Created
{
"comment": {
"id": 757536352,
"body": "I like comments\nAnd I like posting them *RESTfully*.",
"body_html": "<p>I like comments<br>\nAnd I like posting them <strong>RESTfully</strong>.</p>",
"author": "Your name",
"email": "your@email.com",
"status": "pending",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:34:18-05:00",
"updated_at": "2021-01-01T14:34:18-05:00",
"ip": "107.20.160.121",
"user_agent": null,
"published_at": null
}
}
Creating a comment without a body, author, and email fails and returns an error
HTTP/1.1 422 Unprocessable Entity
{
"errors": {
"author": [
"can't be blank"
],
"body": [
"can't be blank"
],
"email": [
"must be formatted as an email"
]
}
}
Update the body of an existing comment
PUT /admin/api/2020-07/comments/118373535.json
{
"comment": {
"id": 118373535,
"body": "You can even update through a web service.",
"author": "Your new name",
"email": "your@updated-email.com",
"published_at": "2021-01-01T19:34:19.734Z"
}
}
View Response
HTTP/1.1 200 OK
{
"comment": {
"id": 118373535,
"body": "You can even update through a web service.",
"body_html": "<p>You can even update through a web service.</p>",
"author": "Your new name",
"email": "your@updated-email.com",
"status": "published",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:34:20-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": "2021-01-01T14:34:19-05:00"
}
}
Mark a comment as spam
HTTP/1.1 200 OK
{
"id": 653537639,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "spam",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:34:22-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": null
}
Mark a comment as not spam, restoring it to an unapproved or published state
HTTP/1.1 200 OK
{
"id": 653537639,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "published",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:34:25-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": "2021-01-01T14:34:25-05:00"
}
Approve a comment and publish it to the blog
HTTP/1.1 200 OK
{
"id": 653537639,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "published",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:34:27-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": "2021-01-01T14:34:27-05:00"
}
Remove a comment
HTTP/1.1 200 OK
{
"id": 653537639,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "removed",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:34:28-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": null
}
Restore a removed comment
HTTP/1.1 200 OK
{
"id": 653537639,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "published",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:34:33-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": "2021-01-01T14:34:33-05:00"
}
A comment is a reader's response to an article in a blog. Comments appear on the article page in reverse chronological order, typically after the article body. Just as a blog can have any number of articles, an article can have any number of comments.

Article comments are a target for spammers, so Shopify blogs use a spam detection system to identify comments that are likely to be spam. Shop owners can also can mark comments as spam or not spam. Comments that are marked as spam are removed from the Shopify admin and don't appear in the blog.
What you can do with Comment
The Shopify API lets you do the following with the Comment resource. More detailed versions of these general actions may be available:
- GET /admin/api/2020-10/comments.json?article_id=134645308&blog_id=241253187 Retrieves a list of comments
- GET /admin/api/2020-10/comments/count.json?article_id=134645308&blog_id=241253187 Retrieves a count of comments
- GET /admin/api/2020-10/comments/{comment_id}.json Retrieves a single comment by its ID
- POST /admin/api/2020-10/comments.json Creates a comment for an article
- PUT /admin/api/2020-10/comments/{comment_id}.json Updates a comment of an article
- POST /admin/api/2020-10/comments/{comment_id}/spam.json Marks a comment as spam
- POST /admin/api/2020-10/comments/{comment_id}/not_spam.json Marks a comment as not spam
- POST /admin/api/2020-10/comments/{comment_id}/approve.json Approves a comment
- POST /admin/api/2020-10/comments/{comment_id}/remove.json Removes a comment
- POST /admin/api/2020-10/comments/{comment_id}/restore.json Restores a previously removed comment
Comment properties
article_id |
A unique numeric identifier for the article that the comment belongs to. |
author |
The name of the author of the comment. |
blog_id |
A unique numeric identifier for the blog containing the article that the comment belongs to. |
body |
The basic Textile markup of a comment. |
body_html |
The text of the comment, complete with HTML markup. |
created_at
read-only |
The date and time (ISO 8601 format) when the comment was created. |
The email address of the author of the comment. |
|
id
read-only |
A unique numeric identifier for the comment. |
ip |
The IP address from which the comment was posted. |
published_at |
The date and time (ISO 8601 format) when the comment was published. |
status
read-only |
The status of the comment. Valid values:
|
updated_at
read-only |
The date and time (ISO 8601 format) when the comment was last modified. When the comment is created, this matches the value of |
user_agent |
The user agent string provided by the software used to create the comment (usually a browser). |
Endpoints
page
parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints.
limit
|
The maximum number of results to retrieve. (default:50 , maximum: 250 )
|
since_id
|
Restrict results to after the specified ID. |
created_at_min
|
Show comments created after date (format: 2014-04-25T16:15:47-04:00). |
created_at_max
|
Show comments created before date (format: 2014-04-25T16:15:47-04:00). |
updated_at_min
|
Show comments last updated after date (format: 2014-04-25T16:15:47-04:00). |
updated_at_max
|
Show comments last updated before date (format: 2014-04-25T16:15:47-04:00). |
published_at_min
|
Show comments published after date (format: 2014-04-25T16:15:47-04:00). |
published_at_max
|
Show comments published before date (format: 2014-04-25T16:15:47-04:00). |
fields
|
Show only certain fields, specified by a comma-separated list of field names. |
published_status
|
Filter results by their published status. (default:any )
|
status
|
Filter results by their status.
|
Retrieve all the comments for a certain article of a blog
GET /admin/api/2020-10/comments.json?article_id=134645308&blog_id=241253187
View Response
HTTP/1.1 200 OK
{
"comments": [
{
"id": 653537639,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "unapproved",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:22:39-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": null
},
{
"id": 118373535,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "published",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:22:39-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": null
}
]
}
Retrieve all the comments for all the articles of a blog
GET /admin/api/2020-10/comments.json?blog_id=241253187
View Response
HTTP/1.1 200 OK
{
"comments": [
{
"id": 653537639,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "unapproved",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:22:39-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": null
},
{
"id": 118373535,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "published",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:22:39-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": null
}
]
}
Retrieve all the comments for this shop
GET /admin/api/2020-10/comments.json
View Response
HTTP/1.1 200 OK
{
"comments": [
{
"id": 653537639,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "unapproved",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:22:39-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": null
},
{
"id": 118373535,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "published",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:22:39-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": null
}
]
}
Retrieve all comments for this shop after the specified ID
GET /admin/api/2020-10/comments.json?since_id=118373535
View Response
HTTP/1.1 200 OK
{
"comments": [
{
"id": 653537639,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "unapproved",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:22:39-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": null
}
]
}
created_at_min
|
Count comments created after date (format: 2014-04-25T16:15:47-04:00). |
created_at_max
|
Count comments created before date (format: 2014-04-25T16:15:47-04:00). |
updated_at_min
|
Count comments last updated after date (format: 2014-04-25T16:15:47-04:00). |
updated_at_max
|
Count comments last updated before date (format: 2014-04-25T16:15:47-04:00). |
published_at_min
|
Count comments published after date (format: 2014-04-25T16:15:47-04:00). |
published_at_max
|
Count comments published before date (format: 2014-04-25T16:15:47-04:00). |
published_status
|
Retrieve a count of comments with a given published status. (default:any )
|
status
|
Retrieve a count of comments with a given status.
|
Count all comments for a certain article of a blog
GET /admin/api/2020-10/comments/count.json?article_id=134645308&blog_id=241253187
View Response
HTTP/1.1 200 OK
{
"count": 2
}
Count all the comments for all the articles of a blog
GET /admin/api/2020-10/comments/count.json?blog_id=241253187
View Response
HTTP/1.1 200 OK
{
"count": 2
}
Count all the comments for this shop
GET /admin/api/2020-10/comments/count.json
View Response
HTTP/1.1 200 OK
{
"count": 2
}
fields
|
Show only certain fields, specified by a comma-separated list of field names. |
Retrieve a single comment
GET /admin/api/2020-10/comments/118373535.json
View Response
HTTP/1.1 200 OK
{
"comment": {
"id": 118373535,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "published",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:22:39-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": null
}
}
Create a comment for an article of a blog using basic Textile markup
POST /admin/api/2020-10/comments.json
{
"comment": {
"body": "I like comments\nAnd I like posting them *RESTfully*.",
"author": "Your name",
"email": "your@email.com",
"ip": "107.20.160.121",
"blog_id": 241253187,
"article_id": 134645308
}
}
View Response
HTTP/1.1 201 Created
{
"comment": {
"id": 757536352,
"body": "I like comments\nAnd I like posting them *RESTfully*.",
"body_html": "<p>I like comments<br>\nAnd I like posting them <strong>RESTfully</strong>.</p>",
"author": "Your name",
"email": "your@email.com",
"status": "pending",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:34:18-05:00",
"updated_at": "2021-01-01T14:34:18-05:00",
"ip": "107.20.160.121",
"user_agent": null,
"published_at": null
}
}
Creating a comment without a body, author, and email fails and returns an error
HTTP/1.1 422 Unprocessable Entity
{
"errors": {
"author": [
"can't be blank"
],
"body": [
"can't be blank"
],
"email": [
"must be formatted as an email"
]
}
}
Update the body of an existing comment
PUT /admin/api/2020-10/comments/118373535.json
{
"comment": {
"id": 118373535,
"body": "You can even update through a web service.",
"author": "Your new name",
"email": "your@updated-email.com",
"published_at": "2021-01-01T19:34:19.734Z"
}
}
View Response
HTTP/1.1 200 OK
{
"comment": {
"id": 118373535,
"body": "You can even update through a web service.",
"body_html": "<p>You can even update through a web service.</p>",
"author": "Your new name",
"email": "your@updated-email.com",
"status": "published",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:34:20-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": "2021-01-01T14:34:19-05:00"
}
}
Mark a comment as spam
HTTP/1.1 200 OK
{
"id": 653537639,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "spam",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:34:22-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": null
}
Mark a comment as not spam, restoring it to an unapproved or published state
HTTP/1.1 200 OK
{
"id": 653537639,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "published",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:34:25-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": "2021-01-01T14:34:25-05:00"
}
Approve a comment and publish it to the blog
HTTP/1.1 200 OK
{
"id": 653537639,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "published",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:34:27-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": "2021-01-01T14:34:27-05:00"
}
Remove a comment
HTTP/1.1 200 OK
{
"id": 653537639,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "removed",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:34:28-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": null
}
Restore a removed comment
HTTP/1.1 200 OK
{
"id": 653537639,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "published",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:34:33-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": "2021-01-01T14:34:33-05:00"
}
A comment is a reader's response to an article in a blog. Comments appear on the article page in reverse chronological order, typically after the article body. Just as a blog can have any number of articles, an article can have any number of comments.

Article comments are a target for spammers, so Shopify blogs use a spam detection system to identify comments that are likely to be spam. Shop owners can also can mark comments as spam or not spam. Comments that are marked as spam are removed from the Shopify admin and don't appear in the blog.
What you can do with Comment
The Shopify API lets you do the following with the Comment resource. More detailed versions of these general actions may be available:
- GET /admin/api/2021-01/comments.json?article_id=134645308&blog_id=241253187 Retrieves a list of comments
- GET /admin/api/2021-01/comments/count.json?article_id=134645308&blog_id=241253187 Retrieves a count of comments
- GET /admin/api/2021-01/comments/{comment_id}.json Retrieves a single comment by its ID
- POST /admin/api/2021-01/comments.json Creates a comment for an article
- PUT /admin/api/2021-01/comments/{comment_id}.json Updates a comment of an article
- POST /admin/api/2021-01/comments/{comment_id}/spam.json Marks a comment as spam
- POST /admin/api/2021-01/comments/{comment_id}/not_spam.json Marks a comment as not spam
- POST /admin/api/2021-01/comments/{comment_id}/approve.json Approves a comment
- POST /admin/api/2021-01/comments/{comment_id}/remove.json Removes a comment
- POST /admin/api/2021-01/comments/{comment_id}/restore.json Restores a previously removed comment
Comment properties
article_id |
A unique numeric identifier for the article that the comment belongs to. |
author |
The name of the author of the comment. |
blog_id |
A unique numeric identifier for the blog containing the article that the comment belongs to. |
body |
The basic Textile markup of a comment. |
body_html |
The text of the comment, complete with HTML markup. |
created_at
read-only |
The date and time (ISO 8601 format) when the comment was created. |
The email address of the author of the comment. |
|
id
read-only |
A unique numeric identifier for the comment. |
ip |
The IP address from which the comment was posted. |
published_at |
The date and time (ISO 8601 format) when the comment was published. |
status
read-only |
The status of the comment. Valid values:
|
updated_at
read-only |
The date and time (ISO 8601 format) when the comment was last modified. When the comment is created, this matches the value of |
user_agent |
The user agent string provided by the software used to create the comment (usually a browser). |
Endpoints
page
parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints.
limit
|
The maximum number of results to retrieve. (default:50 , maximum: 250 )
|
since_id
|
Restrict results to after the specified ID. |
created_at_min
|
Show comments created after date (format: 2014-04-25T16:15:47-04:00). |
created_at_max
|
Show comments created before date (format: 2014-04-25T16:15:47-04:00). |
updated_at_min
|
Show comments last updated after date (format: 2014-04-25T16:15:47-04:00). |
updated_at_max
|
Show comments last updated before date (format: 2014-04-25T16:15:47-04:00). |
published_at_min
|
Show comments published after date (format: 2014-04-25T16:15:47-04:00). |
published_at_max
|
Show comments published before date (format: 2014-04-25T16:15:47-04:00). |
fields
|
Show only certain fields, specified by a comma-separated list of field names. |
published_status
|
Filter results by their published status. (default:any )
|
status
|
Filter results by their status.
|
Retrieve all the comments for a certain article of a blog
GET /admin/api/2021-01/comments.json?article_id=134645308&blog_id=241253187
View Response
HTTP/1.1 200 OK
{
"comments": [
{
"id": 653537639,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "unapproved",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:22:39-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": null
},
{
"id": 118373535,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "published",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:22:39-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": null
}
]
}
Retrieve all the comments for all the articles of a blog
GET /admin/api/2021-01/comments.json?blog_id=241253187
View Response
HTTP/1.1 200 OK
{
"comments": [
{
"id": 653537639,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "unapproved",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:22:39-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": null
},
{
"id": 118373535,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "published",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:22:39-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": null
}
]
}
Retrieve all the comments for this shop
GET /admin/api/2021-01/comments.json
View Response
HTTP/1.1 200 OK
{
"comments": [
{
"id": 653537639,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "unapproved",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:22:39-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": null
},
{
"id": 118373535,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "published",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:22:39-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": null
}
]
}
Retrieve all comments for this shop after the specified ID
GET /admin/api/2021-01/comments.json?since_id=118373535
View Response
HTTP/1.1 200 OK
{
"comments": [
{
"id": 653537639,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "unapproved",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:22:39-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": null
}
]
}
created_at_min
|
Count comments created after date (format: 2014-04-25T16:15:47-04:00). |
created_at_max
|
Count comments created before date (format: 2014-04-25T16:15:47-04:00). |
updated_at_min
|
Count comments last updated after date (format: 2014-04-25T16:15:47-04:00). |
updated_at_max
|
Count comments last updated before date (format: 2014-04-25T16:15:47-04:00). |
published_at_min
|
Count comments published after date (format: 2014-04-25T16:15:47-04:00). |
published_at_max
|
Count comments published before date (format: 2014-04-25T16:15:47-04:00). |
published_status
|
Retrieve a count of comments with a given published status. (default:any )
|
status
|
Retrieve a count of comments with a given status.
|
Count all comments for a certain article of a blog
GET /admin/api/2021-01/comments/count.json?article_id=134645308&blog_id=241253187
View Response
HTTP/1.1 200 OK
{
"count": 2
}
Count all the comments for all the articles of a blog
GET /admin/api/2021-01/comments/count.json?blog_id=241253187
View Response
HTTP/1.1 200 OK
{
"count": 2
}
Count all the comments for this shop
GET /admin/api/2021-01/comments/count.json
View Response
HTTP/1.1 200 OK
{
"count": 2
}
fields
|
Show only certain fields, specified by a comma-separated list of field names. |
Retrieve a single comment
GET /admin/api/2021-01/comments/118373535.json
View Response
HTTP/1.1 200 OK
{
"comment": {
"id": 118373535,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "published",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:22:39-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": null
}
}
Create a comment for an article of a blog using basic Textile markup
POST /admin/api/2021-01/comments.json
{
"comment": {
"body": "I like comments\nAnd I like posting them *RESTfully*.",
"author": "Your name",
"email": "your@email.com",
"ip": "107.20.160.121",
"blog_id": 241253187,
"article_id": 134645308
}
}
View Response
HTTP/1.1 201 Created
{
"comment": {
"id": 757536352,
"body": "I like comments\nAnd I like posting them *RESTfully*.",
"body_html": "<p>I like comments<br>\nAnd I like posting them <strong>RESTfully</strong>.</p>",
"author": "Your name",
"email": "your@email.com",
"status": "pending",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:34:18-05:00",
"updated_at": "2021-01-01T14:34:18-05:00",
"ip": "107.20.160.121",
"user_agent": null,
"published_at": null
}
}
Creating a comment without a body, author, and email fails and returns an error
HTTP/1.1 422 Unprocessable Entity
{
"errors": {
"author": [
"can't be blank"
],
"body": [
"can't be blank"
],
"email": [
"must be formatted as an email"
]
}
}
Update the body of an existing comment
PUT /admin/api/2021-01/comments/118373535.json
{
"comment": {
"id": 118373535,
"body": "You can even update through a web service.",
"author": "Your new name",
"email": "your@updated-email.com",
"published_at": "2021-01-01T19:34:19.734Z"
}
}
View Response
HTTP/1.1 200 OK
{
"comment": {
"id": 118373535,
"body": "You can even update through a web service.",
"body_html": "<p>You can even update through a web service.</p>",
"author": "Your new name",
"email": "your@updated-email.com",
"status": "published",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:34:20-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": "2021-01-01T14:34:19-05:00"
}
}
Mark a comment as spam
HTTP/1.1 200 OK
{
"id": 653537639,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "spam",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:34:22-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": null
}
Mark a comment as not spam, restoring it to an unapproved or published state
HTTP/1.1 200 OK
{
"id": 653537639,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "published",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:34:25-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": "2021-01-01T14:34:25-05:00"
}
Approve a comment and publish it to the blog
HTTP/1.1 200 OK
{
"id": 653537639,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "published",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:34:27-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": "2021-01-01T14:34:27-05:00"
}
Remove a comment
HTTP/1.1 200 OK
{
"id": 653537639,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "removed",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:34:28-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": null
}
Restore a removed comment
HTTP/1.1 200 OK
{
"id": 653537639,
"body": "Hi author, I really _like_ what you're doing there.",
"body_html": "<p>Hi author, I really <em>like</em> what you're doing there.</p>",
"author": "Soleone",
"email": "sole@one.de",
"status": "published",
"article_id": 134645308,
"blog_id": 241253187,
"created_at": "2021-01-01T14:22:39-05:00",
"updated_at": "2021-01-01T14:34:33-05:00",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1",
"published_at": "2021-01-01T14:34:33-05:00"
}
A comment is a reader's response to an article in a blog. Comments appear on the article page in reverse chronological order, typically after the article body. Just as a blog can have any number of articles, an article can have any number of comments.

Article comments are a target for spammers, so Shopify blogs use a spam detection system to identify comments that are likely to be spam. Shop owners can also can mark comments as spam or not spam. Comments that are marked as spam are removed from the Shopify admin and don't appear in the blog.
What you can do with Comment
The Shopify API lets you do the following with the