--- title: Comment description: "Manage the reader comments for articles (blog posts). Each article can have many comments. Some available actions include creating comments, updating comments, deleting comments, marking comments as spam, and approving comments. " api_version: 2025-10 api_name: admin-rest api_type: rest source_url: html: https://shopify.dev/docs/api/admin-rest/latest/resources/comment md: https://shopify.dev/docs/api/admin-rest/latest/resources/comment.md --- ![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg) The REST Admin API is a legacy API as of October 1, 2024. Starting April 1, 2025, all new public apps must be built exclusively with the [GraphQL Admin API](https://shopify.dev/docs/api/admin-graphql). For details and migration steps, visit our [migration guide](https://shopify.dev/docs/apps/build/graphql/migrate). # Comment Requires `content` access scope. Requires access to [protected customer data](https://shopify.dev/apps/store/data-protection/protected-customer-data). 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. ![](https://shopify.dev/assets/api/reference/comment.png) 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. \# ## Endpoints * [post](https://shopify.dev/docs/api/admin-rest/latest/resources/comment#post-comments) [/admin/api/latest/comments.​json](https://shopify.dev/docs/api/admin-rest/latest/resources/comment#post-comments) Creates a comment for an article deprecated * [post](https://shopify.dev/docs/api/admin-rest/latest/resources/comment#post-comments-comment-id-approve) [/admin/api/latest/comments/{comment\_​id}/approve.​json](https://shopify.dev/docs/api/admin-rest/latest/resources/comment#post-comments-comment-id-approve) Approves a comment [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/mutations/commentApprove?example=approves-a-comment) [commentApprove](https://shopify.dev/docs/api/admin-graphql/latest/mutations/commentApprove?example=approves-a-comment) * [post](https://shopify.dev/docs/api/admin-rest/latest/resources/comment#post-comments-comment-id-not-spam) [/admin/api/latest/comments/{comment\_​id}/not\_​spam.​json](https://shopify.dev/docs/api/admin-rest/latest/resources/comment#post-comments-comment-id-not-spam) Marks a comment as not spam [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/mutations/commentNotSpam?example=marks-a-comment-as-not-spam) [commentNotSpam](https://shopify.dev/docs/api/admin-graphql/latest/mutations/commentNotSpam?example=marks-a-comment-as-not-spam) * [post](https://shopify.dev/docs/api/admin-rest/latest/resources/comment#post-comments-comment-id-remove) [/admin/api/latest/comments/{comment\_​id}/remove.​json](https://shopify.dev/docs/api/admin-rest/latest/resources/comment#post-comments-comment-id-remove) Removes a comment [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/mutations/commentDelete?example=removes-a-comment) [commentDelete](https://shopify.dev/docs/api/admin-graphql/latest/mutations/commentDelete?example=removes-a-comment) * [post](https://shopify.dev/docs/api/admin-rest/latest/resources/comment#post-comments-comment-id-restore) [/admin/api/latest/comments/{comment\_​id}/restore.​json](https://shopify.dev/docs/api/admin-rest/latest/resources/comment#post-comments-comment-id-restore) Restores a previously removed comment deprecated * [post](https://shopify.dev/docs/api/admin-rest/latest/resources/comment#post-comments-comment-id-spam) [/admin/api/latest/comments/{comment\_​id}/spam.​json](https://shopify.dev/docs/api/admin-rest/latest/resources/comment#post-comments-comment-id-spam) Marks a comment as spam [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/mutations/commentSpam?example=marks-a-comment-as-spam) [commentSpam](https://shopify.dev/docs/api/admin-graphql/latest/mutations/commentSpam?example=marks-a-comment-as-spam) * [get](https://shopify.dev/docs/api/admin-rest/latest/resources/comment#get-comments?since-id=118373535) [/admin/api/latest/comments.​json?since\_​id=118373535](https://shopify.dev/docs/api/admin-rest/latest/resources/comment#get-comments?since-id=118373535) Retrieves a list of comments [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/queries/comments?example=retrieves-a-list-of-comments) [comments](https://shopify.dev/docs/api/admin-graphql/latest/queries/comments?example=retrieves-a-list-of-comments) * [get](https://shopify.dev/docs/api/admin-rest/latest/resources/comment#get-comments-comment-id) [/admin/api/latest/comments/{comment\_​id}.​json](https://shopify.dev/docs/api/admin-rest/latest/resources/comment#get-comments-comment-id) Retrieves a single comment by its ID [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/queries/comment?example=retrieves-a-single-comment-by-its-id) [comment](https://shopify.dev/docs/api/admin-graphql/latest/queries/comment?example=retrieves-a-single-comment-by-its-id) * [get](https://shopify.dev/docs/api/admin-rest/latest/resources/comment#get-comments-count?article-id=134645308\&blog-id=241253187) [/admin/api/latest/comments/count.​json?article\_​id=134645308\&blog\_​id=241253187](https://shopify.dev/docs/api/admin-rest/latest/resources/comment#get-comments-count?article-id=134645308\&blog-id=241253187) Retrieves a count of comments [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/queries/article) [article](https://shopify.dev/docs/api/admin-graphql/latest/queries/article) * [put](https://shopify.dev/docs/api/admin-rest/latest/resources/comment#put-comments-comment-id) [/admin/api/latest/comments/{comment\_​id}.​json](https://shopify.dev/docs/api/admin-rest/latest/resources/comment#put-comments-comment-id) Updates a comment of an article deprecated *** ## The Comment resource ### Properties *** article\_id A unique numeric identifier for the article that the comment belongs to. *** author [](https://shopify.dev/apps/store/data-protection/protected-customer-data) 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](https://en.wikipedia.org/wiki/Textile_\(markup_language\)) of a comment. *** body\_html The text of the comment, complete with HTML markup. *** created\_at read-only The date and time ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format) when the comment was created. *** email [](https://shopify.dev/apps/store/data-protection/protected-customer-data) The email address of the author of the comment. *** id read-only A unique numeric identifier for the comment. *** ip [](https://shopify.dev/apps/store/data-protection/protected-customer-data) The IP address from which the comment was posted. *** published\_at The date and time ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format) when the comment was published. *** status read-only The status of the comment. Valid values: Show status properties * **pending**: The comment has been created but is awaiting spam detection. Depending on the result of the spam detection and the shop owner's comment preferences, this property will be transitioned to either `spam`, `unapproved`, or `approved`. * **unapproved (default)**: The comment is awaiting approval by the shop owner. It's not visible to the readers of the blog. * **published**: The comment has been approved (if the blog requires comments to be approved) and is visible to readers of the blog. * **spam**: The comment has been marked as spam and removed from the Shopify admin. It's not visible to readers of the blog. * **removed**: The comment has been removed by the shop owner. It's not visible to readers of the blog. *** updated\_at read-only The date and time ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format) when the comment was last modified. When the comment is created, this matches the value of `created_at`. If the blog requires comments to be approved, then this value is updated to the date and time when the comment is approved. *** user\_agent The user agent string provided by the software used to create the comment (usually a browser). *** {} ## The Comment resource ```json { "article_id": 134645308, "author": "Soleone", "blog_id": 241253187, "body": "This is a _great_ article.", "body_html": "

This is a great article.

", "created_at": "2012-08-24T14:01:46-04:00", "email": "soleone@example.net", "id": 653537639, "ip": "127.0.0.1", "published_at": "2012-08-24T14:02:00-04:00", "status": "unapproved", "updated_at": "2012-08-24T14:02:00-04:00", "user_agent": "Mozilla/5.0" } ``` *** ## postCreates a comment for an articledeprecated Creates a comment for an article ### Parameters *** api\_version string required *** ### Examples Create a comment for an article of a blog using basic Textile markup Request body comment​[](https://shopify.dev/apps/store/data-protection/protected-customer-data) Comment resource Show comment properties comment.body:​"I like comments\nAnd I like posting them \*RESTfully\*." The basic [Textile markup](https://en.wikipedia.org/wiki/Textile_\(markup_language\)) of a comment. comment.author:​"Your name"[](https://shopify.dev/apps/store/data-protection/protected-customer-data) The name of the author of the comment. comment.email:​"your\@email.com"[](https://shopify.dev/apps/store/data-protection/protected-customer-data) The email address of the author of the comment. comment.ip:​"107.20.160.121"[](https://shopify.dev/apps/store/data-protection/protected-customer-data) The IP address from which the comment was posted. comment.blog\_​id:​241253187 A unique numeric identifier for the blog containing the article that the comment belongs to. comment.article\_​id:​134645308 A unique numeric identifier for the article that the comment belongs to. Creating a comment without a body, author, and email fails and returns an error Request body comment​[](https://shopify.dev/apps/store/data-protection/protected-customer-data) Comment resource Show comment properties comment.article\_​id:​134645308 A unique numeric identifier for the article that the comment belongs to. post ## /admin/api/2025-10/comments.​json ```bash curl -d '{"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}}' \ -X POST "https://your-development-store.myshopify.com/admin/api/2025-10/comments.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json" ``` {} ## Response JSON ```json HTTP/1.1 201 Created { "comment": { "id": 757536352, "body": "I like comments\nAnd I like posting them *RESTfully*.", "body_html": "

I like comments
\nAnd I like posting them RESTfully.

", "author": "Your name", "email": "your@email.com", "status": "pending", "article_id": 134645308, "blog_id": 241253187, "created_at": "2025-10-01T14:31:49-04:00", "updated_at": "2025-10-01T14:31:49-04:00", "ip": "107.20.160.121", "user_agent": null, "published_at": null } } ``` ### examples * #### Create a comment for an article of a blog using basic Textile markup ##### ```curl curl -d '{"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}}' \ -X POST "https://your-development-store.myshopify.com/admin/api/2025-10/comments.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json" ``` ##### ```remix const { admin, session } = await authenticate.admin(request); const comment = new admin.rest.resources.Comment({session: session}); comment.body = "I like comments\nAnd I like posting them *RESTfully*."; comment.author = "Your name"; comment.email = "your@email.com"; comment.ip = "107.20.160.121"; comment.blog_id = 241253187; comment.article_id = 134645308; await comment.save({ update: true, }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session comment = ShopifyAPI::Comment.new(session: test_session) comment.body = "I like comments\nAnd I like posting them *RESTfully*." comment.author = "Your name" comment.email = "your@email.com" comment.ip = "107.20.160.121" comment.blog_id = 241253187 comment.article_id = 134645308 comment.save! ``` ##### ```node // Session is built by the OAuth process const comment = new shopify.rest.Comment({session: session}); comment.body = "I like comments\nAnd I like posting them *RESTfully*."; comment.author = "Your name"; comment.email = "your@email.com"; comment.ip = "107.20.160.121"; comment.blog_id = 241253187; comment.article_id = 134645308; await comment.save({ update: true, }); ``` #### response ```json HTTP/1.1 201 Created{"comment":{"id":757536352,"body":"I like comments\nAnd I like posting them *RESTfully*.","body_html":"

I like comments
\nAnd I like posting them RESTfully.

","author":"Your name","email":"your@email.com","status":"pending","article_id":134645308,"blog_id":241253187,"created_at":"2025-10-01T14:31:49-04:00","updated_at":"2025-10-01T14:31:49-04: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 ##### ```curl curl -d '{"comment":{"article_id":134645308}}' \ -X POST "https://your-development-store.myshopify.com/admin/api/2025-10/comments.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json" ``` ##### ```remix const { admin, session } = await authenticate.admin(request); const comment = new admin.rest.resources.Comment({session: session}); comment.article_id = 134645308; await comment.save({ update: true, }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session comment = ShopifyAPI::Comment.new(session: test_session) comment.article_id = 134645308 comment.save! ``` ##### ```node // Session is built by the OAuth process const comment = new shopify.rest.Comment({session: session}); comment.article_id = 134645308; await comment.save({ update: true, }); ``` #### response ```json HTTP/1.1 422 Unprocessable Entity{"errors":{"author":["can't be blank"],"body":["can't be blank"],"email":["must be formatted as an email"]}} ``` *** ## postApproves a comment [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/mutations/commentApprove?example=approves-a-comment) [commentApprove](https://shopify.dev/docs/api/admin-graphql/latest/mutations/commentApprove?example=approves-a-comment) Approves a comment ### Parameters *** api\_version string required *** comment\_id string required *** ### Examples Approve a comment and publish it to the blog Path parameters comment\_​id=​653537639 string required post ## /admin/api/2025-10/comments/653537639/approve.​json ```bash curl -d '{}' \ -X POST "https://your-development-store.myshopify.com/admin/api/2025-10/comments/653537639/approve.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json" ``` {} ## Response JSON ```json HTTP/1.1 200 OK { "published_at": "2025-10-01T14:31:44-04:00", "status": "published", "id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "article_id": 134645308, "blog_id": 241253187, "created_at": "2025-10-01T14:30:56-04:00", "updated_at": "2025-10-01T14:31:44-04: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" } ``` ### examples * #### Approve a comment and publish it to the blog ##### ```curl curl -d '{}' \ -X POST "https://your-development-store.myshopify.com/admin/api/2025-10/comments/653537639/approve.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json" ``` ##### ```remix const { admin, session } = await authenticate.admin(request); const comment = new admin.rest.resources.Comment({session: session}); comment.id = 653537639; await comment.approve({}); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session comment = ShopifyAPI::Comment.new(session: test_session) comment.id = 653537639 comment.approve( session: test_session, ) ``` ##### ```node // Session is built by the OAuth process const comment = new shopify.rest.Comment({session: session}); comment.id = 653537639; await comment.approve({}); ``` #### response ```json HTTP/1.1 200 OK{"published_at":"2025-10-01T14:31:44-04:00","status":"published","id":653537639,"body":"Hi author, I really _like_ what you're doing there.","body_html":"

Hi author, I really like what you're doing there.

","author":"Soleone","email":"soleone@example.net","article_id":134645308,"blog_id":241253187,"created_at":"2025-10-01T14:30:56-04:00","updated_at":"2025-10-01T14:31:44-04: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"} ``` *** ## postMarks a comment as not spam [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/mutations/commentNotSpam?example=marks-a-comment-as-not-spam) [commentNotSpam](https://shopify.dev/docs/api/admin-graphql/latest/mutations/commentNotSpam?example=marks-a-comment-as-not-spam) Marks a comment as not spam ### Parameters *** api\_version string required *** comment\_id string required *** ### Examples Mark a comment as not spam, restoring it to an unapproved or published state Path parameters comment\_​id=​653537639 string required post ## /admin/api/2025-10/comments/653537639/not\_​spam.​json ```bash curl -d '{}' \ -X POST "https://your-development-store.myshopify.com/admin/api/2025-10/comments/653537639/not_spam.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json" ``` {} ## Response JSON ```json HTTP/1.1 200 OK { "published_at": "2025-10-01T14:31:54-04:00", "status": "published", "id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "article_id": 134645308, "blog_id": 241253187, "created_at": "2025-10-01T14:30:56-04:00", "updated_at": "2025-10-01T14:31:54-04: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" } ``` ### examples * #### Mark a comment as not spam, restoring it to an unapproved or published state ##### ```curl curl -d '{}' \ -X POST "https://your-development-store.myshopify.com/admin/api/2025-10/comments/653537639/not_spam.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json" ``` ##### ```remix const { admin, session } = await authenticate.admin(request); const comment = new admin.rest.resources.Comment({session: session}); comment.id = 653537639; await comment.not_spam({}); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session comment = ShopifyAPI::Comment.new(session: test_session) comment.id = 653537639 comment.not_spam( session: test_session, ) ``` ##### ```node // Session is built by the OAuth process const comment = new shopify.rest.Comment({session: session}); comment.id = 653537639; await comment.not_spam({}); ``` #### response ```json HTTP/1.1 200 OK{"published_at":"2025-10-01T14:31:54-04:00","status":"published","id":653537639,"body":"Hi author, I really _like_ what you're doing there.","body_html":"

Hi author, I really like what you're doing there.

","author":"Soleone","email":"soleone@example.net","article_id":134645308,"blog_id":241253187,"created_at":"2025-10-01T14:30:56-04:00","updated_at":"2025-10-01T14:31:54-04: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"} ``` *** ## postRemoves a comment [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/mutations/commentDelete?example=removes-a-comment) [commentDelete](https://shopify.dev/docs/api/admin-graphql/latest/mutations/commentDelete?example=removes-a-comment) Removes a comment ### Parameters *** api\_version string required *** comment\_id string required *** ### Examples Remove a comment Path parameters comment\_​id=​653537639 string required post ## /admin/api/2025-10/comments/653537639/remove.​json ```bash curl -d '{}' \ -X POST "https://your-development-store.myshopify.com/admin/api/2025-10/comments/653537639/remove.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json" ``` {} ## Response JSON ```json HTTP/1.1 200 OK { "published_at": null, "status": "removed", "id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "article_id": 134645308, "blog_id": 241253187, "created_at": "2025-10-01T14:30:56-04:00", "updated_at": "2025-10-01T14:31:36-04: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" } ``` ### examples * #### Remove a comment ##### ```curl curl -d '{}' \ -X POST "https://your-development-store.myshopify.com/admin/api/2025-10/comments/653537639/remove.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json" ``` ##### ```remix const { admin, session } = await authenticate.admin(request); const comment = new admin.rest.resources.Comment({session: session}); comment.id = 653537639; await comment.remove({}); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session comment = ShopifyAPI::Comment.new(session: test_session) comment.id = 653537639 comment.remove( session: test_session, ) ``` ##### ```node // Session is built by the OAuth process const comment = new shopify.rest.Comment({session: session}); comment.id = 653537639; await comment.remove({}); ``` #### response ```json HTTP/1.1 200 OK{"published_at":null,"status":"removed","id":653537639,"body":"Hi author, I really _like_ what you're doing there.","body_html":"

Hi author, I really like what you're doing there.

","author":"Soleone","email":"soleone@example.net","article_id":134645308,"blog_id":241253187,"created_at":"2025-10-01T14:30:56-04:00","updated_at":"2025-10-01T14:31:36-04: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"} ``` *** ## postRestores a previously removed commentdeprecated Restores a previously removed comment ### Parameters *** api\_version string required *** comment\_id string required *** ### Examples Restore a removed comment Path parameters comment\_​id=​653537639 string required post ## /admin/api/2025-10/comments/653537639/restore.​json ```bash curl -d '{}' \ -X POST "https://your-development-store.myshopify.com/admin/api/2025-10/comments/653537639/restore.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json" ``` {} ## Response JSON ```json HTTP/1.1 200 OK { "published_at": "2025-10-01T14:31:47-04:00", "status": "published", "id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "article_id": 134645308, "blog_id": 241253187, "created_at": "2025-10-01T14:30:56-04:00", "updated_at": "2025-10-01T14:31:47-04: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" } ``` ### examples * #### Restore a removed comment ##### ```curl curl -d '{}' \ -X POST "https://your-development-store.myshopify.com/admin/api/2025-10/comments/653537639/restore.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json" ``` ##### ```remix const { admin, session } = await authenticate.admin(request); const comment = new admin.rest.resources.Comment({session: session}); comment.id = 653537639; await comment.restore({}); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session comment = ShopifyAPI::Comment.new(session: test_session) comment.id = 653537639 comment.restore( session: test_session, ) ``` ##### ```node // Session is built by the OAuth process const comment = new shopify.rest.Comment({session: session}); comment.id = 653537639; await comment.restore({}); ``` #### response ```json HTTP/1.1 200 OK{"published_at":"2025-10-01T14:31:47-04:00","status":"published","id":653537639,"body":"Hi author, I really _like_ what you're doing there.","body_html":"

Hi author, I really like what you're doing there.

","author":"Soleone","email":"soleone@example.net","article_id":134645308,"blog_id":241253187,"created_at":"2025-10-01T14:30:56-04:00","updated_at":"2025-10-01T14:31:47-04: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"} ``` *** ## postMarks a comment as spam [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/mutations/commentSpam?example=marks-a-comment-as-spam) [commentSpam](https://shopify.dev/docs/api/admin-graphql/latest/mutations/commentSpam?example=marks-a-comment-as-spam) Marks a comment as spam ### Parameters *** api\_version string required *** comment\_id string required *** ### Examples Mark a comment as spam Path parameters comment\_​id=​653537639 string required post ## /admin/api/2025-10/comments/653537639/spam.​json ```bash curl -d '{}' \ -X POST "https://your-development-store.myshopify.com/admin/api/2025-10/comments/653537639/spam.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json" ``` {} ## Response JSON ```json HTTP/1.1 200 OK { "published_at": null, "status": "spam", "id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "article_id": 134645308, "blog_id": 241253187, "created_at": "2025-10-01T14:30:56-04:00", "updated_at": "2025-10-01T14:31:42-04: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" } ``` ### examples * #### Mark a comment as spam ##### ```curl curl -d '{}' \ -X POST "https://your-development-store.myshopify.com/admin/api/2025-10/comments/653537639/spam.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json" ``` ##### ```remix const { admin, session } = await authenticate.admin(request); const comment = new admin.rest.resources.Comment({session: session}); comment.id = 653537639; await comment.spam({}); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session comment = ShopifyAPI::Comment.new(session: test_session) comment.id = 653537639 comment.spam( session: test_session, ) ``` ##### ```node // Session is built by the OAuth process const comment = new shopify.rest.Comment({session: session}); comment.id = 653537639; await comment.spam({}); ``` #### response ```json HTTP/1.1 200 OK{"published_at":null,"status":"spam","id":653537639,"body":"Hi author, I really _like_ what you're doing there.","body_html":"

Hi author, I really like what you're doing there.

","author":"Soleone","email":"soleone@example.net","article_id":134645308,"blog_id":241253187,"created_at":"2025-10-01T14:30:56-04:00","updated_at":"2025-10-01T14:31:42-04: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"} ``` *** ## getRetrieves a list of comments [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/queries/comments?example=retrieves-a-list-of-comments) [comments](https://shopify.dev/docs/api/admin-graphql/latest/queries/comments?example=retrieves-a-list-of-comments) Retrieves a list of comments. **Note:** This endpoint implements pagination by using links that are provided in the response header. To learn more, refer to [Make paginated requests to the REST Admin API](https://shopify.dev/api/usage/pagination-rest). ### Parameters *** api\_version string required *** created\_at\_max Show comments created before date (format: 2014-04-25T16:15:47-04:00). *** created\_at\_min Show comments created after date (format: 2014-04-25T16:15:47-04:00). *** fields Show only certain fields, specified by a comma-separated list of field names. *** limit ≤ 250 default 50 The maximum number of results to retrieve. *** published\_at\_max Show comments published 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\_status default any Filter results by their published status. Show published\_status properties * **published**: Show only published comments. * **unpublished**: Show only unpublished comments. * **any**: Show comments of any published status. *** since\_id Restrict results to after the specified ID. *** status Filter results by their status. Show status properties * **pending**: Show only pending comments. * **published**: Show only published comments. * **unapproved**: Show only unapproved comments. *** updated\_at\_max Show comments last updated 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). *** ### Examples Retrieve all comments for this shop after the specified ID Query parameters since\_​id=​118373535 Restrict results to after the specified ID. Retrieve all the comments for a certain article of a blog Query parameters article\_​id=​134645308 A unique numeric identifier for the article that the comment belongs to. blog\_​id=​241253187 A unique numeric identifier for the blog containing the article that the comment belongs to. Retrieve all the comments for all the articles of a blog Query parameters blog\_​id=​241253187 A unique numeric identifier for the blog containing the article that the comment belongs to. Retrieve all the comments for this shop get ## /admin/api/2025-10/comments.​json?since\_​id=​118373535 ```bash curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-10/comments.json?since_id=118373535" \ -H "X-Shopify-Access-Token: {access_token}" ``` {} ## Response JSON ```json HTTP/1.1 200 OK { "comments": [ { "id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "unapproved", "article_id": 134645308, "blog_id": 241253187, "created_at": "2025-10-01T14:30:56-04:00", "updated_at": "2025-10-01T14:30:56-04: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 } ] } ``` ### examples * #### Retrieve all comments for this shop after the specified ID ##### ```curl curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-10/comments.json?since_id=118373535" \ -H "X-Shopify-Access-Token: {access_token}" ``` ##### ```remix await admin.rest.resources.Comment.all({ session: session, since_id: "118373535", }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session ShopifyAPI::Comment.all( session: test_session, since_id: "118373535", ) ``` ##### ```node // Session is built by the OAuth process await shopify.rest.Comment.all({ session: session, since_id: "118373535", }); ``` #### response ```json HTTP/1.1 200 OK{"comments":[{"id":653537639,"body":"Hi author, I really _like_ what you're doing there.","body_html":"

Hi author, I really like what you're doing there.

","author":"Soleone","email":"soleone@example.net","status":"unapproved","article_id":134645308,"blog_id":241253187,"created_at":"2025-10-01T14:30:56-04:00","updated_at":"2025-10-01T14:30:56-04: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 a certain article of a blog ##### ```curl curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-10/comments.json?article_id=134645308&blog_id=241253187" \ -H "X-Shopify-Access-Token: {access_token}" ``` ##### ```remix await admin.rest.resources.Comment.all({ session: session, article_id: "134645308", blog_id: "241253187", }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session ShopifyAPI::Comment.all( session: test_session, article_id: "134645308", blog_id: "241253187", ) ``` ##### ```node // Session is built by the OAuth process await shopify.rest.Comment.all({ session: session, article_id: "134645308", blog_id: "241253187", }); ``` #### response ```json HTTP/1.1 200 OK{"comments":[{"id":653537639,"body":"Hi author, I really _like_ what you're doing there.","body_html":"

Hi author, I really like what you're doing there.

","author":"Soleone","email":"soleone@example.net","status":"unapproved","article_id":134645308,"blog_id":241253187,"created_at":"2025-10-01T14:30:56-04:00","updated_at":"2025-10-01T14:30:56-04: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":"

Hi author, I really like what you're doing there.

","author":"Soleone","email":"soleone@example.net","status":"published","article_id":134645308,"blog_id":241253187,"created_at":"2025-10-01T14:30:56-04:00","updated_at":"2025-10-01T14:30:56-04: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 ##### ```curl curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-10/comments.json?blog_id=241253187" \ -H "X-Shopify-Access-Token: {access_token}" ``` ##### ```remix await admin.rest.resources.Comment.all({ session: session, blog_id: "241253187", }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session ShopifyAPI::Comment.all( session: test_session, blog_id: "241253187", ) ``` ##### ```node // Session is built by the OAuth process await shopify.rest.Comment.all({ session: session, blog_id: "241253187", }); ``` #### response ```json HTTP/1.1 200 OK{"comments":[{"id":653537639,"body":"Hi author, I really _like_ what you're doing there.","body_html":"

Hi author, I really like what you're doing there.

","author":"Soleone","email":"soleone@example.net","status":"unapproved","article_id":134645308,"blog_id":241253187,"created_at":"2025-10-01T14:30:56-04:00","updated_at":"2025-10-01T14:30:56-04: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":"

Hi author, I really like what you're doing there.

","author":"Soleone","email":"soleone@example.net","status":"published","article_id":134645308,"blog_id":241253187,"created_at":"2025-10-01T14:30:56-04:00","updated_at":"2025-10-01T14:30:56-04: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 ##### ```curl curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-10/comments.json" \ -H "X-Shopify-Access-Token: {access_token}" ``` ##### ```remix await admin.rest.resources.Comment.all({ session: session, }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session ShopifyAPI::Comment.all( session: test_session, ) ``` ##### ```node // Session is built by the OAuth process await shopify.rest.Comment.all({ session: session, }); ``` #### response ```json HTTP/1.1 200 OK{"comments":[{"id":653537639,"body":"Hi author, I really _like_ what you're doing there.","body_html":"

Hi author, I really like what you're doing there.

","author":"Soleone","email":"soleone@example.net","status":"unapproved","article_id":134645308,"blog_id":241253187,"created_at":"2025-10-01T14:30:56-04:00","updated_at":"2025-10-01T14:30:56-04: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":"

Hi author, I really like what you're doing there.

","author":"Soleone","email":"soleone@example.net","status":"published","article_id":134645308,"blog_id":241253187,"created_at":"2025-10-01T14:30:56-04:00","updated_at":"2025-10-01T14:30:56-04: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}]} ``` *** ## getRetrieves a single comment by its ID [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/queries/comment?example=retrieves-a-single-comment-by-its-id) [comment](https://shopify.dev/docs/api/admin-graphql/latest/queries/comment?example=retrieves-a-single-comment-by-its-id) Retrieves a single comment by its ID ### Parameters *** api\_version string required *** comment\_id string required *** fields Show only certain fields, specified by a comma-separated list of field names. *** ### Examples Retrieve a single comment Path parameters comment\_​id=​118373535 string required get ## /admin/api/2025-10/comments/118373535.​json ```bash curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-10/comments/118373535.json" \ -H "X-Shopify-Access-Token: {access_token}" ``` {} ## Response JSON ```json HTTP/1.1 200 OK { "comment": { "id": 118373535, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "published", "article_id": 134645308, "blog_id": 241253187, "created_at": "2025-10-01T14:30:56-04:00", "updated_at": "2025-10-01T14:30:56-04: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 } } ``` ### examples * #### Retrieve a single comment ##### ```curl curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-10/comments/118373535.json" \ -H "X-Shopify-Access-Token: {access_token}" ``` ##### ```remix await admin.rest.resources.Comment.find({ session: session, id: 118373535, }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session ShopifyAPI::Comment.find( session: test_session, id: 118373535, ) ``` ##### ```node // Session is built by the OAuth process await shopify.rest.Comment.find({ session: session, id: 118373535, }); ``` #### response ```json HTTP/1.1 200 OK{"comment":{"id":118373535,"body":"Hi author, I really _like_ what you're doing there.","body_html":"

Hi author, I really like what you're doing there.

","author":"Soleone","email":"soleone@example.net","status":"published","article_id":134645308,"blog_id":241253187,"created_at":"2025-10-01T14:30:56-04:00","updated_at":"2025-10-01T14:30:56-04: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}} ``` *** ## getRetrieves a count of comments [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/queries/article) [article](https://shopify.dev/docs/api/admin-graphql/latest/queries/article) Retrieves a count of comments ### Parameters *** api\_version string required *** created\_at\_max Count comments created before date (format: 2014-04-25T16:15:47-04:00). *** created\_at\_min Count comments created 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\_at\_min Count comments published after date (format: 2014-04-25T16:15:47-04:00). *** published\_status default any Retrieve a count of comments with a given published status. Show published\_status properties * **published**: Count only published comments. * **unpublished**: Count only unpublished comments. * **any**: Count comments of any published status. *** status Retrieve a count of comments with a given status. Show status properties * **pending**: Count pending comments. * **published**: Count published comments. * **unapproved**: Count unapproved comments. *** updated\_at\_max Count comments last updated 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). *** ### Examples Count all comments for a certain article of a blog Query parameters article\_​id=​134645308 A unique numeric identifier for the article that the comment belongs to. blog\_​id=​241253187 A unique numeric identifier for the blog containing the article that the comment belongs to. Count all the comments for all the articles of a blog Query parameters blog\_​id=​241253187 A unique numeric identifier for the blog containing the article that the comment belongs to. Count all the comments for this shop get ## /admin/api/2025-10/comments/count.​json?article\_​id=​134645308\&blog\_​id=​241253187 ```bash curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-10/comments/count.json?article_id=134645308&blog_id=241253187" \ -H "X-Shopify-Access-Token: {access_token}" ``` {} ## Response JSON ```json HTTP/1.1 200 OK { "count": 2 } ``` ### examples * #### Count all comments for a certain article of a blog ##### ```curl curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-10/comments/count.json?article_id=134645308&blog_id=241253187" \ -H "X-Shopify-Access-Token: {access_token}" ``` ##### ```remix await admin.rest.resources.Comment.count({ session: session, article_id: "134645308", blog_id: "241253187", }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session ShopifyAPI::Comment.count( session: test_session, article_id: "134645308", blog_id: "241253187", ) ``` ##### ```node // Session is built by the OAuth process await shopify.rest.Comment.count({ session: session, article_id: "134645308", blog_id: "241253187", }); ``` #### response ```json HTTP/1.1 200 OK{"count":2} ``` * #### Count all the comments for all the articles of a blog ##### ```curl curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-10/comments/count.json?blog_id=241253187" \ -H "X-Shopify-Access-Token: {access_token}" ``` ##### ```remix await admin.rest.resources.Comment.count({ session: session, blog_id: "241253187", }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session ShopifyAPI::Comment.count( session: test_session, blog_id: "241253187", ) ``` ##### ```node // Session is built by the OAuth process await shopify.rest.Comment.count({ session: session, blog_id: "241253187", }); ``` #### response ```json HTTP/1.1 200 OK{"count":2} ``` * #### Count all the comments for this shop ##### ```curl curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-10/comments/count.json" \ -H "X-Shopify-Access-Token: {access_token}" ``` ##### ```remix await admin.rest.resources.Comment.count({ session: session, }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session ShopifyAPI::Comment.count( session: test_session, ) ``` ##### ```node // Session is built by the OAuth process await shopify.rest.Comment.count({ session: session, }); ``` #### response ```json HTTP/1.1 200 OK{"count":2} ``` *** ## putUpdates a comment of an articledeprecated Updates a comment of an article ### Parameters *** api\_version string required *** comment\_id string required *** ### Examples Update the body of an existing comment Path parameters comment\_​id=​118373535 string required Request body comment​[](https://shopify.dev/apps/store/data-protection/protected-customer-data) Comment resource Show comment properties comment.id:​118373535 read-only A unique numeric identifier for the comment. comment.body:​"You can even update through a web service." The basic [Textile markup](https://en.wikipedia.org/wiki/Textile_\(markup_language\)) of a comment. comment.author:​"Your new name"[](https://shopify.dev/apps/store/data-protection/protected-customer-data) The name of the author of the comment. comment.email:​"your\@updated-email.com"[](https://shopify.dev/apps/store/data-protection/protected-customer-data) The email address of the author of the comment. comment.published\_​at:​"2025-10-01T18:31:37.753Z" The date and time ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format) when the comment was published. put ## /admin/api/2025-10/comments/118373535.​json ```bash curl -d '{"comment":{"id":118373535,"body":"You can even update through a web service.","author":"Your new name","email":"your@updated-email.com","published_at":"2025-10-01T18:31:37.753Z"}}' \ -X PUT "https://your-development-store.myshopify.com/admin/api/2025-10/comments/118373535.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json" ``` {} ## Response JSON ```json HTTP/1.1 200 OK { "comment": { "author": "Your new name", "body": "You can even update through a web service.", "email": "your@updated-email.com", "published_at": "2025-10-01T14:31:37-04:00", "id": 118373535, "body_html": "

You can even update through a web service.

", "status": "published", "article_id": 134645308, "blog_id": 241253187, "created_at": "2025-10-01T14:30:56-04:00", "updated_at": "2025-10-01T14:31:38-04: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" } } ``` ### examples * #### Update the body of an existing comment ##### ```curl curl -d '{"comment":{"id":118373535,"body":"You can even update through a web service.","author":"Your new name","email":"your@updated-email.com","published_at":"2025-10-01T18:31:37.753Z"}}' \ -X PUT "https://your-development-store.myshopify.com/admin/api/2025-10/comments/118373535.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json" ``` ##### ```remix const { admin, session } = await authenticate.admin(request); const comment = new admin.rest.resources.Comment({session: session}); comment.id = 118373535; comment.body = "You can even update through a web service."; comment.author = "Your new name"; comment.email = "your@updated-email.com"; comment.published_at = "2025-10-01T18:31:37.753Z"; await comment.save({ update: true, }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session comment = ShopifyAPI::Comment.new(session: test_session) comment.id = 118373535 comment.body = "You can even update through a web service." comment.author = "Your new name" comment.email = "your@updated-email.com" comment.published_at = "2025-10-01T18:31:37.753Z" comment.save! ``` ##### ```node // Session is built by the OAuth process const comment = new shopify.rest.Comment({session: session}); comment.id = 118373535; comment.body = "You can even update through a web service."; comment.author = "Your new name"; comment.email = "your@updated-email.com"; comment.published_at = "2025-10-01T18:31:37.753Z"; await comment.save({ update: true, }); ``` #### response ```json HTTP/1.1 200 OK{"comment":{"author":"Your new name","body":"You can even update through a web service.","email":"your@updated-email.com","published_at":"2025-10-01T14:31:37-04:00","id":118373535,"body_html":"

You can even update through a web service.

","status":"published","article_id":134645308,"blog_id":241253187,"created_at":"2025-10-01T14:30:56-04:00","updated_at":"2025-10-01T14:31:38-04: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"}} ```