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

# Retrieve a file

> The file object. While uploading, includes `received_segments` so a dropped client can resume by sending only the missing indices.




## OpenAPI

````yaml /openapi.yaml get /v1/files/{id}
openapi: 3.1.0
info:
  title: Patchwork API
  version: 1.0.0
  description: >
    Public data-plane API. Two products today: Identify (bare account
    resolution) and Loom (threads, runs, and outcomes). Every response is a JSON
    envelope — `status: success` with `data`, or `status: error` with `error`.
  contact:
    url: https://usepatchwork.co
servers:
  - url: https://api.usepatchwork.co
security:
  - bearerAuth: []
tags:
  - name: Identify
    description: Resolve an account or wallet to the institution and rails behind it.
  - name: Extract
    description: >-
      Turn a document into structured data, and manage the schema types that
      shape it.
  - name: Loom
    description: Threads, messages, runs, and outcomes for an embedded agent.
  - name: Files
    description: Upload bytes once, get a durable handle, reference it from any product.
  - name: Voice
    description: Transcribe an utterance, speak a reply, list the available voices.
  - name: MCP
    description: >-
      The grants your users hold when they reach an agent from their own AI
      client.
paths:
  /v1/files/{id}:
    get:
      tags:
        - Files
      summary: Retrieve a file
      description: >
        The file object. While uploading, includes `received_segments` so a
        dropped client can resume by sending only the missing indices.
      operationId: getFile
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: The file.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvelopeFile'
        '404':
          description: No such file in this workspace.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    EnvelopeFile:
      type: object
      required:
        - status
        - data
      properties:
        status:
          type: string
          const: success
        data:
          $ref: '#/components/schemas/File'
    Error:
      type: object
      required:
        - status
        - error
      properties:
        status:
          type: string
          const: error
        error:
          type: object
          required:
            - message
            - code
          properties:
            message:
              type: string
              description: Human-readable explanation.
            code:
              type: string
              description: Stable machine-readable code.
            details:
              description: Optional extra context.
    File:
      type: object
      required:
        - id
        - state
        - created_at
      description: >
        A stored file. `sha256` and `size` are present once `state` is `ready`.
        While `state` is `uploading`, `segment_size` and `received_segments`
        describe the resumable session.
      properties:
        id:
          type: string
          description: File handle (`file_…`).
        state:
          type: string
          enum:
            - uploading
            - ready
            - referenced
            - expired
        media_type:
          type: string
        filename:
          type: string
        size:
          type: integer
          description: Byte size, once ready.
        sha256:
          type: string
          description: Whole-file SHA-256, once ready.
        segment_size:
          type: integer
          description: Bytes per segment for a chunked upload (uploading only).
        received_segments:
          type: array
          items:
            type: integer
          description: >-
            Segment indices received so far (uploading only). Resume by sending
            the missing ones.
        expires_at:
          type: string
          format: date-time
        created_at:
          type: string
          format: date-time
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >
        Identify accepts a workspace API key (`sk_…`). Loom accepts either a
        short-lived session token (direct) or a workspace API key (relay).

````

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