> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stardex.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Start an enrollment

> Enrolls every `ready` person with exactly the emails stored on the batch. Pass the `version` and `summary.ready` you read, so nothing you haven't seen is sent; if either changed you get `409` and nothing is enrolled. Everyone is checked again: a person who unsubscribed or was enrolled in this campaign by someone else in the meantime is listed in `rejected_at_start` and the rest are enrolled. Calling start again is safe: it returns or finishes the first result with `replayed: true`. To undo a start, stop the batch with `POST /v1/campaigns/{id}/enrollments/stop`. Only the API key or person who created the batch can start it. Needs `campaigns:enroll`.



## OpenAPI

````yaml /api-reference/openapi-v1.json post /v1/campaigns/{id}/enrollment-batches/{batch_id}/start
openapi: 3.1.0
info:
  title: Stardex API (v1)
  version: 1.0.0
  description: >-
    Stardex ATS API — manage candidates, jobs, companies, and recruiting
    workflows.
servers:
  - url: https://api.stardex.ai
    description: Production API server
security:
  - bearerAuth: []
tags:
  - name: Persons
    description: Manage person records — contacts, work history, and custom fields.
  - name: Jobs
    description: Manage job postings — pipeline stages, team members, and custom fields.
  - name: Candidates
    description: Manage candidate records and pipeline stage transitions.
  - name: Companies
    description: Browse and retrieve company records.
  - name: Lists
    description: Create, search, and retrieve saved person and company lists.
  - name: Person Activities
    description: Create and manage activity records (notes, emails, meetings) for persons.
  - name: Team Members
    description: List team members for use in search filters and assignments.
  - name: Custom Fields
    description: Retrieve custom field definitions and tag options for search filters.
  - name: Campaigns
    description: >-
      Create and edit email campaigns, enroll people through enrollment batches,
      and manage who is enrolled.
paths:
  /v1/campaigns/{id}/enrollment-batches/{batch_id}/start:
    post:
      tags:
        - Campaigns
      summary: Start an enrollment
      description: >-
        Enrolls every `ready` person with exactly the emails stored on the
        batch. Pass the `version` and `summary.ready` you read, so nothing you
        haven't seen is sent; if either changed you get `409` and nothing is
        enrolled. Everyone is checked again: a person who unsubscribed or was
        enrolled in this campaign by someone else in the meantime is listed in
        `rejected_at_start` and the rest are enrolled. Calling start again is
        safe: it returns or finishes the first result with `replayed: true`. To
        undo a start, stop the batch with `POST
        /v1/campaigns/{id}/enrollments/stop`. Only the API key or person who
        created the batch can start it. Needs `campaigns:enroll`.
      operationId: startCampaignEnrollmentBatch
      parameters:
        - schema:
            type: string
            format: uuid
            description: Campaign ID.
          required: true
          description: Campaign ID.
          name: id
          in: path
        - schema:
            type: string
            format: uuid
            description: Enrollment batch ID.
          required: true
          description: Enrollment batch ID.
          name: batch_id
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EnrollmentBatchStartRequest'
            example:
              version: 5
              expected_recipient_count: 4
              from_email: riya@acmetalent.com
      responses:
        '200':
          description: Enrolled
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnrollmentBatchStartResponse'
              example:
                success: true
                data:
                  batch_id: eb8d2f41-3c7a-4e19-b5d2-7f0a1c9e6b34
                  status: starting
                  replayed: false
                  summary:
                    enrolled: 3
                    rejected_at_start: 1
                    not_enrolled: 1
                  enrollments:
                    - person_id: 2f6b9d1e-4a8c-4e3f-b7d2-1c5a9e3b7f40
                      enrollment_id: e7b1d3f5-9a2c-4e6b-8d0f-3a5c7e9b1d42
                      first_email_estimated_at: '2026-10-19T08:00:00.000Z'
                    - person_id: 4e8b2d6f-1a3c-4e9b-8f5d-7c2a6e1b3d95
                      enrollment_id: f3a5c7e9-1b3d-4f6a-8c2e-4d6f8a0c2e57
                      first_email_estimated_at: '2026-10-19T08:00:00.000Z'
                    - person_id: 8f6c1d2e-3b5a-4c7e-9d1f-6a8c0e2b4d76
                      enrollment_id: a9c1e3f5-7b2d-4e8a-9c4f-6e8a0c2e4b18
                      first_email_estimated_at: '2026-10-19T08:00:00.000Z'
                  not_enrolled:
                    - person_id: 9c4f1a7e-2d8b-4e6c-b3a9-5f1d7c3e8b24
                      status: blocked
                  rejected_at_start:
                    - person_id: 6a3e8c2f-9b1d-4f7a-a5c3-8e2b6d4f1a73
                      issues:
                        - code: person_do_not_contact
                          message: Marked do not contact.
                  follow_up_errors:
                    - person_id: 4e8b2d6f-1a3c-4e9b-8f5d-7c2a6e1b3d95
                      message: >-
                        Enrolled, but adding them to the job didn't finish. It
                        is retried automatically.
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                    description: Always false for error responses.
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: >-
                          Machine-readable error code (e.g. "VALIDATION_ERROR",
                          "NOT_FOUND").
                      message:
                        type: string
                        description: Human-readable error description.
                      details:
                        type: object
                        additionalProperties: {}
                        description: >-
                          Extra facts about the error when they help you fix it,
                          such as a limit and when it resets.
                    required:
                      - code
                      - message
                required:
                  - success
                  - error
        '403':
          description: No access to campaigns, or the API key lacks the permission
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                    description: Always false for error responses.
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: >-
                          Machine-readable error code (e.g. "VALIDATION_ERROR",
                          "NOT_FOUND").
                      message:
                        type: string
                        description: Human-readable error description.
                      details:
                        type: object
                        additionalProperties: {}
                        description: >-
                          Extra facts about the error when they help you fix it,
                          such as a limit and when it resets.
                    required:
                      - code
                      - message
                required:
                  - success
                  - error
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                    description: Always false for error responses.
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: >-
                          Machine-readable error code (e.g. "VALIDATION_ERROR",
                          "NOT_FOUND").
                      message:
                        type: string
                        description: Human-readable error description.
                      details:
                        type: object
                        additionalProperties: {}
                        description: >-
                          Extra facts about the error when they help you fix it,
                          such as a limit and when it resets.
                    required:
                      - code
                      - message
                required:
                  - success
                  - error
        '409':
          description: >-
            The batch changed since you read it (BATCH_VERSION_CHANGED,
            RECIPIENT_COUNT_MISMATCH), is preparing or can no longer start
            (BATCH_PREPARING, BATCH_NOT_EDITABLE), the campaign changed or was
            archived (BATCH_STALE, CAMPAIGN_ARCHIVED), the scheduled start
            passed (START_TIME_PASSED), nobody is ready (NOTHING_TO_ENROLL), or
            the mailbox differs or is disconnected (SENDER_MISMATCH,
            MAILBOX_DISCONNECTED)
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                    description: Always false for error responses.
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: >-
                          Machine-readable error code (e.g. "VALIDATION_ERROR",
                          "NOT_FOUND").
                      message:
                        type: string
                        description: Human-readable error description.
                      details:
                        type: object
                        additionalProperties: {}
                        description: >-
                          Extra facts about the error when they help you fix it,
                          such as a limit and when it resets.
                    required:
                      - code
                      - message
                required:
                  - success
                  - error
        '410':
          description: The draft expired 24 hours after its last change (BATCH_EXPIRED)
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                    description: Always false for error responses.
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: >-
                          Machine-readable error code (e.g. "VALIDATION_ERROR",
                          "NOT_FOUND").
                      message:
                        type: string
                        description: Human-readable error description.
                      details:
                        type: object
                        additionalProperties: {}
                        description: >-
                          Extra facts about the error when they help you fix it,
                          such as a limit and when it resets.
                    required:
                      - code
                      - message
                required:
                  - success
                  - error
        '429':
          description: >-
            Daily enrollment limit reached (DAILY_ENROLLMENT_LIMIT_REACHED), or
            rate limited (RATE_LIMIT_EXCEEDED)
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                    description: Always false for error responses.
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: >-
                          Machine-readable error code (e.g. "VALIDATION_ERROR",
                          "NOT_FOUND").
                      message:
                        type: string
                        description: Human-readable error description.
                      details:
                        type: object
                        additionalProperties: {}
                        description: >-
                          Extra facts about the error when they help you fix it,
                          such as a limit and when it resets.
                    required:
                      - code
                      - message
                required:
                  - success
                  - error
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                    description: Always false for error responses.
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: >-
                          Machine-readable error code (e.g. "VALIDATION_ERROR",
                          "NOT_FOUND").
                      message:
                        type: string
                        description: Human-readable error description.
                      details:
                        type: object
                        additionalProperties: {}
                        description: >-
                          Extra facts about the error when they help you fix it,
                          such as a limit and when it resets.
                    required:
                      - code
                      - message
                required:
                  - success
                  - error
components:
  schemas:
    EnrollmentBatchStartRequest:
      type: object
      properties:
        version:
          type: integer
          minimum: 1
          description: The batch version you read. Start fails if it has changed.
        expected_recipient_count:
          type: integer
          minimum: 0
          description: >-
            How many people you expect to enroll: summary.ready from the batch
            you read.
        from_email:
          type: string
          format: email
          description: >-
            The mailbox you expect it to send from. When given and different
            from the batch, start fails with 409 SENDER_MISMATCH.
      required:
        - version
        - expected_recipient_count
    EnrollmentBatchStartResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        data:
          $ref: '#/components/schemas/EnrollmentBatchStartResult'
      required:
        - success
        - data
    EnrollmentBatchStartResult:
      type: object
      properties:
        batch_id:
          type: string
          format: uuid
        status:
          type: string
          enum:
            - starting
            - started
        replayed:
          type: boolean
          description: >-
            True when this batch had already started and this call returned or
            finished that result.
        summary:
          type: object
          properties:
            enrolled:
              type: integer
            rejected_at_start:
              type: integer
            not_enrolled:
              type: integer
          required:
            - enrolled
            - rejected_at_start
            - not_enrolled
        enrollments:
          type: array
          items:
            type: object
            properties:
              person_id:
                type: string
                format: uuid
              enrollment_id:
                type: string
                format: uuid
              first_email_estimated_at:
                type:
                  - string
                  - 'null'
            required:
              - person_id
              - enrollment_id
              - first_email_estimated_at
        not_enrolled:
          type: array
          items:
            type: object
            properties:
              person_id:
                type: string
                format: uuid
              status:
                type: string
                enum:
                  - preparing
                  - ready
                  - needs_input
                  - blocked
                  - excluded
                  - enrolled
                  - rejected_at_start
            required:
              - person_id
              - status
        rejected_at_start:
          type: array
          items:
            type: object
            properties:
              person_id:
                type: string
                format: uuid
              issues:
                type: array
                items:
                  type: object
                  properties:
                    code:
                      type: string
                      description: >-
                        Blocks: person_not_found, email_bounced, unsubscribed,
                        person_do_not_contact, already_enrolled. Needs input:
                        no_email, email_not_on_person, company_do_not_contact,
                        already_enrolled_different_email, previously_completed,
                        missing_variables, ai_generation_failed. Warnings:
                        likely_bounce, enrolled_in_other_campaign,
                        previously_in_campaign (was in this campaign before and
                        was stopped, cancelled or failed).
                    message:
                      type: string
                      description: What is wrong and how to fix it.
                    details:
                      type: object
                      additionalProperties:
                        anyOf:
                          - type: string
                          - type: number
                          - type: boolean
                          - type: 'null'
                          - type: array
                            items:
                              type: string
                          - type: 'null'
                      description: Extra facts about the issue, such as variable names.
                  required:
                    - code
                    - message
            required:
              - person_id
              - issues
        follow_up_errors:
          type: array
          items:
            type: object
            properties:
              person_id:
                type: string
                format: uuid
              message:
                type: string
            required:
              - person_id
              - message
          description: >-
            People who are enrolled but whose follow-up did not finish: adding
            them to the job (retried automatically), saving their email as
            preferred, or adding them as a client contact.
      required:
        - batch_id
        - status
        - replayed
        - summary
        - enrollments
        - not_enrolled
        - rejected_at_start
        - follow_up_errors
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Authenticate with a Bearer token: API key, OAuth token, or session
        token.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.