Update Email
const url = 'https://example.com/%7B%7Bapp_url%7D/api/v1/workspaces/1/emails/1';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","default_locale":"en-GB","locales":["en-GB"],"link_tracking_profile_id":1,"project_id":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://example.com/%7B%7Bapp_url%7D/api/v1/workspaces/1/emails/1 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "default_locale": "en-GB", "locales": [ "en-GB" ], "link_tracking_profile_id": 1, "project_id": 1 }'Updates an email.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Workspace ID
Email ID
Request Body
Section titled “Request Body”object
A 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-GBThe ID of the Link Tracking Profile to use for tracking links in this email. If null, no link tracking is applied.
Example
1The ID of the project to move this email to. Must be a project the user has access to in the same workspace.
Example
1Responses
Section titled “Responses”Successful
object
A 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
{ "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": "en-GB", "locales": [ "en-GB" ], "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, "translation_in_progress": false, "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
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." ] }}