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

# Enroll user in track

> Enroll a user in a track. The user must be connected to Slack and have at least one role assigned. Exactly one of email, user_id, or slack_user_id must be provided to identify the user.



## OpenAPI

````yaml /openapi.json post /v1/tracks/{trackId}/enroll
openapi: 3.0.3
info:
  title: Doozy Public API
  version: 1.0.0
  description: >-
    The Doozy Public API allows you to programmatically access your
    organization's data.


    ## Authentication


    All API requests require an API key passed in the `x-api-key` header.


    ```

    x-api-key: dzy_xxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

    ```


    API keys can be generated and managed through the Doozy dashboard. Each key
    is associated with a user account and inherits that user's permissions.


    ## Rate Limiting


    API requests are rate limited. Rate limiting is handled by Cloudflare. If
    you exceed the rate limit, you'll receive a 429 Too Many Requests response.


    ## Pagination


    List endpoints support cursor-based pagination using `limit` and
    `starting_after` query parameters.
  contact:
    name: Doozy Support
    email: support@doozy.live
    url: https://help.doozy.live/api
servers:
  - url: https://api.doozy.live
    description: Production
security:
  - apiKey: []
tags:
  - name: Quizzes
    description: Quiz analytics and reporting endpoints
  - name: Tracks
    description: Track management and analytics endpoints
  - name: Surveys
    description: Survey and poll analytics endpoints
  - name: Introductions
    description: Doozy Roulette and Matchmaking introduction endpoints
paths:
  /v1/tracks/{trackId}/enroll:
    post:
      tags:
        - Tracks
      summary: Enroll user in track
      description: >-
        Enroll a user in a track. The user must be connected to Slack and have
        at least one role assigned. Exactly one of email, user_id, or
        slack_user_id must be provided to identify the user.
      parameters:
        - schema:
            type: string
            minLength: 1
            maxLength: 128
            pattern: ^[A-Za-z0-9_-]+$
            description: The unique identifier of the track
            example: wf_abc123xyz
          required: true
          description: The unique identifier of the track
          name: trackId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EnrollUserBody'
      responses:
        '201':
          description: User successfully enrolled in track
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnrollUserResponse'
        '400':
          description: >-
            Invalid request - missing identifier, user not connected to Slack,
            or user missing roles
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Authentication required - missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Invalid API key or insufficient permissions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Track not found, user does not have access, or user not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: >-
            Conflict - user is already enrolled or has already completed the
            track
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - apiKey: []
components:
  schemas:
    EnrollUserBody:
      type: object
      properties:
        email:
          type: string
          maxLength: 254
          format: email
          description: The email address of the user to enroll
          example: user@example.com
        user_id:
          type: string
          minLength: 1
          maxLength: 128
          pattern: ^[A-Za-z0-9_-]+$
          description: The Doozy user ID of the user to enroll
          example: abc123
        slack_user_id:
          type: string
          minLength: 1
          maxLength: 128
          pattern: ^[A-Za-z0-9_-]+$
          description: The Slack user ID of the user to enroll
          example: U01ABC2DEF3
        allow_already_completed:
          type: boolean
          default: false
          description: >-
            Allow enrolling a user who has previously completed this track.
            Defaults to false.
          example: false
        start_at:
          type: string
          format: date-time
          description: >-
            ISO 8601 timestamp for when the user should start the track.
            Defaults to now. Can be set to a future date to schedule enrollment.
          example: '2026-02-20T09:00:00.000Z'
        catch_up:
          type: boolean
          description: >-
            Override the Track's catch-up setting for this enrollment. If a
            step's send time has passed, `true` makes overdue steps eligible in
            order; working hours can delay delivery. `false` shifts the Track so
            Day 1 starts on the next working day. Omit to inherit the Track
            setting.
          example: true
        working_hours:
          $ref: '#/components/schemas/WorkingHours'
        run_every_day:
          type: boolean
          description: >-
            Deprecated compatibility override. `true` changes only this
            enrollment's working days to all seven days while preserving its
            inherited hours and time zone. `working_hours` takes precedence when
            both fields are sent.
          example: false
          deprecated: true
      additionalProperties: false
    EnrollUserResponse:
      type: object
      properties:
        object:
          type: string
          enum:
            - track_enrollment
          description: The object type
          example: track_enrollment
        track_id:
          type: string
          description: The ID of the track the user was enrolled in
          example: wf_abc123xyz
        user_id:
          type: string
          description: The Doozy user ID of the enrolled user
          example: usr_abc123
        instance_id:
          type: string
          description: The ID of the workflow instance created for this enrollment
          example: inst_xyz789
        status:
          type: string
          enum:
            - active
          description: The status of the enrollment
          example: active
        enrolled_at:
          type: string
          description: ISO 8601 timestamp of when the user was enrolled
          example: '2026-02-18T10:30:00.000Z'
        starts_at:
          type: string
          description: >-
            ISO 8601 timestamp of when the user will start the track (may be in
            the future if scheduled)
          example: '2026-02-20T09:00:00.000Z'
      required:
        - object
        - track_id
        - user_id
        - instance_id
        - status
        - enrolled_at
        - starts_at
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            type:
              type: string
              enum:
                - api_error
                - authentication_error
                - invalid_request_error
                - rate_limit_error
              description: The type of error returned
              example: invalid_request_error
            code:
              type: string
              nullable: true
              description: Machine-readable error code for specific error conditions
              example: resource_not_found
            message:
              type: string
              description: Human-readable error message
              example: 'No such quiz: quiz_abc123'
            param:
              type: string
              nullable: true
              description: The parameter related to the error, if applicable
              example: id
            doc_url:
              type: string
              format: uri
              description: URL to documentation about this error
              example: https://docs.doozy.live/api/errors#resource_not_found
          required:
            - type
            - code
            - message
      required:
        - error
    WorkingHours:
      type: object
      properties:
        days_of_week:
          type: array
          items:
            type: string
            enum:
              - monday
              - tuesday
              - wednesday
              - thursday
              - friday
              - saturday
              - sunday
          minItems: 1
        start_time:
          type: string
          pattern: ^([01]\d|2[0-3]):[0-5]\d$
        end_time:
          type: string
          pattern: ^([01]\d|2[0-3]):[0-5]\d$
        time_zone:
          type: string
      required:
        - days_of_week
        - start_time
        - end_time
        - time_zone
      additionalProperties: false
      description: >-
        Complete policy snapshot for this enrollment. Omit to inherit the
        resolved Track policy.
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: API key for authentication. Generate keys in the Doozy dashboard.

````

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