agentlyleads docs
Sequences API

POST /api/v1/sequences

Creates an ACTIVE sequence with its ordered steps. Requires the write:sequences scope, and also send:emails when sendMode is SEND.

Request

POST /api/v1/sequences HTTP/1.1
Host: agentlyleads.com
Authorization: Bearer alk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Content-Type: application/json

{
  "name": "New farm buyers",
  "steps": [
    { "type": "EMAIL", "delayDays": 0, "subject": "Quick question, {{firstName}}", "bodyHtml": "<p>Hi {{firstName}}, do you stock lick salt for the herd?</p><p>Kevin</p>" },
    { "type": "TASK", "delayDays": 3, "taskTitle": "Call to follow up" },
    { "type": "EMAIL", "delayDays": 7, "subject": "Following up", "bodyHtml": "<p>Hi {{firstName}}, happy to send a sample if useful.</p><p>Kevin</p>" }
  ]
}
FieldRequiredNotes
nameyesUp to 200 characters
stepsyes1 to 50 steps, in the order they run. EMAIL steps need subject and bodyHtml; TASK steps need taskTitle. delayDays is 0 to 365, counted from the previous step (or enrollment for the first)
sendModenoDRAFT (default) or SEND
fromEmailnoA verified sending identity from GET /api/v1/emails/identities
offeringIdnoThe product this sequence promotes
businessHoursOnly, exitOnReply, exitOnDealCreated, exitOnStatusChangenoSee the Sequence object for defaults
asUserEmailnoThe workspace member recorded as the creator. Defaults to the workspace owner

Every step is validated before anything is written, so a bad step never leaves half a sequence behind.

Response (201)

{ "sequence": { "id": "cmq2seqn0alk34567890", "status": "ACTIVE", "steps": ["..."], "enrollmentCount": 0 } }

On this page