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

# Create enrollment

> Enroll a person in a sequence.

## Overview

Create an enrollment to add a person to a sequence. The request body specifies:

| Property         | Behavior                                                                                                                           |
| ---------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| `sequence_id`    | The sequence to enroll the person in.                                                                                              |
| `person_id`      | The person to enroll.                                                                                                              |
| `mailbox_emails` | Candidate mailbox addresses to send from. One is selected at enrollment time. At least one and at most ten addresses are accepted. |

If the person is already actively enrolled in the sequence, the request returns
`409 Conflict`.


## OpenAPI

````yaml POST /enrollments
openapi: 3.1.0
info:
  title: Unify Sequences API
  summary: Interact with sequences and sequence enrollments within the Unify platform.
  version: '1'
  termsOfService: https://www.unifygtm.com/legal/terms-and-conditions
  contact:
    name: Unify Support
    url: https://www.unifygtm.com/support
    email: support@unifygtm.com
servers:
  - url: https://api.unifygtm.com/sequences/v1
    variables: {}
security:
  - ApiKeyAuth: []
tags:
  - name: Sequences
  - name: Sequence Enrollment Steps
  - name: Sequence Enrollments
paths:
  /enrollments:
    post:
      tags:
        - Sequences
        - Sequence Enrollments
      operationId: create_sequence_enrollment
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateEnrollmentRequest'
      responses:
        '201':
          description: Response returned when an enrollment is created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateEnrollmentSuccessResponse'
        '400':
          description: Response for any operation that results in a bad request error.
          content:
            application/json:
              schema:
                type: object
                required:
                  - status
                properties:
                  status:
                    type: string
                    enum:
                      - bad_request
                  errors:
                    type: array
                    items:
                      $ref: '#/components/schemas/UResponses.BadRequestError'
                  message:
                    type: string
                description: >-
                  Response for any operation that results in a bad request
                  error.
        '401':
          description: Response for any operation that results in an unauthorized error.
          content:
            application/json:
              schema:
                type: object
                required:
                  - status
                  - message
                properties:
                  status:
                    type: string
                    enum:
                      - unauthorized
                  message:
                    type: string
                description: >-
                  Response for any operation that results in an unauthorized
                  error.
        '404':
          description: Response returned when an enrollment cannot be found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnrollmentNotFoundResponse'
        '409':
          description: >-
            Response returned when the person is already enrolled in an active
            sequence.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateEnrollmentConflictResponse'
        '429':
          description: Response for any operation that exceeds a rate limit.
          content:
            application/json:
              schema:
                type: object
                required:
                  - status
                  - message
                properties:
                  status:
                    type: string
                    enum:
                      - rate_limited
                  message:
                    type: string
                description: Response for any operation that exceeds a rate limit.
        '500':
          description: Response for any operation that results in an internal server error.
          content:
            application/json:
              schema:
                type: object
                required:
                  - status
                  - message
                properties:
                  status:
                    type: string
                    enum:
                      - error
                  message:
                    type: string
                description: >-
                  Response for any operation that results in an internal server
                  error.
components:
  schemas:
    CreateEnrollmentRequest:
      type: object
      required:
        - sequence_id
        - person_id
        - mailbox_emails
      properties:
        sequence_id:
          $ref: '#/components/schemas/uuid'
        person_id:
          $ref: '#/components/schemas/uuid'
        mailbox_emails:
          type: array
          items:
            $ref: '#/components/schemas/email'
          minItems: 1
          maxItems: 10
          description: >-
            Candidate mailbox addresses to send from. One is selected at
            enrollment

            time. At most 10 addresses are accepted.
      description: Request body for enrolling a person in a sequence.
    CreateEnrollmentSuccessResponse:
      type: object
      allOf:
        - $ref: '#/components/schemas/Enrollment'
      description: Response returned when an enrollment is created.
    UResponses.BadRequestError:
      type: object
      required:
        - code
      properties:
        code:
          type: string
        path:
          type: array
          items:
            anyOf:
              - type: string
              - type: integer
        object_api_name:
          type: string
        attribute_api_name:
          type: string
      allOf:
        - type: object
          additionalProperties: {}
      description: Validation error detail returned for bad request responses.
    EnrollmentNotFoundResponse:
      type: object
      allOf:
        - type: object
          required:
            - status
            - message
          properties:
            status:
              type: string
              enum:
                - not_found
            message:
              type: string
          description: Response for any operation that results in a not found error.
      description: Response returned when an enrollment cannot be found.
    CreateEnrollmentConflictResponse:
      type: object
      required:
        - active_sequence_id
        - active_enrollment_id
      properties:
        active_sequence_id:
          $ref: '#/components/schemas/uuid'
        active_enrollment_id:
          $ref: '#/components/schemas/uuid'
      allOf:
        - type: object
          required:
            - status
            - message
          properties:
            status:
              type: string
              enum:
                - conflict
            message:
              type: string
          description: Response for any operation that results in a conflict error.
      description: >-
        Response returned when the person is already enrolled in an active
        sequence.
    uuid:
      type: string
      format: uuid
      description: String UUID value.
    email:
      type: string
      format: email
      description: String value representing an email address.
    Enrollment:
      type: object
      required:
        - id
        - created_at
        - updated_at
        - sequence
        - person
        - mailbox
        - reply_email_message
        - status
        - is_blocked
        - is_bounced
        - is_canceled
        - is_excluded
        - is_opted_out
        - is_paused
        - is_replied
        - started_at
        - ended_at
      properties:
        id:
          $ref: '#/components/schemas/uuid'
        created_at:
          $ref: '#/components/schemas/datetime'
        updated_at:
          $ref: '#/components/schemas/datetime'
        sequence:
          $ref: '#/components/schemas/EnrollmentSequence'
        person:
          $ref: '#/components/schemas/EnrollmentPerson'
        mailbox:
          $ref: '#/components/schemas/EnrollmentMailbox'
        reply_email_message:
          type: object
          allOf:
            - $ref: '#/components/schemas/EnrollmentReplyEmailMessage'
          nullable: true
        status:
          $ref: '#/components/schemas/SequenceEnrollmentStatus'
        is_blocked:
          type: boolean
        is_bounced:
          type: boolean
        is_canceled:
          type: boolean
        is_excluded:
          type: boolean
        is_opted_out:
          type: boolean
        is_paused:
          type: boolean
        is_replied:
          type: boolean
        started_at:
          type: string
          allOf:
            - $ref: '#/components/schemas/datetime'
          nullable: true
        ended_at:
          type: string
          allOf:
            - $ref: '#/components/schemas/datetime'
          nullable: true
      description: A sequence enrollment.
    datetime:
      type: string
      format: date-time
      description: String value representing an RFC 3339 datetime.
    EnrollmentSequence:
      type: object
      required:
        - id
        - name
        - is_paused
      properties:
        id:
          $ref: '#/components/schemas/uuid'
        name:
          type: string
        is_paused:
          type: boolean
      description: Sequence details embedded in enrollment responses.
    EnrollmentPerson:
      type: object
      required:
        - id
        - email
        - first_name
        - last_name
        - linkedin_url
      properties:
        id:
          $ref: '#/components/schemas/uuid'
        email:
          $ref: '#/components/schemas/email'
        first_name:
          type: string
          nullable: true
        last_name:
          type: string
          nullable: true
        linkedin_url:
          type: string
          nullable: true
      description: Person details embedded in enrollment responses.
    EnrollmentMailbox:
      type: object
      required:
        - id
        - email
        - display_name
        - is_paused
        - is_unauthorized
      properties:
        id:
          $ref: '#/components/schemas/uuid'
        email:
          $ref: '#/components/schemas/email'
        display_name:
          type: string
          nullable: true
        is_paused:
          type: boolean
        is_unauthorized:
          type: boolean
      description: Mailbox details embedded in enrollment responses.
    EnrollmentReplyEmailMessage:
      type: object
      required:
        - received_at
      properties:
        received_at:
          type: string
          allOf:
            - $ref: '#/components/schemas/datetime'
          nullable: true
      allOf:
        - $ref: '#/components/schemas/ReplyEmailMessage'
      description: Reply email message details embedded in enrollment responses.
    SequenceEnrollmentStatus:
      type: string
      enum:
        - DRAFT
        - IN_PROGRESS
        - FINISHED
      description: Status of a sequence enrollment.
    ReplyEmailMessage:
      type: object
      required:
        - id
        - subject
        - classifications
      properties:
        id:
          $ref: '#/components/schemas/uuid'
        subject:
          type: string
          nullable: true
        classifications:
          type: array
          items:
            $ref: '#/components/schemas/ReplyEmailClassification'
      description: Reply email message details embedded in sequence API results.
    ReplyEmailClassification:
      type: object
      required:
        - id
        - category
      properties:
        id:
          $ref: '#/components/schemas/uuid'
        category:
          $ref: '#/components/schemas/ReplyEmailClassificationCategory'
      description: Reply email classification details embedded in sequence API results.
    ReplyEmailClassificationCategory:
      type: string
      enum:
        - AUTOMATED
        - NEGATIVE
        - NEUTRAL
        - POSITIVE
      description: Reply classification category.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````