---
title: "Re-run the artifact's SQL under the caller's current org and business-unit scope"
method: POST
path: "/v2/artifacts/{artifact_id}/refresh"
tags: ["artifacts"]
---

# Re-run the artifact's SQL under the caller's current org and business-unit scope

`POST /v2/artifacts/{artifact_id}/refresh`

## Request

- Base URL: `https://api.stuut.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.stuut.ai/v2/artifacts/{artifact_id}/refresh`
- Auth: HTTP bearer

Runs synchronously and returns the artifact with its new `status`: `fresh`
with a new snapshot, `needs_reask` when the saved SQL no longer runs, or
`failed` for a transient error. The last result is kept in both failure
cases. Returns 409 while a refresh of this artifact is already in flight.

## Path parameters

- `artifact_id` string, uuid, required

## Response `200`

Successful Response

- ArtifactDetail: Summary plus the last result, in the same shape the chat renders. For a table: `{"columns": [...], "rows": [...], "totalRows": n}` (rows capped, `sql` blank). For a chart: `{"spec": <vega-lite with data.values>}`.
  - `id` string, uuid, required
  - `title` string, required
  - `kind` 'table' | 'chart', required: What an Ask Stuut artifact renders as.
  - `status` 'resolving' | 'fresh' | 'refreshing' | 'failed' | 'needs_reask', required: Refresh state of an Ask Stuut artifact. RESOLVING: just saved; a background job is looking up the SQL behind it, so whether this artifact can ever refresh is not known yet. FRESH: snapshot reflects the last successful run. REFRESHING: a rerun is in flight. FAILED: the last rerun errored for a transient reason; snapshot kept. NEEDS_REASK: no SQL could be found, or the saved SQL no longer runs (e.g. a model was renamed); the snapshot is kept and the user re-asks the question in a new chat. Refresh is offered only for FRESH, FAILED and REFRESHING.
  - `question` string, required
  - `totalRows` integer, nullable, required
  - `createdAt` string, date-time, required
  - `updatedAt` string, date-time, required
  - `lastRefreshedAt` string, date-time, nullable, required
  - `lastError` string, nullable, required
  - `sourceChatId` string, uuid, nullable, required
  - `sourceMessageId` string, uuid, nullable, required
  - `sourcePartOrder` integer, nullable, required
  - `snapshot` object, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/stuut/apis/stuut-api.md) - [All operations](https://skmtc.dev/stuut/apis/stuut-api/llms.txt) - [OpenAPI document](https://skmtc.dev/stuut/apis/stuut-api/revisions/3b5ab941f918?raw)
