Skip to content

Update a blog comment

PUT
/stores/{storeRef}/blog/comments/{commentId}
curl --request PUT \
--url https://apibase.ecomweb.app/api/v1/stores/example/blog/comments/1 \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '{ "is_approved": true, "content": "example", "author_name": "example", "author_email": "example", "author_website": "example" }'

Updates the fields you send, including the commenter details and the approval state.

Required scopes: write:blog

commentId
required
integer

The comment ID.

storeRef
required
string

The store’s ref, as returned by GET /stores.

Media typeapplication/json
object
is_approved

Whether the comment is approved and visible. Defaults to true for comments created through the API.

boolean
content

Comment text.

string
author_name

Name of the commenter, up to 100 characters.

string
<= 100 characters
author_email

Email of the commenter.

string
author_website

Website of the commenter, up to 255 characters.

string
<= 255 characters

Example generated

{
"is_approved": true,
"content": "example",
"author_name": "example",
"author_email": "example",
"author_website": "example"
}
Media typeapplication/json
object
id
required

Comment ID.

number
blog_post_id
required

ID of the post the comment belongs to.

number
nullable
parent_comment_id
required

ID of the comment this one replies to, or null for a top-level comment.

number
nullable
author_name
required

Name of the commenter.

string
author_email
required

Email of the commenter.

string
author_website

Website of the commenter, or null.

string
nullable
content
required

Comment text.

string
is_approved

Whether the comment is approved and visible on the storefront.

boolean
nullable
created_at

When the comment was created, as an ISO 8601 timestamp.

string
nullable
post_title

Title of the post the comment belongs to. Present on the store-wide comment list only.

string
nullable

Example generated

{
"id": 1,
"blog_post_id": 1,
"parent_comment_id": 1,
"author_name": "example",
"author_email": "example",
"author_website": "example",
"content": "example",
"is_approved": true,
"created_at": "example",
"post_title": "example"
}

The request is malformed or failed validation.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The key is missing, invalid, revoked or expired.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The key may not do this: a missing scope, a readonly key, a publishable key on a Store API route, or a disallowed origin.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The resource does not exist in this store.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}