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

# Create approval delegation

> Delegate a user's approvals to another user for a period, such as an out-of-office synced from an HR system.



## OpenAPI

````yaml post /v1/approvals/delegations
openapi: 3.1.0
info:
  title: Hyperline API
  version: 0.0.0
servers:
  - url: https://api.hyperline.co
  - url: https://sandbox.api.hyperline.co
security: []
paths:
  /v1/approvals/delegations:
    post:
      tags:
        - Approval > Delegations
      summary: Create approval delegation
      description: >-
        Delegate a user's approvals to another user for a period, such as an
        out-of-office synced from an HR system.
      operationId: createApprovalDelegation
      requestBody:
        description: Approval delegation creation payload.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateApprovalDelegationCommand'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApprovalDelegation'
        '403':
          description: Access denied.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApprovalDelegationError'
        '404':
          description: Delegation or user not found in this account.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApprovalDelegationError'
      security:
        - bearer: []
components:
  schemas:
    CreateApprovalDelegationCommand:
      type: object
      properties:
        delegator_id:
          type: string
          minLength: 1
          description: >-
            ID of the account member whose approvals are delegated. Supply
            exactly one of `delegator_id` or `delegator_email`.
          example: usr_4sYw1nB8xKe0Qm
        delegator_email:
          type: string
          format: email
          description: >-
            Email of the account member whose approvals are delegated, matched
            case-insensitively. Supply exactly one of `delegator_id` or
            `delegator_email`.
          example: jane@acme.com
        delegate_id:
          type: string
          minLength: 1
          description: >-
            ID of the account member who approves on behalf of the delegator.
            Supply exactly one of `delegate_id` or `delegate_email`.
          example: usr_7GhT2pLq9ZcV3r
        delegate_email:
          type: string
          format: email
          description: >-
            Email of the account member who approves on behalf of the delegator,
            matched case-insensitively. Supply exactly one of `delegate_id` or
            `delegate_email`.
          example: john@acme.com
        starts_at:
          type: string
          format: date-time
          description: UTC timestamp when the delegation starts.
          example: '2026-12-21T00:00:00Z'
        ends_at:
          type: string
          format: date-time
          description: UTC timestamp when the delegation ends. Must be in the future.
          example: '2027-01-04T00:00:00Z'
        reason:
          type:
            - string
            - 'null'
          maxLength: 500
          description: >-
            Free-text reason, such as an out-of-office period. Maximum 500
            characters.
          example: Christmas holidays
        acting_user_id:
          type: string
          minLength: 1
          description: >-
            ID of the account member performing the action, recorded as its
            author. Supply at most one of `acting_user_id` or
            `acting_user_email`. With an API key and no acting user, the action
            is attributed to the API key. With a user token, it must be the
            authenticated user.
        acting_user_email:
          type: string
          format: email
          description: >-
            Email of the account member performing the action, matched
            case-insensitively. Supply at most one of `acting_user_id` or
            `acting_user_email`. With an API key and no acting user, the action
            is attributed to the API key. With a user token, it must be the
            authenticated user.
      required:
        - starts_at
        - ends_at
      additionalProperties: false
    ApprovalDelegation:
      type: object
      properties:
        id:
          type: string
          description: Approval delegation ID.
          example: apd_9dKs02LmPq1a3Z
        status:
          type: string
          enum:
            - scheduled
            - active
            - expired
            - revoked
          description: >-
            Lifecycle status: `scheduled` before `starts_at`, `active` between
            `starts_at` and `ends_at`, `expired` after `ends_at`, `revoked` once
            revoked.
          example: active
        delegator_id:
          type: string
          description: >-
            ID of the user whose approvals are delegated, typically the one out
            of office.
          example: usr_4sYw1nB8xKe0Qm
        delegate_id:
          type: string
          description: ID of the user who approves on behalf of the delegator.
          example: usr_7GhT2pLq9ZcV3r
        starts_at:
          type: string
          format: date-time
          description: UTC timestamp when the delegation starts.
          example: '2026-12-21T00:00:00Z'
        ends_at:
          type: string
          format: date-time
          description: UTC timestamp when the delegation ends. Must be in the future.
          example: '2027-01-04T00:00:00Z'
        reason:
          type:
            - string
            - 'null'
          description: Free-text reason, such as an out-of-office period.
          example: Christmas holidays
        created_at:
          type: string
          format: date-time
          description: UTC timestamp when the delegation was created.
          example: '2024-12-20T16:04:11Z'
        revoked_at:
          type:
            - string
            - 'null'
          format: date-time
          description: UTC timestamp when the delegation was revoked, or null.
          example: '2024-12-20T16:04:11Z'
      required:
        - id
        - status
        - delegator_id
        - delegate_id
        - starts_at
        - ends_at
        - reason
        - created_at
        - revoked_at
    ApprovalDelegationError:
      type: object
      properties:
        message:
          type: string
        code:
          type: string
          description: >-
            Stable reason: approval_user_not_found, approval_actor_not_allowed
            or approval_delegation_not_found.
      required:
        - message
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

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