Replace the draft of an email sequence
PUT /email_sequences/{uuid}/draft
/email_sequences/{uuid}/draftReplaces the title and the whole draft of a sequence: sending options, sender, exit rules and ALL its steps. The draft may be incomplete; what stops it from being published is only checked by the validation and the publication.
When to use: To write or change a sequence: read it with get_email_sequence, change what you need and send back everything, with the draft_version you read as expected_draft_version.
When not to use: It is a full replacement, not a partial update: any step you leave out is deleted and every field is required. To publish what you saved use publish_email_sequence; to find out what would stop the publication use get_email_sequence_validation. To attach a file, upload it first with upload_email_sequence_asset. To choose the sender, take the mailbox and signature from list_email_senders. It does not change who is enrolled.
Side effects: The title and the draft are replaced and draft_version goes up by one; an audit event automation.sequence.draft_saved is recorded. The published version, the enrollments already running and the emails already queued are NOT changed: new enrollments keep using the published version until you call publish_email_sequence. Nothing is sent. Each step must carry exactly the keys listed under steps; a missing or extra key is validation_failed with invalid_shape.
Filters: Rules that are checked on save (the rest wait for the publication): at most 60 steps and 20 emails; every step uuid is a distinct lowercase UUID; a wait has 1 to 365 days; with threading on, every email after the first has subject: null; schedule.start is earlier than schedule.end and both are HH:00 or HH:30; time_zone is an IANA zone; the draft is at most 256 KB. The sender is only checked when it changes: you must own the mailbox or hold its send permission, and the signature must belong to it.
Permissions: Requires the automations.work and contacts.read capabilities. The account must also have the CRM Pro plan.
Value for the X-Auth-Token header parameter.
In: header
Path Parameters
UUID of the email sequence. Get it from list_email_sequences.
uuidThe updated EmailSequence resource
TypeScript Definitions
Use the request body type in TypeScript.
Email sequences of the public API (fase 5). Generated from the proposal by fase-5/tools/gen_email_sequences_api.py;
the texts are the proposal's. Every operation checks its capability in the provider or processor before anything
else ({@see \App\Application\Crm\ApiEmailSequenceAccess}), because API Platform evaluates security after the
provider. The rules, transactions and authority live in the CoreBundle use cases (Service\App\Automation\Sequences).
The list shows the summary; every other operation answers the whole sequence as it is afterwards. delete answers
202 without a body: the purge ends in the background (EmailSequenceTombstone). /email_sequences/personalization_tags
is list_email_sequence_personalization_tags, not a sequence.
Response Body
application/problem+json
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_sequences/b3f1c8a2-5d47-4e90-9a16-7c2e0d4f8b35/draft" \ -H "X-Auth-Token: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "title": "string", "expected_draft_version": 1, "threading": true, "schedule": { "time_zone": "string", "weekdays": [ "string" ], "start": "string", "end": "string" }, "exit_on_meeting": true, "exit_on_reply": true, "sender": { "mailbox": "ba8efdb9-b4c4-43cf-965e-5da7040913a7", "signature": "88fef6f3-fdb6-486d-87e1-c7ae0750df94" }, "steps": [ { "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f", "kind": "email", "subject": "string", "html": "string", "unsubscribe": { "language": "string", "template_id": "irrelevant", "prefix": "string", "link_label": "string" }, "variables": [ { "tag": "string", "fallback": "string", "required": true } ], "attachments": [ { "asset_uuid": "76807d23-a41c-4ee1-a173-773f47fc22c8" } ], "days": 1 } ] }'{ "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f", "title": "string", "untitled": true, "status": "draft", "published_revision": 0, "unpublished_changes": true, "email_count": 0, "wait_count": 0, "active_enrollment_count": 0, "total_days": 0, "last_activity_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z", "updated_by": "deea00dc-b6b6-4412-a483-26ac61e1f6fe", "published_sender": { "mailbox": "ba8efdb9-b4c4-43cf-965e-5da7040913a7", "address": "string", "signature": "88fef6f3-fdb6-486d-87e1-c7ae0750df94", "signature_name": "string" }, "can_enroll": true, "draft_version": 1, "threading": true, "schedule": { "time_zone": "string", "weekdays": [ "string" ], "start": "string", "end": "string" }, "exit_on_meeting": true, "exit_on_reply": true, "meeting_exit_undetectable": true, "sender": { "mailbox": "ba8efdb9-b4c4-43cf-965e-5da7040913a7", "address": "string", "signature": "88fef6f3-fdb6-486d-87e1-c7ae0750df94", "signature_name": "string" }, "sender_problem": "missing", "stats": { "enrolled": 0, "sent": 0, "replied": 0, "meetings": 0, "bounced": 0, "unsubscribed": 0, "excluded": 0, "completed": 0 }, "step_stats": [ { "step_uuid": "36cbcda5-79a6-4bf3-8e09-f04e24f64b58", "sent": 0 } ], "steps": [ { "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f", "kind": "email", "subject": "string", "html": "string", "unsubscribe": { "language": "string", "template_id": "irrelevant", "prefix": "string", "link_label": "string" }, "variables": [ { "tag": "string", "fallback": "string", "required": true } ], "attachments": [ { "asset_uuid": "76807d23-a41c-4ee1-a173-773f47fc22c8", "filename": "string", "size_bytes": 0, "mime_type": "string" } ], "days": 1 } ], "versions": [ { "revision": 1, "published_at": "2019-08-24T14:15:22Z", "published_by": "9ac9eee7-2153-423d-b22d-04e12679154a", "email_count": 0, "wait_count": 0 } ]}