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

# Get one document

> A fresh link to a single document of an invoice, by the id its webhook delivery carried.



## OpenAPI

````yaml openapi.json GET /api/v1/invoices/{id}/documents/{documentId}
openapi: 3.1.0
info:
  title: equate API
  version: 1.0.0
  description: >-
    The public equate Agent API. Send a supplier invoice (as text, a
    base64-encoded file, or a URL) to a published agent and receive structured,
    travel-aware extraction — optionally matched against your booking data.
    Authenticated with a workspace API key.
  contact:
    name: equate support
    email: support@equatetravel.ai
servers:
  - url: https://equatetravel.ai
    description: >-
      Production. Replace with your equate workspace domain if you use a custom
      one.
  - url: http://localhost:3000
    description: Local development
security:
  - apiKey: []
tags:
  - name: Agents
    description: >-
      Invoke a published agent to read a document, say what it is, match it to a
      booking and set off its actions.
  - name: Invoices
    description: >-
      Push invoice documents into the workspace's pipelines, and fetch the
      documents held for an invoice.
paths:
  /api/v1/invoices/{id}/documents/{documentId}:
    get:
      tags:
        - Invoices
      summary: Get one document
      description: >-
        Returns a fresh signed link to one document of an invoice. This is the
        retry path when a link from a webhook delivery has expired or a download
        failed: `id` is the delivery's `data.jobId` and `documentId` the failed
        file's `artifacts[].id`. The document is looked up among that invoice's
        own documents, so an id from another invoice is not found.
      operationId: getInvoiceDocument
      parameters:
        - name: id
          in: path
          required: true
          description: >-
            The invoice's job id. It is `data.jobId` in a webhook delivery and
            in the response to pushing an invoice. For a delivery sent by an
            agent, it is the agent run's id.
          schema:
            type: string
            format: uuid
        - name: documentId
          in: path
          required: true
          description: >-
            The document's id: `artifacts[].id` in a webhook delivery, or
            `documents[].id` from the list.
          schema:
            type: string
            format: uuid
        - name: ttl
          in: query
          required: false
          description: >-
            How long the links should live, in seconds. From 60 (1 minute) to
            604800 (7 days).
          schema:
            type: integer
            minimum: 60
            maximum: 604800
            default: 3600
      responses:
        '200':
          description: The document, with a link valid until `expiresAt`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvoiceDocumentResponse'
              example:
                data:
                  jobId: 0d2c8e6e-5f0b-4a3d-9a3b-4c1e8f0a2b7d
                  reference: OC-44821
                  expiresAt: '2026-12-03T11:30:00.000Z'
                  document:
                    id: 3f9a1c2e-8b7d-4e6f-9a0b-1c2d3e4f5a6b
                    role: agent
                    filename: OC-44821.pdf
                    contentType: application/pdf
                    url: https://app.equatetravel.ai/api/files/<signed token>
        '400':
          description: >-
            `ttl` is not a whole number of seconds from 60 to 604800
            (`VALIDATION_ERROR`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '401':
          description: Missing, malformed, unknown or revoked API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '403':
          description: >-
            The workspace's plan does not include API access
            (`FEATURE_NOT_AVAILABLE`), or the request came from an address
            outside the workspace's IP allowlist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '404':
          description: >-
            No invoice with this id in the key's workspace, the document is not
            one of that invoice's, or its file has been removed by your
            retention period (`NOT_FOUND`). `message` says which of the invoice
            or the document was not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '429':
          description: >-
            Rate limit exceeded (`RATE_LIMITED`). Retry after the number of
            seconds in the `Retry-After` header.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
components:
  schemas:
    InvoiceDocumentResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            jobId:
              type: string
              description: The id you asked with.
            reference:
              type:
                - string
                - 'null'
              description: >-
                The reference read from the invoice, as in a webhook delivery's
                `data.reference`.
            expiresAt:
              type: string
              format: date-time
              description: When the link stops working.
            document:
              $ref: '#/components/schemas/InvoiceDocument'
          required:
            - jobId
            - reference
            - expiresAt
            - document
      required:
        - data
    ApiError:
      type: object
      description: Every error response uses this envelope.
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - UNAUTHORIZED
                - VALIDATION_ERROR
                - SUBSCRIPTION_REQUIRED
                - FEATURE_NOT_AVAILABLE
                - NOT_FOUND
                - AGENT_DISABLED
                - NOT_PUBLISHED
                - PAYLOAD_TOO_LARGE
                - UNSUPPORTED_MEDIA_TYPE
                - FETCH_FAILED
                - INGEST_FAILED
                - RATE_LIMITED
                - RUN_FAILED
                - INTERNAL_ERROR
              description: A stable, machine-readable error code.
            message:
              type: string
              description: A human-readable explanation.
            details:
              type: object
              additionalProperties: true
              description: >-
                Present for `VALIDATION_ERROR`: a flattened list of field
                issues.
          required:
            - code
            - message
        runId:
          type:
            - string
            - 'null'
          description: 'Present on `RUN_FAILED`: the id of the recorded (failed) run.'
    InvoiceDocument:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: >-
            The document's id, the same value as `artifacts[].id` in a webhook
            delivery. It stays the same for the life of the file.
        role:
          type: string
          enum:
            - agent
            - client
            - associated
          description: >-
            `agent` is the invoice itself, `client` a paired guest copy,
            `associated` another file from the same email. The same values as
            `artifacts[].role` in a webhook delivery.
        filename:
          type: string
        contentType:
          type: string
          description: The file's media type, for example `application/pdf`.
        url:
          type: string
          format: uri
          description: >-
            A signed link on equate's own domain. `GET` it to download the file.
            The link needs no API key. Valid until `expiresAt`.
      required:
        - id
        - role
        - filename
        - contentType
        - url
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: >-
        A workspace API key, sent as `Authorization: Bearer ip_live_…`. Create
        and revoke keys in the equate dashboard under Settings → API keys
        (workspace admins only). The full key is shown once at creation — store
        it securely.

````

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