Menu

Reference

Enrollments

Enrollments: 7 operations (enrollments.list, enrollments.create, enrollments.remove, enrollments.get, enrollments.pause, enrollments.resume, leads.enrollments.list).

MethodPathOperation
GET/v1/campaigns/{campaign_id}/enrollmentsenrollments.list
POST/v1/campaigns/{campaign_id}/enrollmentsenrollments.create
DELETE/v1/campaigns/{campaign_id}/enrollments/{lead_id}enrollments.remove
GET/v1/enrollments/{enrollment_id}enrollments.get
POST/v1/enrollments/{enrollment_id}/pauseenrollments.pause
POST/v1/enrollments/{enrollment_id}/resumeenrollments.resume
GET/v1/leads/{lead_id}/enrollmentsleads.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 idenrollments.list
Scopescampaigns:read
Rate class`read`
IdempotencyNot applicable
KeysDeveloper keys
RepsA key restricted to reps sees only data of its own reps

Path parameters

NameTypeRequiredDescription
campaign_idstringyesCampaign id (uuid). at most 64 characters

Query parameters

NameTypeRequiredDescription
limitintegerno1 to 200, default 50
cursorstringno1 to 2048 characters
status"active" | "paused" | "replied" | "completed" | "opted_out" | "failed"no
rep_idstringnoat most 64 characters

Response 200

FieldTypeRequiredDescription
dataobject[]yes
has_morebooleanyes
next_cursorstring | nullyes

Errors

StatusCodeWhen
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

bash
curl "https://api.dmhero.ai/v1/campaigns/string/enrollments" \
  -H "Authorization: Bearer $DMHERO_API_KEY"
JSON Schema
Response 200
{
  "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 idenrollments.create
Scopesenrollments:write
Rate class`write`
Idempotency`Idempotency-Key` accepted
KeysDeveloper keys
RepsA key restricted to reps sees only data of its own reps

Path parameters

NameTypeRequiredDescription
campaign_idstringyesCampaign id (uuid). at most 64 characters

Request body

FieldTypeRequiredDescription
confirm_tokenstringnoat most 256 characters
dry_runbooleanno
filterobjectnoLead 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_idsstring[]noUp to 100 lead ids (uuid).. at least 1 items
limitintegernoRequired with filter.. 1 to 5000
rep_idstringnoThe rep that sends to these leads; by default they are spread over the key's reps.. at most 64 characters
skip_if_in_any_campaignbooleannodefault true

Response 200

JSON of type object.

Errors

StatusCodeWhen
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

bash
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
Request body
{
  "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"
    }
  }
}
Response 200
{
  "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 idenrollments.remove
Scopesenrollments:write
Rate class`write`
IdempotencyNot applicable
KeysDeveloper keys
DestructiveYes: it removes or stops something that cannot be restored by repeating the call
RepsA key restricted to reps sees only data of its own reps

Path parameters

NameTypeRequiredDescription
campaign_idstringyesCampaign id (uuid). at most 64 characters
lead_idstringyesLead id (uuid). at most 64 characters

Response 200

FieldTypeRequiredDescription
removedbooleanyes
reason"not_enrolled" | "already_terminal"no

Errors

StatusCodeWhen
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

bash
curl -X DELETE "https://api.dmhero.ai/v1/campaigns/string/enrollments/string" \
  -H "Authorization: Bearer $DMHERO_API_KEY"
JSON Schema
Response 200
{
  "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 idenrollments.get
Scopescampaigns:read
Rate class`read`
IdempotencyNot applicable
KeysDeveloper keys
RepsA key restricted to reps sees only data of its own reps

Path parameters

NameTypeRequiredDescription
enrollment_idstringyesEnrollment id (uuid). at most 64 characters

Response 200

FieldTypeRequiredDescription
campaign_idstringyes
completed_atdate-time | nullyes
current_stepintegeryes-9007199254740991 to 9007199254740991
enrolled_atdate-timeyes
idstringyes
lead_idstringyes
next_action_atdate-time | nullyes
rep_idstring | nullyes
status"active" | "paused" | "replied" | "completed" | "opted_out" | "failed"yes

Errors

StatusCodeWhen
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

bash
curl "https://api.dmhero.ai/v1/enrollments/string" \
  -H "Authorization: Bearer $DMHERO_API_KEY"
JSON Schema
Response 200
{
  "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 idenrollments.pause
Scopesenrollments:write
Rate class`write`
Idempotency`Idempotency-Key` accepted
KeysDeveloper keys
RepsA key restricted to reps sees only data of its own reps

Path parameters

NameTypeRequiredDescription
enrollment_idstringyesEnrollment id (uuid). at most 64 characters

Response 200

FieldTypeRequiredDescription
campaign_idstringyes
completed_atdate-time | nullyes
current_stepintegeryes-9007199254740991 to 9007199254740991
enrolled_atdate-timeyes
idstringyes
lead_idstringyes
next_action_atdate-time | nullyes
rep_idstring | nullyes
status"active" | "paused" | "replied" | "completed" | "opted_out" | "failed"yes

Errors

StatusCodeWhen
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

bash
curl -X POST "https://api.dmhero.ai/v1/enrollments/string/pause" \
  -H "Authorization: Bearer $DMHERO_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
JSON Schema
Response 200
{
  "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 idenrollments.resume
Scopesenrollments:write
Rate class`write`
Idempotency`Idempotency-Key` accepted
KeysDeveloper keys
RepsA key restricted to reps sees only data of its own reps

Path parameters

NameTypeRequiredDescription
enrollment_idstringyesEnrollment id (uuid). at most 64 characters

Response 200

FieldTypeRequiredDescription
campaign_idstringyes
completed_atdate-time | nullyes
current_stepintegeryes-9007199254740991 to 9007199254740991
enrolled_atdate-timeyes
idstringyes
lead_idstringyes
next_action_atdate-time | nullyes
rep_idstring | nullyes
status"active" | "paused" | "replied" | "completed" | "opted_out" | "failed"yes

Errors

StatusCodeWhen
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

bash
curl -X POST "https://api.dmhero.ai/v1/enrollments/string/resume" \
  -H "Authorization: Bearer $DMHERO_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
JSON Schema
Response 200
{
  "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 idleads.enrollments.list
Scopescampaigns:read
Rate class`read`
IdempotencyNot applicable
KeysDeveloper keys
RepsA key restricted to reps sees only data of its own reps

Path parameters

NameTypeRequiredDescription
lead_idstringyesLead id (uuid). at most 64 characters

Response 200

FieldTypeRequiredDescription
dataobject[]yes

Errors

StatusCodeWhen
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

bash
curl "https://api.dmhero.ai/v1/leads/string/enrollments" \
  -H "Authorization: Bearer $DMHERO_API_KEY"
JSON Schema
Response 200
{
  "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
}
Enrollments | DM Hero Developers