Reference
Enrollments
Enrollments: 7 operations (enrollments.list, enrollments.create, enrollments.remove, enrollments.get, enrollments.pause, enrollments.resume, leads.enrollments.list).
| Method | Path | Operation |
|---|---|---|
GET | /v1/campaigns/{campaign_id}/enrollments | enrollments.list |
POST | /v1/campaigns/{campaign_id}/enrollments | enrollments.create |
DELETE | /v1/campaigns/{campaign_id}/enrollments/{lead_id} | enrollments.remove |
GET | /v1/enrollments/{enrollment_id} | enrollments.get |
POST | /v1/enrollments/{enrollment_id}/pause | enrollments.pause |
POST | /v1/enrollments/{enrollment_id}/resume | enrollments.resume |
GET | /v1/leads/{lead_id}/enrollments | leads.enrollments.list |
enrollments.list
GET/v1/campaigns/{campaign_id}/enrollments
List a campaign's enrollments, newest first.
A rep-restricted key sees its reps' enrollments only; an unrestricted key also the unassigned ones.
| Operation id | enrollments.list |
| Scopes | campaigns:read |
| Rate class | `read` |
| Idempotency | Not applicable |
| Keys | Developer keys |
| Reps | A key restricted to reps sees only data of its own reps |
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
campaign_id | string | yes | Campaign id (uuid). at most 64 characters |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
limit | integer | no | 1 to 200, default 50 |
cursor | string | no | 1 to 2048 characters |
status | "active" | "paused" | "replied" | "completed" | "opted_out" | "failed" | no | |
rep_id | string | no | at most 64 characters |
Response 200
| Field | Type | Required | Description |
|---|---|---|---|
data | object[] | yes | |
has_more | boolean | yes | |
next_cursor | string | null | yes |
Errors
| Status | Code | When |
|---|---|---|
| 404 | `CAMPAIGN_NOT_FOUND_404` | No campaign with this id exists in the key's workspace. |
| 404 | `REP_NOT_FOUND_404` | The rep is not one the key may act as. |
Every operation can also answer the shared errors: authentication, scopes, rate limits and validation.
Example
curl "https://api.dmhero.ai/v1/campaigns/string/enrollments" \
-H "Authorization: Bearer $DMHERO_API_KEY"JSON Schema
{
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"campaign_id": {
"type": "string"
},
"lead_id": {
"type": "string"
},
"rep_id": {
"type": [
"string",
"null"
]
},
"status": {
"type": "string",
"enum": [
"active",
"paused",
"replied",
"completed",
"opted_out",
"failed"
]
},
"current_step": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"enrolled_at": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
},
"next_action_at": {
"anyOf": [
{
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
},
{
"type": "null"
}
]
},
"completed_at": {
"anyOf": [
{
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
},
{
"type": "null"
}
]
}
},
"required": [
"id",
"campaign_id",
"lead_id",
"rep_id",
"status",
"current_step",
"enrolled_at",
"next_action_at",
"completed_at"
],
"additionalProperties": false
}
},
"has_more": {
"type": "boolean"
},
"next_cursor": {
"type": [
"string",
"null"
]
}
},
"required": [
"data",
"has_more",
"next_cursor"
],
"additionalProperties": false
}enrollments.create
POST/v1/campaigns/{campaign_id}/enrollments
Enroll leads in a campaign, by id or by filter.
Send lead_ids (1 to 100) or filter with limit (1 to 5 000, a random sample when more match). Enrolled leads are DMed by the extension from the campaign's first step on, and a DM cannot be unsent. On an ACTIVE campaign a filter enrollment needs a prior call with dry_run: true, which answers the match count and a confirm_token valid for 15 minutes; the real call sends that token with the same filter, limit, rep and skip setting. skip_if_in_any_campaign (default true) skips leads already enrolled in any campaign. Both forms skip opted-out (not_interested) and converted leads, and a lead the workspace is already talking to in a DM thread in which the person wrote; by id they are reported in skipped_reasons (already_in_conversation for that one), where a lead deleted while the call runs counts as not_found. By filter the other skipped leads never match, so skipped counts only the already_in_conversation ones.
| Operation id | enrollments.create |
| Scopes | enrollments:write |
| Rate class | `write` |
| Idempotency | `Idempotency-Key` accepted |
| Keys | Developer keys |
| Reps | A key restricted to reps sees only data of its own reps |
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
campaign_id | string | yes | Campaign id (uuid). at most 64 characters |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
confirm_token | string | no | at most 256 characters |
dry_run | boolean | no | |
filter | object | no | Lead filter: status, niche, tag, folder_id, search and custom_fields only; any other member is refused (400 VALIDATION_FAILED_400 naming filter.<member>), never ignored. Inbound-first leads, opted-out (not_interested) and converted leads, and leads already in this campaign are always skipped. |
lead_ids | string[] | no | Up to 100 lead ids (uuid).. at least 1 items |
limit | integer | no | Required with filter.. 1 to 5000 |
rep_id | string | no | The rep that sends to these leads; by default they are spread over the key's reps.. at most 64 characters |
skip_if_in_any_campaign | boolean | no | default true |
Response 200
JSON of type object.
Errors
| Status | Code | When |
|---|---|---|
| 400 | `CUSTOM_FIELD_UNKNOWN_400` | filter.custom_fields names a key the workspace has not defined. |
| 400 | `ENROLL_BATCH_TOO_LARGE_400` | More than 100 lead ids. |
| 400 | `ENROLL_CONFIRM_REQUIRED_400` | A filter enrollment on an active campaign without a valid confirm_token from a dry run with the same parameters. |
| 404 | `CAMPAIGN_NOT_FOUND_404` | No campaign with this id exists in the key's workspace. |
| 404 | `LEAD_NOT_FOUND_404` | A lead id is not in the key's workspace. The answer names no id. |
| 404 | `REP_NOT_FOUND_404` | The rep is not one the key may act as. |
| 409 | `CAMPAIGN_ARCHIVED_409` | The campaign is archived. |
Every operation can also answer the shared errors: authentication, scopes, rate limits and validation.
Example
curl -X POST "https://api.dmhero.ai/v1/campaigns/string/enrollments" \
-H "Authorization: Bearer $DMHERO_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"filter": {
"tag": "webinar"
},
"limit": 100,
"dry_run": true
}'JSON Schema
{
"type": "object",
"properties": {
"lead_ids": {
"description": "Up to 100 lead ids (uuid).",
"minItems": 1,
"type": "array",
"items": {
"type": "string",
"maxLength": 64
}
},
"filter": {
"type": "object",
"properties": {
"status": {
"type": "string",
"maxLength": 32
},
"niche": {
"type": "string",
"maxLength": 200
},
"tag": {
"type": "string",
"maxLength": 50
},
"folder_id": {
"description": "A folder id, or `none` for unfiled leads.",
"anyOf": [
{
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
{
"type": "string",
"const": "none"
}
]
},
"search": {
"type": "string",
"maxLength": 200
},
"custom_fields": {
"description": "Custom field conditions, ANDed with each other and with the other members, in the same JSON form as the bulk preview's and the export's filter (spec 6.3.2). Every key must be defined in the workspace (400 CUSTOM_FIELD_UNKNOWN_400 otherwise).",
"maxItems": 5,
"type": "array",
"items": {
"oneOf": [
{
"type": "object",
"properties": {
"key": {
"type": "string",
"minLength": 1,
"maxLength": 100,
"description": "A custom field key the workspace defines (GET /v1/custom-fields)."
},
"op": {
"type": "string",
"const": "equals"
},
"value": {
"type": "string",
"minLength": 1,
"maxLength": 500,
"description": "Compared trimmed and ignoring case, as a whole value."
}
},
"required": [
"key",
"op",
"value"
]
},
{
"type": "object",
"properties": {
"key": {
"type": "string",
"minLength": 1,
"maxLength": 100,
"description": "A custom field key the workspace defines (GET /v1/custom-fields)."
},
"op": {
"type": "string",
"const": "contains"
},
"value": {
"type": "string",
"minLength": 1,
"maxLength": 500,
"description": "A substring, ignoring case. Every character is literal (% and _ included)."
}
},
"required": [
"key",
"op",
"value"
]
},
{
"type": "object",
"properties": {
"key": {
"type": "string",
"minLength": 1,
"maxLength": 100,
"description": "A custom field key the workspace defines (GET /v1/custom-fields)."
},
"op": {
"type": "string",
"const": "present"
}
},
"required": [
"key",
"op"
]
},
{
"type": "object",
"properties": {
"key": {
"type": "string",
"minLength": 1,
"maxLength": 100,
"description": "A custom field key the workspace defines (GET /v1/custom-fields)."
},
"op": {
"type": "string",
"const": "missing"
}
},
"required": [
"key",
"op"
]
}
],
"description": "equals: the value, trimmed, equals this text ignoring case. contains: the value holds this text ignoring case. present: the lead has a non-blank value. missing: the lead has no value or a blank one."
}
}
},
"additionalProperties": false,
"description": "Lead filter: status, niche, tag, folder_id, search and custom_fields only; any other member is refused (400 VALIDATION_FAILED_400 naming filter.<member>), never ignored. Inbound-first leads, opted-out (`not_interested`) and converted leads, and leads already in this campaign are always skipped."
},
"limit": {
"description": "Required with `filter`.",
"type": "integer",
"minimum": 1,
"maximum": 5000
},
"dry_run": {
"type": "boolean"
},
"confirm_token": {
"type": "string",
"maxLength": 256
},
"rep_id": {
"description": "The rep that sends to these leads; by default they are spread over the key's reps.",
"type": "string",
"maxLength": 64
},
"skip_if_in_any_campaign": {
"default": true,
"type": "boolean"
}
}
}{
"anyOf": [
{
"type": "object",
"properties": {
"enrolled": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"skipped": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"skipped_reasons": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
}
}
},
"required": [
"enrolled",
"skipped"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"matched_count": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"confirm_token": {
"type": "string"
},
"confirm_expires_at": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
}
},
"required": [
"matched_count",
"confirm_token",
"confirm_expires_at"
],
"additionalProperties": false
}
]
}enrollments.remove
DELETE/v1/campaigns/{campaign_id}/enrollments/{lead_id}
Remove a lead from a campaign: nothing more is sent to it from this campaign.
| Operation id | enrollments.remove |
| Scopes | enrollments:write |
| Rate class | `write` |
| Idempotency | Not applicable |
| Keys | Developer keys |
| Destructive | Yes: it removes or stops something that cannot be restored by repeating the call |
| Reps | A key restricted to reps sees only data of its own reps |
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
campaign_id | string | yes | Campaign id (uuid). at most 64 characters |
lead_id | string | yes | Lead id (uuid). at most 64 characters |
Response 200
| Field | Type | Required | Description |
|---|---|---|---|
removed | boolean | yes | |
reason | "not_enrolled" | "already_terminal" | no |
Errors
| Status | Code | When |
|---|---|---|
| 404 | `CAMPAIGN_NOT_FOUND_404` | No campaign with this id exists in the key's workspace. |
| 404 | `LEAD_NOT_FOUND_404` | A lead id is not in the key's workspace. The answer names no id. |
Every operation can also answer the shared errors: authentication, scopes, rate limits and validation.
Example
curl -X DELETE "https://api.dmhero.ai/v1/campaigns/string/enrollments/string" \
-H "Authorization: Bearer $DMHERO_API_KEY"JSON Schema
{
"type": "object",
"properties": {
"removed": {
"type": "boolean"
},
"reason": {
"type": "string",
"enum": [
"not_enrolled",
"already_terminal"
]
}
},
"required": [
"removed"
],
"additionalProperties": false
}enrollments.get
GET/v1/enrollments/{enrollment_id}
Get one enrollment.
| Operation id | enrollments.get |
| Scopes | campaigns:read |
| Rate class | `read` |
| Idempotency | Not applicable |
| Keys | Developer keys |
| Reps | A key restricted to reps sees only data of its own reps |
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
enrollment_id | string | yes | Enrollment id (uuid). at most 64 characters |
Response 200
| Field | Type | Required | Description |
|---|---|---|---|
campaign_id | string | yes | |
completed_at | date-time | null | yes | |
current_step | integer | yes | -9007199254740991 to 9007199254740991 |
enrolled_at | date-time | yes | |
id | string | yes | |
lead_id | string | yes | |
next_action_at | date-time | null | yes | |
rep_id | string | null | yes | |
status | "active" | "paused" | "replied" | "completed" | "opted_out" | "failed" | yes |
Errors
| Status | Code | When |
|---|---|---|
| 404 | `ENROLLMENT_NOT_FOUND_404` | No enrollment with this id exists in the key's workspace, or it belongs to a rep the key is not restricted to. |
Every operation can also answer the shared errors: authentication, scopes, rate limits and validation.
Example
curl "https://api.dmhero.ai/v1/enrollments/string" \
-H "Authorization: Bearer $DMHERO_API_KEY"JSON Schema
{
"type": "object",
"properties": {
"id": {
"type": "string"
},
"campaign_id": {
"type": "string"
},
"lead_id": {
"type": "string"
},
"rep_id": {
"type": [
"string",
"null"
]
},
"status": {
"type": "string",
"enum": [
"active",
"paused",
"replied",
"completed",
"opted_out",
"failed"
]
},
"current_step": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"enrolled_at": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
},
"next_action_at": {
"anyOf": [
{
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
},
{
"type": "null"
}
]
},
"completed_at": {
"anyOf": [
{
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
},
{
"type": "null"
}
]
}
},
"required": [
"id",
"campaign_id",
"lead_id",
"rep_id",
"status",
"current_step",
"enrolled_at",
"next_action_at",
"completed_at"
],
"additionalProperties": false
}enrollments.pause
POST/v1/enrollments/{enrollment_id}/pause
Pause one enrollment (active -> paused); one already paused is answered as is.
| Operation id | enrollments.pause |
| Scopes | enrollments:write |
| Rate class | `write` |
| Idempotency | `Idempotency-Key` accepted |
| Keys | Developer keys |
| Reps | A key restricted to reps sees only data of its own reps |
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
enrollment_id | string | yes | Enrollment id (uuid). at most 64 characters |
Response 200
| Field | Type | Required | Description |
|---|---|---|---|
campaign_id | string | yes | |
completed_at | date-time | null | yes | |
current_step | integer | yes | -9007199254740991 to 9007199254740991 |
enrolled_at | date-time | yes | |
id | string | yes | |
lead_id | string | yes | |
next_action_at | date-time | null | yes | |
rep_id | string | null | yes | |
status | "active" | "paused" | "replied" | "completed" | "opted_out" | "failed" | yes |
Errors
| Status | Code | When |
|---|---|---|
| 404 | `ENROLLMENT_NOT_FOUND_404` | No enrollment with this id exists in the key's workspace, or it belongs to a rep the key is not restricted to. |
| 409 | `ENROLLMENT_STATUS_CONFLICT_409` | The enrollment is not in a status this transition starts from, or its status changed meanwhile. |
Every operation can also answer the shared errors: authentication, scopes, rate limits and validation.
Example
curl -X POST "https://api.dmhero.ai/v1/enrollments/string/pause" \
-H "Authorization: Bearer $DMHERO_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"JSON Schema
{
"type": "object",
"properties": {
"id": {
"type": "string"
},
"campaign_id": {
"type": "string"
},
"lead_id": {
"type": "string"
},
"rep_id": {
"type": [
"string",
"null"
]
},
"status": {
"type": "string",
"enum": [
"active",
"paused",
"replied",
"completed",
"opted_out",
"failed"
]
},
"current_step": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"enrolled_at": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
},
"next_action_at": {
"anyOf": [
{
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
},
{
"type": "null"
}
]
},
"completed_at": {
"anyOf": [
{
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
},
{
"type": "null"
}
]
}
},
"required": [
"id",
"campaign_id",
"lead_id",
"rep_id",
"status",
"current_step",
"enrolled_at",
"next_action_at",
"completed_at"
],
"additionalProperties": false
}enrollments.resume
POST/v1/enrollments/{enrollment_id}/resume
Resume one enrollment (paused -> active); one already active is answered as is.
| Operation id | enrollments.resume |
| Scopes | enrollments:write |
| Rate class | `write` |
| Idempotency | `Idempotency-Key` accepted |
| Keys | Developer keys |
| Reps | A key restricted to reps sees only data of its own reps |
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
enrollment_id | string | yes | Enrollment id (uuid). at most 64 characters |
Response 200
| Field | Type | Required | Description |
|---|---|---|---|
campaign_id | string | yes | |
completed_at | date-time | null | yes | |
current_step | integer | yes | -9007199254740991 to 9007199254740991 |
enrolled_at | date-time | yes | |
id | string | yes | |
lead_id | string | yes | |
next_action_at | date-time | null | yes | |
rep_id | string | null | yes | |
status | "active" | "paused" | "replied" | "completed" | "opted_out" | "failed" | yes |
Errors
| Status | Code | When |
|---|---|---|
| 404 | `ENROLLMENT_NOT_FOUND_404` | No enrollment with this id exists in the key's workspace, or it belongs to a rep the key is not restricted to. |
| 409 | `ENROLLMENT_STATUS_CONFLICT_409` | The enrollment is not in a status this transition starts from, or its status changed meanwhile. |
Every operation can also answer the shared errors: authentication, scopes, rate limits and validation.
Example
curl -X POST "https://api.dmhero.ai/v1/enrollments/string/resume" \
-H "Authorization: Bearer $DMHERO_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"JSON Schema
{
"type": "object",
"properties": {
"id": {
"type": "string"
},
"campaign_id": {
"type": "string"
},
"lead_id": {
"type": "string"
},
"rep_id": {
"type": [
"string",
"null"
]
},
"status": {
"type": "string",
"enum": [
"active",
"paused",
"replied",
"completed",
"opted_out",
"failed"
]
},
"current_step": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"enrolled_at": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
},
"next_action_at": {
"anyOf": [
{
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
},
{
"type": "null"
}
]
},
"completed_at": {
"anyOf": [
{
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
},
{
"type": "null"
}
]
}
},
"required": [
"id",
"campaign_id",
"lead_id",
"rep_id",
"status",
"current_step",
"enrolled_at",
"next_action_at",
"completed_at"
],
"additionalProperties": false
}leads.enrollments.list
GET/v1/leads/{lead_id}/enrollments
Every campaign enrollment of one lead, newest first.
| Operation id | leads.enrollments.list |
| Scopes | campaigns:read |
| Rate class | `read` |
| Idempotency | Not applicable |
| Keys | Developer keys |
| Reps | A key restricted to reps sees only data of its own reps |
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
lead_id | string | yes | Lead id (uuid). at most 64 characters |
Response 200
| Field | Type | Required | Description |
|---|---|---|---|
data | object[] | yes |
Errors
| Status | Code | When |
|---|---|---|
| 404 | `LEAD_NOT_FOUND_404` | A lead id is not in the key's workspace. The answer names no id. |
Every operation can also answer the shared errors: authentication, scopes, rate limits and validation.
Example
curl "https://api.dmhero.ai/v1/leads/string/enrollments" \
-H "Authorization: Bearer $DMHERO_API_KEY"JSON Schema
{
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"campaign_id": {
"type": "string"
},
"lead_id": {
"type": "string"
},
"rep_id": {
"type": [
"string",
"null"
]
},
"status": {
"type": "string",
"enum": [
"active",
"paused",
"replied",
"completed",
"opted_out",
"failed"
]
},
"current_step": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"enrolled_at": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
},
"next_action_at": {
"anyOf": [
{
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
},
{
"type": "null"
}
]
},
"completed_at": {
"anyOf": [
{
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
},
{
"type": "null"
}
]
}
},
"required": [
"id",
"campaign_id",
"lead_id",
"rep_id",
"status",
"current_step",
"enrolled_at",
"next_action_at",
"completed_at"
],
"additionalProperties": false
}
}
},
"required": [
"data"
],
"additionalProperties": false
}