Create Email Comment
POST
/api/v1/workspaces/{workspace_id}/emails/{email_id}/email_comments
const url = 'https://example.com/%7B%7Bapp_url%7D/api/v1/workspaces/1/emails/1/email_comments';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"locale":"ar-SA","parent_id":1,"body":"<p>Can we change the hero image?</p>","pin_data":{"id":"12345","component_instance_id":"12345","branch_key":"a_branch_key","coordinates":{"center_offset_x_px":0.5,"y":0.5}}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/%7B%7Bapp_url%7D/api/v1/workspaces/1/emails/1/email_comments \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "locale": "ar-SA", "parent_id": 1, "body": "<p>Can we change the hero image?</p>", "pin_data": { "id": "12345", "component_instance_id": "12345", "branch_key": "a_branch_key", "coordinates": { "center_offset_x_px": 0.5, "y": 0.5 } } }'Creates a new email comment.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”workspace_id
required
integer
Workspace ID
email_id
required
integer
Email ID
Request Body
Section titled “Request Body”Media typeapplication/json
object
locale
required
string
Example
en-USparent_id
The ID of the parent comment to reply to. Omit to create a top-level comment.
integer
Example
1body
required
The content of the comment.
string
Example
<p>Can we change the hero image?</p>pin_data
object
id
required
string
Example
12345component_instance_id
string
Example
12345branch_key
string
Example
a_branch_keycoordinates
required
object
center_offset_x_px
required
The horizontal offset of the pin from the center of the component, in pixels.
number
Example
0.5y
required
The vertical position of the pin, as a percentage (0–1) from the top of the component.
number
Example
0.5Responses
Section titled “Responses”Successful
Media typeapplication/json
object
id
required
integer
email_id
required
integer
ai_review_id
required
integer
locale
required
string
author_type
string
author
required
parent_id
required
integer
pin_data
required
object
id
required
string
component_instance_id
string
branch_key
string
coordinates
required
object
center_offset_x_px
required
The horizontal offset of the pin from the center of the component, in pixels.
number
y
required
The vertical position of the pin, as a percentage (0–1) from the top of the component.
number
body
required
string
resolved
required
boolean
resolver_id
required
integer
resolver
required
created_at
required
string format: date-time
Example
{ "id": 12345, "email_id": 12345, "ai_review_id": 54321, "locale": "ar-SA", "author_type": "User", "author": { "type": "User", "id": 12345, "first_name": "John", "last_name": "Smith", "profile_image_url": "https://example.com/profile.jpg" }, "parent_id": 12345, "pin_data": { "id": "12345", "component_instance_id": "12345", "branch_key": "a_branch_key", "coordinates": { "center_offset_x_px": 0.5, "y": 0.5 } }, "body": "This is a comment", "resolved": false, "resolver_id": 12345, "resolver": { "type": "User", "id": 12345, "first_name": "John", "last_name": "Smith", "profile_image_url": "https://example.com/profile.jpg" }, "created_at": "2023-08-23T10:30:00.000Z"}Unauthorized
Media typeapplication/json
object
message
required
string
Example
{ "message": "Record not found"}Forbidden
Media typeapplication/json
object
message
required
string
Example
{ "message": "Record not found"}Unprocessable Entity
Media typeapplication/json
object
message
required
string
errors
required
object
key
additional properties
Array<string>
Example
{ "errors": { "username": [ "Username is required.", "Username must be unique." ], "email": [ "Invalid email format." ] }}