SPB Git

Repository Public

artifacts.md 10.9 KB 384 lines markdown

1---2title: Artifacts3url: https://platform.claude.com/docs/en/api/compliance/code/artifacts4---56# Artifacts78## List Code Artifacts910**GET** `/v1/compliance/apps/code/artifacts`1112List Claude Code Artifacts owned by organizations under the parent13organization.1415Results are sorted by Artifact identifier. Pages may be short or empty16while `next_page` is still set — continue until `next_page` is absent.17Artifacts are sorted by identifier (not creation time): an Artifact18published during an export may land before the cursor and be omitted, so19for a point-in-time-complete export re-enumerate after publishing20quiesces.2122Artifacts owned by a since-deleted child organization are not23returned.2425### Query parameters2627- `limit: optional number`2829  Maximum results (default: 20, max: 100)3031  default: 20, maximum: 100, minimum: 13233- `organization_ids: optional array of string`3435  Filter by organization IDs (accepts `org_...` or organization UUID, up to 500). Enumerate IDs via `GET /v1/compliance/organizations`.3637  maxItems: 5003839- `page: optional string`4041  Opaque pagination token from a previous response's `next_page` field. Pass this to retrieve the next page of results. Clients should treat this value as an opaque string and not attempt to parse or interpret its contents, as the format may change without notice.4243- `updated_at: optional object`4445  - `gt: optional string`4647    Return only Artifacts updated after this time (RFC 3339 format). See `updated_at.gte` for the completeness caveat.4849    format: date-time5051  - `gte: optional string`5253    Return only Artifacts updated at or after this time (RFC 3339 format). Time filters match an eventually-consistent index and Artifacts published before this field was recorded never match — omit the time filter for compliance-complete enumeration. For incremental export, apply a generous overlap margin between windows and dedupe by `id`: adjacent tiling silently misses items whose index update lagged their publish.5455    format: date-time5657  - `lt: optional string`5859    Return only Artifacts updated before this time (RFC 3339 format). Multiple time operators are AND-ed to the tightest bound. See `updated_at.gte` for the completeness caveat.6061    format: date-time6263  - `lte: optional string`6465    Return only Artifacts updated at or before this time (RFC 3339 format). See `updated_at.gte` for the completeness caveat.6667    format: date-time6869- `user_ids: optional array of string`7071  Filter by owner user IDs (up to 200). Enumerate IDs via `GET /v1/compliance/organizations/{org_uuid}/users`.7273  maxItems: 2007475### Headers7677- `"x-api-key": optional string`7879### Returns8081- `data: array of object`8283  Page of Artifacts8485  - `id: string`8687    Artifact identifier (tagged ID)8889  - `organization_uuid: string`9091    Organization UUID this Artifact belongs to9293  - `owner_user_id: string or null`9495    Artifact owner's user identifier (tagged ID), or null for Artifacts published by an agent session rather than a user account. When set, it survives after the owner's account is deleted or the owner leaves every organization under the parent.9697  - `published_version_id: string or null`9899    Identifier of the version a non-owner viewer would render when `read_mode` permits them — the version the owner has pinned for non-owner readers if one is pinned, otherwise the owner's latest. When `read_mode` is `owner` no non-owner renders any version; the field still reports which version would be served were read_mode widened.100101  - `read_mode: "org" or "owner" or "public" or "users"`102103    Who can view this Artifact: only its owner, a named set of users, every member of its organization, or anyone on the internet (`public`)104105    - `"org"`106107    - `"owner"`108109    - `"public"`110111    - `"users"`112113  - `updated_at: string or null`114115    Artifact last update timestamp, or null for Artifacts published before this field was recorded116117    format: date-time118119  - `user: object or null`120121    The user who owns a Code Artifact.122123    Fields that reference this type are null when the Artifact was124    published by an agent session rather than a user account, when the125    owner's account has been deleted, or when the owner is no longer a126    member of an organization the key may read.127128    - `id: string`129130      User identifier (tagged ID)131132    - `email_address: string`133134      User's email address135136  - `versions: array of object`137138    Up to roughly 20 most-recently-published versions of this Artifact (older versions are not retained). Metadata only — use `GET /v1/compliance/apps/code/artifacts/{artifact_id}/versions/{version_id}` to download a version's content.139140    - `id: string`141142      Opaque version identifier143144    - `created_at: string or null`145146      When this version was published147148      format: date-time149150    - `name: string`151152      Artifact title at this version. Falls back to the version identifier when the title for an older version is no longer retained.153154- `has_more: boolean`155156  Whether `next_page` is set. May be true for a page whose next page is empty — continue until `next_page` is absent.157158- `next_page: string or null`159160  Token to retrieve the next page. Use this as the 'page' parameter in your next request161162### Example163164```bash165curl https://api.anthropic.com/v1/compliance/apps/code/artifacts \166    -H 'anthropic-version: 2023-06-01' \167    -H "Authorization: Bearer $ANTHROPIC_COMPLIANCE_API_KEY"168```169170#### Response (200)171172```json173{174  "data": [175    {176      "id": "cart_01Tu9VwXyZaBcDeFgHiJkLmN",177      "organization_uuid": "a1b2c3d4-e5f6-4789-a012-3456789abcde",178      "owner_user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q",179      "published_version_id": "1741803761-9f3a",180      "read_mode": "org",181      "updated_at": "2025-03-14T09:05:17.456789Z",182      "user": {183        "id": "user_01WCz1FkmYMm4gnmykNKUu3Q",184        "email_address": "jane.doe@example.com"185      },186      "versions": [187        {188          "id": "1741803761-9f3a",189          "created_at": "2025-03-12T18:22:41.123456Z",190          "name": "Team dashboard"191        }192      ]193    }194  ],195  "has_more": true,196  "next_page": "cGFnZV90b2tlbl9leGFtcGxlXzE3MzQ1Njc4OTA="197}198```199200## Download Code Artifact Version Content201202**GET** `/v1/compliance/apps/code/artifacts/{artifact_id}/versions/{version_id}`203204Streams the content of one version of a Claude Code Artifact as the205response body.206207Returns 404 for Artifacts that don't exist or belong to another parent208organization. A listed version id can start returning 404 if subsequent209publishes rotated it out of retained history — re-list on 404. Returns210503 while the version's content upload is211still in flight or was abandoned — retry with backoff. Oversized212encoded content aborts mid-stream: headers and initial bytes arrive213but the body terminates early — an aborted chunked transfer is the214only truncation signal for encoded content. `Content-MD5` is emitted215only for identity-stored content; validate against it when present.216217### Path parameters218219- `artifact_id: string`220221  The Artifact ID (tagged ID, e.g., cart_abc123)222223- `version_id: string`224225  Opaque version identifier from the Artifact's `versions` list226227### Headers228229- `"x-api-key": optional string`230231### Example232233```bash234curl https://api.anthropic.com/v1/compliance/apps/code/artifacts/$ARTIFACT_ID/versions/$VERSION_ID \235    -H 'anthropic-version: 2023-06-01' \236    -H "Authorization: Bearer $ANTHROPIC_COMPLIANCE_API_KEY"237```238239## Delete Code Artifact240241**DELETE** `/v1/compliance/apps/code/artifacts/{artifact_id}`242243Permanently deletes a Code Artifact and all its versions. This is a244destructive operation that cannot be undone. A 200 response means the245deletion is initiated and the Artifact is claimed; content removal246completes asynchronously.247248Returns 404 for Artifacts that don't exist or belong to another parent249organization. Returns 404 on a repeated delete of an already-deleted250Artifact.251252### Path parameters253254- `artifact_id: string`255256  The Artifact ID (tagged ID, e.g., cart_abc123)257258### Headers259260- `"x-api-key": optional string`261262### Returns263264- `type: "code_artifact_deleted"`265266  Constant string confirming deletion267268  default: code_artifact_deleted269270- `id: string`271272  The ID of the Artifact that was deleted273274### Example275276```bash277curl https://api.anthropic.com/v1/compliance/apps/code/artifacts/$ARTIFACT_ID \278    -X DELETE \279    -H 'anthropic-version: 2023-06-01' \280    -H "Authorization: Bearer $ANTHROPIC_COMPLIANCE_API_KEY"281```282283#### Response (200)284285```json286{287  "id": "cart_xyz789",288  "type": "code_artifact_deleted"289}290```291292## Domain types293294### Artifact List Response295296- `ArtifactListResponse object`297298  A hosted site published via Claude Code.299300  - `id: string`301302    Artifact identifier (tagged ID)303304  - `organization_uuid: string`305306    Organization UUID this Artifact belongs to307308  - `owner_user_id: string or null`309310    Artifact owner's user identifier (tagged ID), or null for Artifacts published by an agent session rather than a user account. When set, it survives after the owner's account is deleted or the owner leaves every organization under the parent.311312  - `published_version_id: string or null`313314    Identifier of the version a non-owner viewer would render when `read_mode` permits them — the version the owner has pinned for non-owner readers if one is pinned, otherwise the owner's latest. When `read_mode` is `owner` no non-owner renders any version; the field still reports which version would be served were read_mode widened.315316  - `read_mode: "org" or "owner" or "public" or "users"`317318    Who can view this Artifact: only its owner, a named set of users, every member of its organization, or anyone on the internet (`public`)319320    - `"org"`321322    - `"owner"`323324    - `"public"`325326    - `"users"`327328  - `updated_at: string or null`329330    Artifact last update timestamp, or null for Artifacts published before this field was recorded331332    format: date-time333334  - `user: object or null`335336    The user who owns a Code Artifact.337338    Fields that reference this type are null when the Artifact was339    published by an agent session rather than a user account, when the340    owner's account has been deleted, or when the owner is no longer a341    member of an organization the key may read.342343    - `id: string`344345      User identifier (tagged ID)346347    - `email_address: string`348349      User's email address350351  - `versions: array of object`352353    Up to roughly 20 most-recently-published versions of this Artifact (older versions are not retained). Metadata only — use `GET /v1/compliance/apps/code/artifacts/{artifact_id}/versions/{version_id}` to download a version's content.354355    - `id: string`356357      Opaque version identifier358359    - `created_at: string or null`360361      When this version was published362363      format: date-time364365    - `name: string`366367      Artifact title at this version. Falls back to the version identifier when the title for an older version is no longer retained.368369### Artifact Delete Response370371- `ArtifactDeleteResponse object`372373  Response for deleting a Code Artifact.374375  - `type: "code_artifact_deleted"`376377    Constant string confirming deletion378379    default: code_artifact_deleted380381  - `id: string`382383    The ID of the Artifact that was deleted384
Files main
Menu

Theme