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

# Change the status of an enrollment



## OpenAPI

````yaml patch /enrollments/{id}
openapi: 3.0.0
info:
  title: Product
  description: ''
  version: 0.0.1
  contact:
    name: Delay Support
    url: https://d3lay.com/support
    email: dev@d3lay.com
servers:
  - url: http://localhost:{port}
    description: Local development server
    variables:
      port:
        enum:
          - '80'
          - '8080'
        default: '8080'
  - url: https://hive.test.delay.dev
    description: Integration testing server
security: []
tags:
  - name: Product
  - name: Enrollment
paths:
  /enrollments/{id}:
    patch:
      tags:
        - Enrollment
      summary: Change the status of an enrollment
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/APIVersionHeader'
        - $ref: '#/components/parameters/ContentTypeHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                status:
                  type: string
                  enum:
                    - pending
                    - processing
                    - rejected
                    - approved
                  example: approved
                review_comment:
                  type: string
                  example: Good Choice
              required:
                - status
      responses:
        '200':
          description: Success
          headers:
            X-Message:
              $ref: '#/components/headers/X-Message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnrollmentResponse'
              examples:
                created:
                  summary: Enrollment updated
                  value:
                    id: d4add56e-c345-4ac9-b392-7a890a60559a
                    name: Benjamin Zhang
                    email: z@benwk.com
                    product_id: 393dea2f-1db7-4ffd-9527-d7b89ca59375
                    comment: come on
                    status: approved
                    created_at: '2023-05-06T00:00:00Z'
                    updated_at: '2023-05-06T00:00:00Z'
                    created_by: 98d91cd7-860d-4869-937a-5af32eff2f4a
                    updated_by: 98d91cd7-860d-4869-937a-5af32eff2f4a
          links: {}
        '400':
          $ref: 12ce52b9-5493-4cb7-b2ca-1fcd8ce59c22
          links: {}
        '401':
          $ref: ea6e9bfa-d4ae-45fa-93e4-3be2dd927b08
          links: {}
        '403':
          $ref: 234a0ae5-1229-44f2-81c8-ef041f888eed
          links: {}
        '404':
          $ref: 601a8c48-9c6a-42f8-b0b5-dd7584c05fc5
          links: {}
        '409':
          description: Conflict
          headers:
            X-Message:
              $ref: '#/components/headers/X-Message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConflictResponse'
              examples:
                pendingConflict:
                  summary: Invalid status transition
                  value:
                    error: >-
                      An approved/rejected/processing enrollment cannot be
                      reverted to pending status.
          links: {}
        '429':
          $ref: fa2cd725-d9a6-4a84-a50d-d9969dc4b10c
          links: {}
        '500':
          $ref: a320b3a5-0f0c-4f31-943b-7c9a02387dae
          links: {}
      deprecated: false
      security:
        - BearerAuth: []
components:
  parameters:
    ID:
      name: id
      in: path
      description: ''
      required: true
      example: 6d6ee75a-e20e-4ab3-8785-db9859e4ebed
      schema:
        type: string
    APIVersionHeader:
      name: X-API-Version
      in: header
      description: Your API version
      schema:
        type: string
        enum:
          - v1
        default: v1
    ContentTypeHeader:
      name: Content-Type
      in: header
      description: ''
      required: false
      example: application/json
      schema:
        type: string
        enum:
          - application/json
          - application/xml
          - application/x-www-form-urlencoded
          - application/octet-stream
          - application/pdf
          - text/plain
          - text/html
          - multipart/form-data
  headers:
    X-Message:
      description: Message for the API request
      schema:
        type: string
      example: >
        Data retrieved successfully Data not found Data created successfully
        Data updated successfully Data deleted successfully
  schemas:
    EnrollmentResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
          example: e0e50a85-ddfa-44cf-8cc4-1cd76c06bc54
        name:
          type: string
          example: Benjamin Zhang
        email:
          type: string
          format: email
          example: z@benwk.com
        product_id:
          type: string
          format: uuid
          example: 9068ec25-b433-4bc4-8e99-bbbc4de2d43d
        comment:
          type: string
          example: Let me in!
        status:
          type: string
          enum:
            - pending
            - processing
            - rejected
            - approved
          example: pending
        created_at:
          type: string
          format: date-time
          example: '2023-05-07T00:00:00Z'
        updated_at:
          type: string
          format: date-time
          example: '2023-05-07T00:00:00Z'
        created_by:
          type: string
          format: uuid
          example: 98d91cd7-860d-4869-937a-5af32eff2f4a
          description: REQUIRE metadata permissions
        updated_by:
          type: string
          format: uuid
          example: 98d91cd7-860d-4869-937a-5af32eff2f4a
          description: REQUIRE metadata permissions
      required:
        - id
        - name
        - email
        - product_id
        - comment
        - created_at
        - updated_at
    ConflictResponse:
      type: object
      properties:
        message:
          type: string
          description: Detailed error message.
          example: Conflict.
      required:
        - message
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````