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

# Get approval status and callback delivery

> Returns the approval's status and whether the result reached your `callback.url`. Use
`GET /v1/approvals/{requestId}/result` for the answer itself.




## OpenAPI

````yaml /api-reference/agent-api-openapi.yaml get /v1/approvals/{requestId}
openapi: 3.0.3
info:
  title: FinalSay Agent API
  description: >
    Ask a person before your agent acts. Create an approval, then poll for the
    result or receive it on a callback URL.


    Approval endpoints need two headers: `X-Agent-Id` (the agent's UUID) and
    `X-Api-Key` (a workspace API key).

    `GET /v1/agents` needs only `X-Api-Key`.
  version: 1.0.0
servers:
  - url: https://api.finalsay-hitl.com
security:
  - AgentId: []
    ApiKey: []
tags:
  - name: Approvals
    description: Create approvals and read their outcome
  - name: Agents
    description: List the agents a workspace API key can act as
paths:
  /v1/approvals/{requestId}:
    get:
      tags:
        - Approvals
      summary: Get approval status and callback delivery
      description: >
        Returns the approval's status and whether the result reached your
        `callback.url`. Use

        `GET /v1/approvals/{requestId}/result` for the answer itself.
      operationId: getApprovalMetadata
      parameters:
        - $ref: '#/components/parameters/RequestId'
      responses:
        '200':
          description: Status and delivery state
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApprovalMetadata'
        '401':
          description: Missing or invalid agent authentication
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorAgentAuth'
        '404':
          description: No approval with this `request_id` for this agent
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorNotFound'
components:
  parameters:
    RequestId:
      name: requestId
      in: path
      required: true
      description: >-
        The `request_id` returned when you created the approval (yours, or the
        one the server generated).
      schema:
        type: string
        minLength: 1
        maxLength: 120
  schemas:
    ApprovalMetadata:
      type: object
      required:
        - request_id
        - status
        - expires_at
        - result_delivery_status
        - result_delivery_error
      properties:
        request_id:
          type: string
        status:
          $ref: '#/components/schemas/ApprovalStatus'
        expires_at:
          type: string
          format: date-time
        result_delivery_status:
          type: string
          enum:
            - pending
            - delivered
            - failed
          description: >-
            `delivered`: your callback URL returned 2xx. `failed`: every attempt
            failed. `pending`: not delivered yet, or no callback was set.
        result_delivery_error:
          type: string
          nullable: true
          description: >-
            The last delivery error, such as an HTTP status and the start of the
            response body.
    ErrorAgentAuth:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          enum:
            - missing_agent_auth
            - invalid_agent
            - invalid_api_key
    ErrorNotFound:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          enum:
            - not_found
    ApprovalStatus:
      type: string
      enum:
        - pending
        - selected_option
        - custom_instruction
        - expired
      description: >-
        `pending`: waiting. `selected_option`: someone picked an option.
        `custom_instruction`: someone wrote an answer. `expired`: nobody
        answered in time.
  securitySchemes:
    AgentId:
      type: apiKey
      in: header
      name: X-Agent-Id
      description: >-
        The agent's UUID, from the agent's page in the web dashboard or `GET
        /v1/agents`.
    ApiKey:
      type: apiKey
      in: header
      name: X-Api-Key
      description: >-
        A workspace API key (starts with `hitl_`). Shown once when an owner or
        admin creates it.

````

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