send test email
const url = 'https://example.com/%7B%7Bapp_url%7D/api/v1/workspaces/1/test_emails';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"recipient_ids":[1],"test_list_ids":[1],"conditional_selections":[{"conditional_id":12345,"mode":"all","branch_key":"gold"}],"email_id":1,"locale":"en-GB"}'};
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/test_emails \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "recipient_ids": [ 1 ], "test_list_ids": [ 1 ], "conditional_selections": [ { "conditional_id": 12345, "mode": "all", "branch_key": "gold" } ], "email_id": 1, "locale": "en-GB" }'Sends a test email.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Workspace ID
Request Body
Section titled “Request Body”object
IDs of users to send the test email to.
IDs of test lists to send the test email to.
Conditional branch selections to use when rendering the test email.
object
The id of a saved conditional, or an inline conditional addressed by its owner: inline:<component_instance_id> for a component instance, or inline:subject / inline:preheader.
Example
12345Example
branchExample
goldA BCP 47 language tag identifying the language and region of a piece of content. Must carry both a language and a region subtag, and must be in canonical case (lowercase language, titlecase script, uppercase region) — en-GB, not en-gb or en_GB. The region may be a UN M.49 code, so en-001 (world) is valid.
Example
en-GBResponses
Section titled “Responses”Successful
object
object
The id of a saved conditional, or an inline conditional addressed by its owner: inline:<component_instance_id> for a component instance, or inline:subject / inline:preheader.
Example
{ "id": 12345, "email_id": 12345, "locale": "en-US", "organization_id": 12345, "recipient_ids": [ 12345 ], "test_list_ids": [ 12345 ], "conditional_selections": [ { "conditional_id": 12345, "mode": "all", "branch_key": "gold" } ], "created_at": "2023-08-23T10:30:00.000Z", "updated_at": "2023-08-23T10:30:00.000Z"}Unauthorized
object
Example
{ "message": "Record not found"}Forbidden
object
Example
{ "message": "Record not found"}Not Found
object
Example
{ "message": "Record not found"}Unprocessable Entity
object
object
Example
{ "errors": { "username": [ "Username is required.", "Username must be unique." ], "email": [ "Invalid email format." ] }}