> ## 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 the result

> Returns `{ "request_id", "status": "pending", "answer": null }` until someone answers or the approval expires, then the full
result. The body POSTed to your `callback.url` is the same resolved object.




## OpenAPI

````yaml /api-reference/agent-api-openapi.yaml get /v1/approvals/{requestId}/result
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}/result:
    get:
      tags:
        - Approvals
      summary: Get the result
      description: >
        Returns `{ "request_id", "status": "pending", "answer": null }` until
        someone answers or the approval expires, then the full

        result. The body POSTed to your `callback.url` is the same resolved
        object.
      operationId: getApprovalResult
      parameters:
        - $ref: '#/components/parameters/RequestId'
      responses:
        '200':
          description: Pending, or the resolved result
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ResultPending'
                  - $ref: '#/components/schemas/ResultResolved'
        '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:
    ResultPending:
      type: object
      required:
        - request_id
        - status
      properties:
        request_id:
          type: string
        status:
          type: string
          enum:
            - pending
        answer:
          type: string
          nullable: true
          description: Always `null` while pending.
    ResultResolved:
      type: object
      required:
        - request_id
        - agent_id
        - correlation_id
        - status
        - selected_option_index
        - selected_option_label
        - selected_option_value
        - custom_instruction
        - fallback_applied
        - answer
        - resolved_by
        - resolved_at
      properties:
        request_id:
          type: string
        agent_id:
          type: string
          format: uuid
        correlation_id:
          type: string
          nullable: true
        status:
          type: string
          enum:
            - selected_option
            - custom_instruction
            - expired
        selected_option_index:
          type: integer
          nullable: true
          description: Zero-based position of the chosen option in the `options` you sent.
        selected_option_label:
          type: string
          nullable: true
        selected_option_value:
          type: string
          nullable: true
          description: The `value` you sent for the chosen option.
        custom_instruction:
          type: string
          nullable: true
          description: >-
            What the reviewer wrote. On an `expired` approval with a fallback
            instruction, the fallback text.
        fallback_applied:
          type: boolean
          description: >-
            `true` when nobody answered and `custom_instruction` holds the
            approval's fallback instruction. `false` otherwise, including an
            `expired` approval with no fallback.
        answer:
          type: string
          nullable: true
          description: >-
            The answer in one field: the chosen option's `value`, what the
            reviewer wrote, or on an `expired` approval the fallback
            instruction. `null` when it expired with no fallback.
        resolved_by:
          type: object
          nullable: true
          description: Who answered. `null` when the approval expired.
          required:
            - user_id
            - name
          properties:
            user_id:
              type: string
              format: uuid
            name:
              type: string
              nullable: true
              description: The reviewer's display name, when they set one.
        resolved_at:
          type: string
          format: date-time
    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
  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.