> ## 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.

# Files

> Attach a file to a run.

export const OutcrawlStyles = () => {
  if (typeof document !== 'undefined' && !document.getElementById('outcrawl-overrides')) {
    const s = document.createElement('style');
    s.id = 'outcrawl-overrides';
    s.textContent = `
      /* Match the product's radius grid (4 / 6 / 8 / 9999), not Mintlify's default. */
      .rounded-sm { border-radius: 0.375rem !important; } /* 6px, --r-ctl */
      .rounded-md { border-radius: 0.375rem !important; } /* 6px, --r-ctl */
      .rounded-lg { border-radius: 0.5rem !important; }   /* 8px, --r-panel */
      .rounded-l-sm { border-top-left-radius: 0.375rem !important; border-bottom-left-radius: 0.375rem !important; }
      .rounded-r-sm { border-top-right-radius: 0.375rem !important; border-bottom-right-radius: 0.375rem !important; }
      .rounded-l-md { border-top-left-radius: 0.375rem !important; border-bottom-left-radius: 0.375rem !important; }
      .rounded-r-md { border-top-right-radius: 0.375rem !important; border-bottom-right-radius: 0.375rem !important; }
      .rounded-l-lg { border-top-left-radius: 0.5rem !important; border-bottom-left-radius: 0.5rem !important; }
      .rounded-r-lg { border-top-right-radius: 0.5rem !important; border-bottom-right-radius: 0.5rem !important; }

      /* Cards: never pure white in light mode, matching the one-big-card surface tone. */
      .card { background-color: #fcfcfc !important; border-radius: 0.5rem !important; }
      html.dark .card { background-color: #141311 !important; }

      /* Docs hero box */
      .oc-hero { background-color: #fcfcfc; border: 1px solid #e5e2dc; }
      html.dark .oc-hero { background-color: #141311; border-color: #26241f; }
      html.dark .oc-hero h1 { color: #edeae4; }

      /* Thin, transparent-track, hide-until-hover scrollbar. */
      ::-webkit-scrollbar { width: 6px; height: 6px; background-color: transparent; }
      ::-webkit-scrollbar-track { background-color: transparent; }
      ::-webkit-scrollbar-thumb { background-color: rgba(155, 155, 155, 0.5); border-radius: 10px; transition: opacity 0.3s ease; opacity: 0; }
      ::-webkit-scrollbar-thumb:hover { background-color: rgba(155, 155, 155, 0.7); }
      *:hover::-webkit-scrollbar-thumb,
      *:focus::-webkit-scrollbar-thumb,
      *:active::-webkit-scrollbar-thumb { opacity: 1; }
      * { scrollbar-width: thin; scrollbar-color: rgba(155, 155, 155, 0.5) transparent; }
    `;
    document.head.appendChild(s);
  }
  return null;
};

<OutcrawlStyles />

Hand a file to a run so it can attach it to a page, at submit time, mid-run, or before its first step. The call answers a file id the agent uses to attach it; you never send the bytes twice and the model never sees them directly. The file is destroyed when the run ends, on every ending.

There is no matching download call. Use [`agent.results`](/docs/agents/monitoring) for anything a run produced.

<CodeGroup>
  ```typescript TypeScript theme={"theme":{"light":"github-light","dark":"catppuccin-mocha"}}
  import { readFile } from 'node:fs/promises';
  import { Outcrawl } from '@outcrawl/sdk';

  const oc = new Outcrawl();
  const bytes = await readFile('./resume.pdf');
  const file = await oc.agent.job('<id>').addFile({ name: 'resume.pdf', bytes, contentType: 'application/pdf' });
  console.log(file.id);
  ```

  ```python Python theme={"theme":{"light":"github-light","dark":"catppuccin-mocha"}}
  import asyncio
  from pathlib import Path
  from outcrawl import Outcrawl

  async def main():
      async with Outcrawl() as oc:
          content = Path("./resume.pdf").read_bytes()
          file = await oc.agent.job("<id>").add_file(name="resume.pdf", content=content, content_type="application/pdf")
          print(file["id"])

  asyncio.run(main())
  ```

  ```bash CLI theme={"theme":{"light":"github-light","dark":"catppuccin-mocha"}}
  outcrawl agent files add <id> ./resume.pdf
  ```

  ```json MCP (outcrawl_agent_file_add) theme={"theme":{"light":"github-light","dark":"catppuccin-mocha"}}
  {
    "runId": "<id>",
    "name": "resume.pdf",
    "content": "<base64>",
    "contentType": "application/pdf"
  }
  ```
</CodeGroup>

MCP carries the file's bytes as base64 directly in the tool call, it has no other way to move bytes. The CLI takes a file path and reads it for you; the TypeScript SDK takes a raw `Uint8Array` and the Python SDK takes `bytes`, and both encode it for you. All four reach the same endpoint, `POST https://api.outcrawl.ai/v1/agent/<id>/files`.


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