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

# Get Artifact

> Fetch the status of an artifact referenced on the chat stream

Some tool results reference an **artifact** by `artifact_id` (for example, a persisted chart spec or an exported document). This endpoint returns the artifact's status and, once ready, its metadata. Fetch the bytes with [Get Artifact Payload](/api-reference/artifacts/get-artifact-payload).

<Note>
  Artifacts are member-scoped through the chat they hang off — an artifact from another member's chat returns `404`. This is the structured-output companion to the chat stream; see [Structured Output](/api-reference/chats/visualizations).
</Note>

<Warning>
  `table_export` and its `filename`, `row_count`, and `truncated` metadata are implemented for a forthcoming API deployment. They are not available on the currently deployed API revision.
</Warning>

<ParamField header="Authorization" type="string" required>
  Bearer token obtained from the [authenticate](/api-reference/authentication/authenticate) endpoint.
</ParamField>

<ParamField path="artifact_id" type="string" required>
  The artifact id, as surfaced on a `tool_result` frame.
</ParamField>

## Response

<ResponseField name="id" type="string" required>
  The artifact id.
</ResponseField>

<ResponseField name="artifact_type" type="string" required>
  The kind of artifact, such as `chart_spec`, `plot_html`, `plotly_figure`, or `chat_export`. `table_export` is added by a forthcoming API deployment.
</ResponseField>

<ResponseField name="content_type" type="string" required>
  The MIME type of the payload.
</ResponseField>

<ResponseField name="status" type="string" required>
  One of `pending`, `ready`, or `failed`. A row stuck `pending` past the staleness window reports `failed`.
</ResponseField>

<ResponseField name="filename" type="string | null" required>
  Suggested filename for the payload. `chart_spec` artifacts currently return `null`; choose a local fallback such as `chart.json` when saving the payload.
</ResponseField>

<ResponseField name="error" type="string">
  Failure detail, present only when `status` is `failed`.
</ResponseField>

<ResponseField name="mode" type="string">
  Chat-export mode, present once an export has been written.
</ResponseField>

<ResponseField name="format" type="string">
  Chat-export format, present once an export has been written.
</ResponseField>

<ResponseField name="markdown" type="string">
  The rendered markdown for a chat-export artifact, present once written.
</ResponseField>

<ResponseField name="row_count" type="integer">
  Rows written for a ready `table_export`. `null` for other artifact types and while the export is pending. This additive field is in a forthcoming API deployment and is not on the currently deployed API revision.
</ResponseField>

<ResponseField name="truncated" type="boolean">
  For a ready `table_export`, whether the export reached its separate 250,000-row ceiling. `null` for other artifact types and while pending. This additive field is in a forthcoming API deployment and is not on the currently deployed API revision.
</ResponseField>

<RequestExample>
  ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"}}
  curl -X GET https://api.trellis.sh/v1/artifacts/1b9d4c22-77ea-4d0f-8a3e-9f0c2b6a1e55 \
    -H "Authorization: Bearer YOUR_TOKEN"
  ```

  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import requests

  response = requests.get(
      "https://api.trellis.sh/v1/artifacts/1b9d4c22-77ea-4d0f-8a3e-9f0c2b6a1e55",
      headers={"Authorization": "Bearer YOUR_TOKEN"},
  )
  artifact = response.json()
  ```

  ```javascript JavaScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
  const response = await fetch(
    "https://api.trellis.sh/v1/artifacts/1b9d4c22-77ea-4d0f-8a3e-9f0c2b6a1e55",
    { headers: { Authorization: "Bearer YOUR_TOKEN" } },
  );
  const artifact = await response.json();
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={"theme":{"light":"github-light","dark":"github-dark"}}
  {
    "id": "1b9d4c22-77ea-4d0f-8a3e-9f0c2b6a1e55",
    "artifact_type": "chart_spec",
    "content_type": "application/json",
    "status": "ready",
    "filename": null,
    "error": null,
    "mode": null,
    "format": null,
    "markdown": null
  }
  ```

  ```json 200 (table_export — next deployment) theme={"theme":{"light":"github-light","dark":"github-dark"}}
  {
    "id": "2c0e5d33-88fb-4e10-9b4f-a01d3c7b2f66",
    "artifact_type": "table_export",
    "content_type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
    "status": "ready",
    "filename": "project-budget.xlsx",
    "error": null,
    "mode": null,
    "format": null,
    "markdown": null,
    "row_count": 42831,
    "truncated": false
  }
  ```

  ```json 404 theme={"theme":{"light":"github-light","dark":"github-dark"}}
  {
    "detail": "Artifact not found"
  }
  ```
</ResponseExample>
