---
title: "Upload a screenshot artifact (content-addressed)"
method: PUT
path: "/api/v1/screenshots/{digest}"
tags: ["Screenshots"]
---

# Upload a screenshot artifact (content-addressed)

`PUT /api/v1/screenshots/{digest}`

## Request

- Base URL: `https://dungbeetle.dev`
- URL: `https://dungbeetle.dev/api/v1/screenshots/{digest}`
- Auth: one of:
  - HTTP basic
  - HTTP bearer

The raw PNG body must hash (sha-256) to `{digest}`. Idempotent: a digest the repository already has returns `200` with `deduped: true` without re-storing; a new artifact returns `201`. A body that does not hash to the digest is `400` with code `digest_mismatch`. Requires the `runs:write` scope on agent tokens.

## Path parameters

- `digest` string, required: sha-256 hex digest (content-addressed artifact id).

## Response `200`

Already stored (deduped).

- ScreenshotIngestResult
  - `id` string, required: sha-256 hex digest (content-addressed artifact id).
  - `deduped` boolean, required: True when the repository already had this artifact.

## Other responses

- `201`: Stored.
- `400`: Invalid body or parameter (`code: validation_error`), or — on screenshot upload — a body that does not hash to the digest (`code: digest_mismatch`).
- `401`: Missing/malformed Authorization header (`code: unauthorized`), bad Basic credentials (`code: invalid_credentials`), or an invalid, expired, or revoked agent token (`code: invalid_agent_token`).
- `403`: Agent token outside its granted scopes (`code: missing_scope`, with a `scope` field naming the required scope) or a route that is not agent-accessible at all (`code: agent_forbidden`). Basic-auth requests never see this.
- `413`: Request body exceeds the configured limit (default 25 MiB) (`code: payload_too_large`).
- `429`: Too many failed attempts or uploads from this client (`code: rate_limited`). Honor the `Retry-After` header; successful authenticated requests never count toward the limit.

---

[API](https://skmtc.dev/dungbeetle/apis/dungbeetle-cloud-api.md) · [All operations](https://skmtc.dev/dungbeetle/apis/dungbeetle-cloud-api/llms.txt) · [OpenAPI document](https://skmtc.dev/dungbeetle/apis/dungbeetle-cloud-api/revisions/74778b90420a?raw)
