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

# Hand a file to a run so it can attach it to a page: at submit time, mid-run, or before its first step.

> Hand a file to a run so it can attach it to a page: at submit time, mid-run, or before its first step. Answers a HANDLE the agent uses with attachFile; you never send the bytes twice and the model never sees them. The file is destroyed when the run ends, on every ending. Use it for something the task needs to upload; not to fetch a file the run produced, because downloads do not exist.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/agent/{id}/files
openapi: 3.1.0
info:
  title: Outcrawl API
  version: 1.0.0
  summary: >-
    Web infrastructure for AI agents: scrape, crawl, search, agents and browsers
    on one credit balance.
  description: >-
    Outcrawl exposes one API surface at `https://api.outcrawl.ai/v1`, generated
    here from the 60-row capability registry that is the only truth about what
    it serves. Every request carries one bearer credential: an API key, or an
    OAuth access token from `outcrawl login` or an MCP client that signed in.
    There is exactly one base URL for every capability below.


    This document is GENERATED by `scripts/generate-openapi.mjs` from
    `outcrawl-browser@6631b29`. It is never hand-edited; `node
    scripts/generate-openapi.mjs --check` fails the build on drift.
  contact:
    name: Outcrawl
    url: https://outcrawl.ai/contact
servers:
  - url: https://api.outcrawl.ai
    description: The only API surface.
security:
  - ApiKeyAuth: []
tags:
  - name: Agent
  - name: Crawl
  - name: Credits
  - name: Integrations
  - name: Monitors
  - name: Profiles
  - name: Purchases
  - name: Rules
  - name: Scrape
  - name: Search
  - name: Secrets
  - name: Sessions
  - name: Usage
  - name: Wallet
paths:
  /v1/agent/{id}/files:
    post:
      tags:
        - Agent
      summary: >-
        Hand a file to a run so it can attach it to a page: at submit time,
        mid-run, or before its first step.
      description: >-
        Hand a file to a run so it can attach it to a page: at submit time,
        mid-run, or before its first step. Answers a HANDLE the agent uses with
        attachFile; you never send the bytes twice and the model never sees
        them. The file is destroyed when the run ends, on every ending. Use it
        for something the task needs to upload; not to fetch a file the run
        produced, because downloads do not exist.
      operationId: agentFiles
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The `id` this route addresses.
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              additionalProperties: true
              description: >-
                See the matching capability page under docs/app/ and the SDK
                reference for the exact fields this route accepts.
      responses:
        '200':
          description: >-
            Hand a file to a run so it can attach it to a page: at submit time,
            mid-run, or before its first step. Answers a HANDLE the agent uses
            with attachFile; you never send the bytes twice and the model never
            sees them. The file is destroyed when the run ends, on every ending.
            Use it for something the task needs to upload; not to fetch a file
            the run produced, because downloads do not exist.
          content:
            application/json:
              schema:
                type: object
                description: >-
                  See the matching capability page under docs/app/ and the SDK
                  reference for the exact shape.
        '400':
          description: >-
            The request failed. `code` is one of the 22 values in the Error
            schema below.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: >-
            The request failed. `code` is one of the 22 values in the Error
            schema below.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '402':
          description: >-
            The request failed. `code` is one of the 22 values in the Error
            schema below.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            The request failed. `code` is one of the 22 values in the Error
            schema below.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: >-
            The request failed. `code` is one of the 22 values in the Error
            schema below.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '408':
          description: >-
            The request failed. `code` is one of the 22 values in the Error
            schema below.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: >-
            The request failed. `code` is one of the 22 values in the Error
            schema below.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: >-
            The request failed. `code` is one of the 22 values in the Error
            schema below.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: >-
            The request failed. `code` is one of the 22 values in the Error
            schema below.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: >-
            The request failed. `code` is one of the 22 values in the Error
            schema below.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    Error:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: >-
            Machine-readable, one of the 45 values in the closed union. Branch
            on this, never on `message`.
          enum:
            - unauthorized
            - profile_in_use
            - cap_exceeded
            - exit_unavailable
            - no_capacity
            - tenant_scope
            - bad_request
            - not_found
            - profile_not_found
            - method_not_allowed
            - capability_unavailable
            - decode_unavailable
            - quota_exceeded
            - concurrency_limit
            - plan_required
            - page_unreachable
            - document_unrepresentable
            - page_lost
            - extraction_failed
            - answer_lost
            - deadline_exceeded
            - lab_arm_forbidden
            - search_refused
            - integration_check_failed
            - integration_changed
            - secret_intent_invalid
            - secret_intent_spent
            - cvc_not_storable
            - run_secrets_limit
            - run_secret_undeliverable
            - replay_access_denied
            - replay_control_denied
            - replay_control_cross_site
            - spend_cap_required
            - card_number_in_task
            - merchant_not_allowed
            - spend_cap_exceeded
            - per_purchase_exceeded
            - no_open_purchase
            - approval_denied
            - approval_timed_out
            - secret_in_answer
            - provider_test_failed
            - provider_cards_open
            - internal
        message:
          type: string
          description: Human-readable, fixed per code. Never parsed.
        details:
          type: object
          additionalProperties: true
          description: Optional structured context, shape depends on `code`.
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      description: >-
        An Outcrawl API key, `ock_<keyId>.<secret>`, minted in the console at
        https://outcrawl.ai/console/keys, or an OAuth access token, `oat_...`,
        issued by https://outcrawl.ai/api/auth with scope `api` (the CLI gets
        one from `outcrawl login`, an MCP client when it signs in).

````

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