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

# Download Artifact

> Download an artifact's bytes in its canonical format

Download an artifact's bytes. A `REPORT` downloads as a PDF; a `SPREADSHEET` downloads as an `.xlsx` workbook. The response is the raw file with `Content-Disposition: attachment`, not JSON.

## Authentication

Requires the `x-api-key` header with a valid workspace API key.

## Path Parameters

<ParamField path="artifactId" type="string" required>
  The artifact id, from a spread's `artifacts` array or the `spread.completed`
  webhook.
</ParamField>

## Response

The raw file bytes. The `Content-Type` header is `application/pdf` for a
`REPORT` and
`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` for a
`SPREADSHEET`. A `404` is returned if the artifact isn't in your workspace.

<RequestExample>
  ```javascript Node.js theme={null}
  const fs = require("fs");

  const response = await fetch(
    "https://api-v2.getomni.ai/api/v1/artifacts/art-report/content",
    { headers: { "x-api-key": "<your-api-key>" } },
  );
  const buffer = Buffer.from(await response.arrayBuffer());
  fs.writeFileSync("spread-report.pdf", buffer);
  ```

  ```python Python theme={null}
  import requests

  url = "https://api-v2.getomni.ai/api/v1/artifacts/art-report/content"
  headers = {"x-api-key": "<your-api-key>"}

  response = requests.request("GET", url, headers=headers)
  with open("spread-report.pdf", "wb") as file:
      file.write(response.content)
  ```

  ```bash cURL theme={null}
  curl --request GET \
    --url https://api-v2.getomni.ai/api/v1/artifacts/art-report/content \
    --header 'x-api-key: <your-api-key>' \
    --output spread-report.pdf
  ```
</RequestExample>
