> ## 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.

# Approve enrollment

> Start an agentic enrollment after reviewing its drafts.

## Overview

[Agentic sequences](/reference/sequences/personalization/agentic-sequences)
generate a draft for each person and wait for approval before the enrollment
starts. While an enrollment waits, `is_draft_approval_pending` is `true`.
Approve the enrollment after reviewing its copy. Approval starts the
enrollment, and automatic emails follow the sequence's
[send schedule](/reference/sequences/send-schedules).

The API returns `409 Conflict` when the enrollment is not waiting for approval,
for example because it was already approved or was canceled. It returns
`400 Bad Request` when the person has opted out of email or is marked do not
email.

## Examples

<AccordionGroup>
  <Accordion title="Review and approve a draft">
    Set `UNIFY_API_KEY` to your API key and replace the example enrollment ID.
    First, list the enrollment's steps to review the drafted copy:

    ```bash theme={null}
    curl --request GET \
      --url "https://api.unifygtm.com/sequences/v1/enrollments/a8b35494-e82e-4a0c-9b8f-0b80c5b5d8f2/steps" \
      --header "X-Api-Key: $UNIFY_API_KEY"
    ```

    Use [Update enrollment step](/developers/api/sequences/enrollments/update-step)
    to revise any email. When the copy is ready, approve the enrollment:

    ```bash theme={null}
    curl --request POST \
      --url "https://api.unifygtm.com/sequences/v1/enrollments/a8b35494-e82e-4a0c-9b8f-0b80c5b5d8f2/approve" \
      --header "X-Api-Key: $UNIFY_API_KEY"
    ```

    A successful response sets `is_draft_approval_pending` to `false`. You can
    still update steps that have not sent.
  </Accordion>
</AccordionGroup>


## OpenAPI

````yaml POST /sequences/v1/enrollments/{id}/approve
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
    variables: {}
security:
  - ApiKeyAuth: []
tags:
  - name: Sequences
  - name: Sequence Enrollment Steps
  - name: Sequence Enrollments
paths:
  /sequences/v1/enrollments/{id}/approve:
    post:
      tags:
        - Sequences
        - Sequence Enrollments
      description: |-
        Approve an AI-drafted enrollment so it starts sending. Returns a bad
        request when the person cannot be emailed. Returns a conflict when the
        enrollment is not waiting for approval.
      operationId: approve_sequence_enrollment
      parameters:
        - name: id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/uuid'
      responses:
        '200':
          description: Response returned when a draft enrollment is approved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApproveEnrollmentSuccessResponse'
        '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 an enrollment is not waiting for approval.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApproveEnrollmentConflictResponse'
        '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:
    uuid:
      type: string
      format: uuid
      description: String UUID value.
    ApproveEnrollmentSuccessResponse:
      type: object
      required:
        - id
        - is_draft_approval_pending
      properties:
        id:
          $ref: '#/components/schemas/uuid'
        is_draft_approval_pending:
          type: boolean
          enum:
            - false
      description: Response returned when a draft enrollment is approved.
    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
          unevaluatedProperties: {}
      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.
    ApproveEnrollmentConflictResponse:
      type: object
      required:
        - current_is_draft_approval_pending
      properties:
        current_is_draft_approval_pending:
          type: boolean
          enum:
            - false
      allOf:
        - type: object
          required:
            - status
            - message
          properties:
            status:
              type: string
              enum:
                - state_conflict
            message:
              type: string
          description: Response for any operation that results in a conflict error.
      description: Response returned when an enrollment is not waiting for approval.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````

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