Upload a Snapshot

POST /api/0/projects/{organization_id_or_slug}/{project_id_or_slug}/preprodartifacts/snapshots/

Upload a new snapshot with image metadata.

The request body is a JSON object containing app_id (required), images (required, a mapping of filenames to image metadata objects), and optional VCS fields (head_sha, base_sha, provider, head_repo_name, head_ref, base_repo_name, base_ref, pr_number).

When VCS info with a base_sha is provided and a matching base snapshot exists, a comparison is automatically triggered.

This endpoint requires a bearer token with project:write access.

Path Parameters

organization_id_or_slug (string)
REQUIRED

The ID or slug of the organization the resource belongs to.

project_id_or_slug (string)
REQUIRED

The ID or slug of the project the resource belongs to.

Scopes

<auth_token> requires one of the following scopes:
  • org:ci
  • project:admin
  • project:releases
  • project:write
Copied
curl https://sentry.io/api/0/projects/{organization_id_or_slug}/{project_id_or_slug}/preprodartifacts/snapshots/ \
 -H 'Authorization: Bearer <auth_token>'
RESPONSESCHEMA
Copied
{ "artifactId": "100", "snapshotMetricsId": "200", "imageCount": 5, "snapshotUrl": "https://sentry.io/organizations/org/preprod/snapshots/100/" }
Was this helpful?