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

# Reject request

> Reject an approval request with a required comment.



## OpenAPI

````yaml post /v1/approvals/requests/{id}/reject
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/requests/{id}/reject:
    post:
      tags:
        - Approval > Requests
      summary: Reject request
      description: Reject an approval request with a required comment.
      operationId: rejectApprovalRequest
      parameters:
        - schema:
            type: string
          required: true
          name: id
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RejectApprovalRequestCommand'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApprovalRequest'
        '400':
          description: Invalid decision payload.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                required:
                  - message
        '403':
          description: Access denied.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApprovalRequestError'
        '404':
          description: Request or approver not found in this account.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApprovalRequestError'
        '409':
          description: Approval request or step cannot be decided in its current state.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApprovalRequestError'
      security:
        - bearer: []
components:
  schemas:
    RejectApprovalRequestCommand:
      anyOf:
        - $ref: '#/components/schemas/RejectApprovalRequestByIdCommand'
        - $ref: '#/components/schemas/RejectApprovalRequestByEmailCommand'
    ApprovalRequest:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the approval request.
        status:
          type: string
          enum:
            - pending
            - approved
            - rejected
            - cancelled
          description: >-
            Status of this approval execution, independent of downstream entity
            processing.
        entity:
          $ref: '#/components/schemas/ApprovalRequestEntity'
        workflow:
          type: object
          properties:
            id:
              type: string
              description: Identifier of the approval workflow version.
            version:
              type: integer
              description: Version of the approval workflow.
            original_workflow_id:
              type:
                - string
                - 'null'
              description: >-
                Identifier of the original workflow, or null for its current
                version.
          required:
            - id
            - version
            - original_workflow_id
          description: Workflow version used by this request.
        requested_by_user_id:
          type: string
          description: Identifier of the user who requested approval.
        requester_comment:
          type:
            - string
            - 'null'
          description: Comment supplied when requesting approval.
        current_step_id:
          type:
            - string
            - 'null'
          description: >-
            Identifier of the current step, or null when the request is no
            longer pending.
        steps:
          type: array
          items:
            allOf:
              - $ref: '#/components/schemas/ApprovalWorkflowStep'
              - type: object
                properties:
                  decisions:
                    type: array
                    items:
                      $ref: '#/components/schemas/ApprovalRequestDecision'
                    description: Decisions recorded for this step in chronological order.
                required:
                  - decisions
          description: Workflow steps in execution order, with their recorded decisions.
        created_at:
          type: string
          format: date-time
          description: UTC timestamp when this record was created.
          example: '2024-12-20T16:04:11Z'
        completed_at:
          type:
            - string
            - 'null'
          format: date-time
          description: UTC timestamp when the request completed, or null while pending.
          example: '2024-12-20T16:04:11Z'
      required:
        - id
        - status
        - entity
        - workflow
        - requested_by_user_id
        - requester_comment
        - current_step_id
        - steps
        - created_at
        - completed_at
    ApprovalRequestError:
      type: object
      properties:
        type:
          type: string
          description: HTTP error category.
        statusCode:
          type: integer
          description: HTTP response status.
        message:
          type: string
          description: Human-readable explanation of the failure.
        code:
          type: string
          description: >-
            Stable reason: approval_actor_not_allowed,
            approval_user_not_approver, approval_resource_not_found,
            approval_user_not_found, approval_request_not_pending,
            approval_step_not_current, approval_already_decided,
            approval_request_changed or approval_delegation_ambiguous. Refresh
            the request after a conflict. Completed requests return
            approval_request_not_pending before step or duplicate checks.
      required:
        - type
        - statusCode
        - message
        - code
    RejectApprovalRequestByIdCommand:
      type: object
      properties:
        step_id:
          type: string
          minLength: 1
          description: >-
            Expected current workflow step ID. A stale step is rejected instead
            of deciding the next step.
        approver_id:
          type: string
          minLength: 1
          description: >-
            Identifier of the account member making the decision. Supply exactly
            one of approver_id or approver_email. With a user token, this must
            be the authenticated user.
        comment:
          type: string
          minLength: 1
          maxLength: 2000
          description: >-
            Decision comment. Required and nonblank when rejecting; optional
            when approving. Trimmed, with a maximum of 2000 characters.
      required:
        - step_id
        - approver_id
        - comment
      additionalProperties: false
      title: By user ID
    RejectApprovalRequestByEmailCommand:
      type: object
      properties:
        step_id:
          type: string
          minLength: 1
          description: >-
            Expected current workflow step ID. A stale step is rejected instead
            of deciding the next step.
        approver_email:
          type: string
          format: email
          description: >-
            Email of the account member making the decision, matched
            case-insensitively. Supply exactly one of approver_id or
            approver_email. With a user token, this must be the authenticated
            user.
        comment:
          type: string
          minLength: 1
          maxLength: 2000
          description: >-
            Decision comment. Required and nonblank when rejecting; optional
            when approving. Trimmed, with a maximum of 2000 characters.
      required:
        - step_id
        - approver_email
        - comment
      additionalProperties: false
      title: By email
    ApprovalRequestEntity:
      oneOf:
        - $ref: '#/components/schemas/ApprovalRequestQuote'
        - $ref: '#/components/schemas/ApprovalRequestSubscription'
        - $ref: '#/components/schemas/ApprovalRequestSubscriptionTransition'
        - $ref: '#/components/schemas/ApprovalRequestInvoice'
        - $ref: '#/components/schemas/ApprovalRequestWorkflowStep'
      discriminator:
        propertyName: type
        mapping:
          quote: '#/components/schemas/ApprovalRequestQuote'
          subscription: '#/components/schemas/ApprovalRequestSubscription'
          subscription_transition: '#/components/schemas/ApprovalRequestSubscriptionTransition'
          invoice: '#/components/schemas/ApprovalRequestInvoice'
          workflow_step: '#/components/schemas/ApprovalRequestWorkflowStep'
      description: Entity whose operation requires approval.
    ApprovalWorkflowStep:
      type: object
      properties:
        id:
          type: string
          description: Approval workflow step ID.
          example: aps_DKL4Xcb5VSa8CQ
        name:
          type: string
          description: Approval workflow step name.
          example: Finance approval
        order:
          type: integer
          description: Step order. Orders must be sequential starting from 1.
          example: 1
        approver_requirement:
          type: string
          enum:
            - any
            - all
          description: Whether any approver or all approvers must approve the step.
          example: any
        approver_role_ids:
          type: array
          items:
            type: string
          description: User role IDs that can approve the step.
          example:
            - rol_DKL4Xcb5VSa8CQ
        approver_user_ids:
          type: array
          items:
            type: string
          description: User IDs that can approve the step.
          example:
            - usr_DKL4Xcb5VSa8CQ
        approver_sources:
          type: array
          items:
            type: string
            enum:
              - manager_of_owner
          description: >-
            Dynamic approver sources resolved per request. `manager_of_owner`
            resolves to the manager of the user who owns the entity under
            approval — for a quote, its owner, meaning the user who created it
            or whoever it was later reassigned to — falling back to the user who
            requested the approval. The manager is the one set on their
            membership, and the source resolves to nobody when that user has no
            active manager in the account.
          example:
            - manager_of_owner
      required:
        - id
        - name
        - order
        - approver_requirement
        - approver_role_ids
        - approver_user_ids
        - approver_sources
    ApprovalRequestDecision:
      type: object
      properties:
        id:
          type: string
          description: Identifier of the recorded decision.
        approver_id:
          type: string
          description: Identifier of the effective approver, which can be the delegator.
        actor_user_id:
          type: string
          description: Identifier of the user who made the decision.
        approval_delegation_id:
          type:
            - string
            - 'null'
          description: Identifier of the delegation used, or null for a direct decision.
        decision:
          type: string
          enum:
            - approved
            - rejected
          description: Decision made by this approver.
        comment:
          type:
            - string
            - 'null'
          description: >-
            Decision comment. Required and nonblank when rejecting; optional
            when approving. Trimmed, with a maximum of 2000 characters.
        created_at:
          type: string
          format: date-time
          description: UTC timestamp when this record was created.
          example: '2024-12-20T16:04:11Z'
      required:
        - id
        - approver_id
        - actor_user_id
        - approval_delegation_id
        - decision
        - comment
        - created_at
    ApprovalRequestQuote:
      type: object
      properties:
        type:
          type: string
          enum:
            - quote
          description: Type of entity requiring approval.
        quote_id:
          type: string
          description: Identifier of the entity requiring approval.
      required:
        - type
        - quote_id
      additionalProperties: false
      title: Quote
    ApprovalRequestSubscription:
      type: object
      properties:
        type:
          type: string
          enum:
            - subscription
          description: Type of entity requiring approval.
        subscription_id:
          type: string
          description: Identifier of the entity requiring approval.
      required:
        - type
        - subscription_id
      additionalProperties: false
      title: Subscription
    ApprovalRequestSubscriptionTransition:
      type: object
      properties:
        type:
          type: string
          enum:
            - subscription_transition
          description: Type of entity requiring approval.
        subscription_transition_id:
          type: string
          description: Identifier of the entity requiring approval.
      required:
        - type
        - subscription_transition_id
      additionalProperties: false
      title: SubscriptionTransition
    ApprovalRequestInvoice:
      type: object
      properties:
        type:
          type: string
          enum:
            - invoice
          description: Type of entity requiring approval.
        invoice_id:
          type: string
          description: Identifier of the entity requiring approval.
      required:
        - type
        - invoice_id
      additionalProperties: false
      title: Invoice
    ApprovalRequestWorkflowStep:
      type: object
      properties:
        type:
          type: string
          enum:
            - workflow_step
          description: Type of entity requiring approval.
        workflow_step_run_id:
          type: string
          description: Identifier of the entity requiring approval.
      required:
        - type
        - workflow_step_run_id
      additionalProperties: false
      title: WorkflowStep
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

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