agentlyleads docs
Sequences API

API Reference

The reference below covers every endpoint in the Sequences API. Code examples are generated automatically; the live playground is disabled to prevent accidental writes to production from the docs site.

GET/api/v1/sequences

Authorization

BearerAuth
AuthorizationBearer <token>

Pass an API key issued from the agentlyleads workspace settings. Example: Authorization: Bearer alk_live_xxxxxxxxxxxx

In: header

Query Parameters

status?string

ACTIVE or ARCHIVED.

Value in

  • "ACTIVE"
  • "ARCHIVED"
offeringId?string

Only sequences promoting this product.

updatedSince?string

Only records updated at or after this moment.

Formatdate-time
limit?integer
Range1 <= value <= 1000
Default100
cursor?string

The nextCursor from the previous page.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/api/v1/sequences"
{  "sequences": [    {      "id": "string",      "name": "string",      "status": "ACTIVE",      "sendMode": "DRAFT",      "fromEmail": "string",      "offering": {        "id": "cmq2comp0alk34567890",        "name": "Acme Corp"      },      "businessHoursOnly": true,      "exitOnReply": true,      "exitOnDealCreated": true,      "exitOnStatusChange": true,      "steps": [        {          "id": "string",          "order": 0,          "type": "EMAIL",          "delayDays": 0,          "subject": "string",          "bodyHtml": "string",          "taskTitle": "string"        }      ],      "enrollmentCount": 0,      "createdAt": "2019-08-24T14:15:22Z",      "updatedAt": "2019-08-24T14:15:22Z"    }  ],  "nextCursor": "string"}
{  "error": "status must be one of: ACTIVE, ARCHIVED."}
{  "error": "Invalid or missing API key."}
{  "error": "API key missing required scope: read:sequences."}
{  "error": "Rate limit exceeded."}
POST/api/v1/sequences

Authorization

BearerAuth
AuthorizationBearer <token>

Pass an API key issued from the agentlyleads workspace settings. Example: Authorization: Bearer alk_live_xxxxxxxxxxxx

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/v1/sequences" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "steps": [      {        "type": "EMAIL",        "delayDays": 0      }    ]  }'
{  "sequence": {    "id": "string",    "name": "string",    "status": "ACTIVE",    "sendMode": "DRAFT",    "fromEmail": "string",    "offering": {      "id": "cmq2comp0alk34567890",      "name": "Acme Corp"    },    "businessHoursOnly": true,    "exitOnReply": true,    "exitOnDealCreated": true,    "exitOnStatusChange": true,    "steps": [      {        "id": "string",        "order": 0,        "type": "EMAIL",        "delayDays": 0,        "subject": "string",        "bodyHtml": "string",        "taskTitle": "string"      }    ],    "enrollmentCount": 0,    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z"  }}
{  "error": "steps.1: An EMAIL step needs both subject and bodyHtml."}
{  "error": "Invalid or missing API key."}
{  "error": "API key missing required scope: write:sequences."}
{  "error": "Rate limit exceeded."}
GET/api/v1/sequences/{id}

Authorization

BearerAuth
AuthorizationBearer <token>

Pass an API key issued from the agentlyleads workspace settings. Example: Authorization: Bearer alk_live_xxxxxxxxxxxx

In: header

Path Parameters

id*string

The agentlyleads ID.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/api/v1/sequences/string"
{  "sequence": {    "id": "string",    "name": "string",    "status": "ACTIVE",    "sendMode": "DRAFT",    "fromEmail": "string",    "offering": {      "id": "cmq2comp0alk34567890",      "name": "Acme Corp"    },    "businessHoursOnly": true,    "exitOnReply": true,    "exitOnDealCreated": true,    "exitOnStatusChange": true,    "steps": [      {        "id": "string",        "order": 0,        "type": "EMAIL",        "delayDays": 0,        "subject": "string",        "bodyHtml": "string",        "taskTitle": "string"      }    ],    "enrollmentCount": 0,    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z"  },  "stats": {    "total": 0,    "active": 0,    "completed": 0,    "bounced": 0,    "unenrolled": 0,    "replied": 0,    "exited": 0,    "sent": 0  }}
{  "error": "Invalid or missing API key."}
{  "error": "API key missing required scope: read:sequences."}
{  "error": "Sequence not found."}
{  "error": "Rate limit exceeded."}
POST/api/v1/sequences/{id}/enrollments

Authorization

BearerAuth
AuthorizationBearer <token>

Pass an API key issued from the agentlyleads workspace settings. Example: Authorization: Bearer alk_live_xxxxxxxxxxxx

In: header

Path Parameters

id*string

The agentlyleads ID.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/v1/sequences/string/enrollments" \  -H "Content-Type: application/json" \  -d '{    "contactIds": [      "string"    ]  }'
{  "sequenceId": "string",  "enrolled": 0,  "skipped": 0}
{  "error": "Pass at least one contact id."}
{  "error": "Invalid or missing API key."}
{  "error": "API key missing required scope: write:sequences."}
{  "error": "Sequence not found."}
{  "error": "This sequence is archived. Unarchive it in the app before enrolling contacts."}
{  "error": "Rate limit exceeded."}