Update an email draft
PUT /email_drafts/{uuid}
/email_drafts/{uuid}Changes a draft. Only the fields you send change; null or an empty list clears a field. revision is required and must be the one you last read.
When to use: To correct or complete a draft the user already has: new text, recipients, subject or attachments.
When not to use: To create a draft, use create_email_draft. To send it, use send_email or schedule_email with draft.
Side effects: Saves the draft and raises its revision. Nothing leaves the mailbox. Attachments removed from the list are deleted; new ones start counting against the CRM Files storage.
Filters: Read the draft with get_email_draft first to get its revision. If the user edits the same draft in the app at the same time, the one that saves second gets 409 draft_conflict.
Permissions: Requires a CRM seat and the crm.contacts_companies.write capability. Drafts are private: only their author can read or change them. The sender must be a mailbox the user can send from: one of their own or one shared with them (see list_email_senders). Writing from an opportunity also requires crm.opportunities.read and the Work level on its pipeline.
Value for the X-Auth-Token header parameter.
In: header
Path Parameters
UUID of the draft.
uuidThe updated EmailDraft resource
TypeScript Definitions
Use the request body type in TypeScript.
Email drafts of the public API (fase 5). Generated from the proposal by fase-5/tools/gen_email_sending_api.py; the
texts are the proposal's. Every operation checks the CRM access in its provider or processor before anything else,
because API Platform evaluates security after the provider.
A draft belongs to its author: for anyone else it answers 404 email_draft_not_found. create_email_draft and
update_email_draft answer without body_html (the panel's use case returns the draft without its body, so that an
autosave never echoes megabytes); get_email_draft has it.
Response Body
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
curl -X PUT "https://api.easymailing.com/email_drafts/3a9e1f53-0000-4000-8000-6c474d08b1a4" \ -H "X-Auth-Token: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "revision": 0, "sender_uuid": "6fd60e87-ecde-4069-8fdb-aebbacafea6d", "record": "/entity/1", "mode": "compose", "source_email": "/entity/1", "to": [ "string" ], "cc": [ "string" ], "bcc": [ "string" ], "subject": "string", "body_html": "string", "forwarded_attachment_ids": [ "string" ], "attachment_ids": [ "string" ] }'{ "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f", "revision": 0, "sender_uuid": "6fd60e87-ecde-4069-8fdb-aebbacafea6d", "record": "/entity/1", "record_type": "contact", "record_name": "string", "mode": "compose", "source_email": "/entity/1", "to": [ "string" ], "cc": [ "string" ], "bcc": [ "string" ], "subject": "string", "forwarded_attachment_ids": [ "string" ], "attachments": [ {} ], "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z"}