Create Email
POST
/api/v1/workspaces/{workspace_id}/emails
const url = 'https://example.com/%7B%7Bapp_url%7D/api/v1/workspaces/1/emails';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"Welcome Email","email_design_system_id":1,"default_locale":"ar-SA","locales":["ar-SA"],"project_id":1,"ai_agent_id":1,"brand_profile_id":1,"link_tracking_profile_id":1,"layout_id":1}'};
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 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "Welcome Email", "email_design_system_id": 1, "default_locale": "ar-SA", "locales": [ "ar-SA" ], "project_id": 1, "ai_agent_id": 1, "brand_profile_id": 1, "link_tracking_profile_id": 1, "layout_id": 1 }'Creates a new Email.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”workspace_id
required
integer
Workspace ID
Request Body
Section titled “Request Body”Media typeapplication/json
object
name
required
The name of the email.
string
Example
Welcome Emailemail_design_system_id
required
The ID of the Email Design System to use for this email.
integer
Example
1default_locale
string
Example
en-USlocales
Array<string>
project_id
required
The ID of the Project this email belongs to.
integer
Example
1ai_agent_id
integer
brand_profile_id
The ID of the Brand Profile to apply to this email. Must belong to the selected Email Design System.
integer
Example
1link_tracking_profile_id
The ID of the Link Tracking Profile to use for tracking links in this email. If null, no link tracking is applied.
integer
Example
1layout_id
The ID of the Layout to use for this email. Must belong to the selected Email Design System.
integer
Example
1Responses
Section titled “Responses”Successful
Media typeapplication/json
object
id
required
integer
status
required
string
name
required
string
project_id
required
integer
created_at
required
string format: date-time
organization_id
required
integer
email_design_system_id
required
integer
default_locale
required
string
locales
required
Array<string>
updated_at
required
string format: date-time
last_updated_by
required
ai_edit_in_progress
required
boolean
ai_agent_id
required
integer
brand_profile_id
required
integer
link_tracking_profile_id
required
integer
published_at
required
string format: date-time
screenshot_url
required
string
Example
{ "id": 12345, "status": "draft", "name": "My Email", "project_id": 12345, "created_at": "2023-08-23T10:30:00.000Z", "organization_id": 12345, "email_design_system_id": 12345, "default_locale": "ar-SA", "locales": [ "ar-SA" ], "updated_at": "2023-08-23T10:30:00.000Z", "last_updated_by": { "type": "User", "id": 12345, "first_name": "John", "last_name": "Smith", "profile_image_url": "https://example.com/profile.jpg" }, "ai_edit_in_progress": false, "ai_agent_id": 12345, "brand_profile_id": 12345, "link_tracking_profile_id": 12345, "published_at": "2023-08-23T10:30:00.000Z", "screenshot_url": "https://www.example.com/screenshot.png"}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." ] }}