Skip to main content
POST
/
v1
/
source-snapshots
curl -X POST https://api.dari.dev/v1/source-snapshots \
  -H "Authorization: Bearer $DARI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "format": "tar.gz",
    "sha256": "ea7c6ab2ebd3691173066598e6880159efb39df02ac170477dad66f5b83bea8e",
    "size_bytes": 612,
    "metadata": {
      "commit_sha": "deadbeef",
      "github_run_id": "42"
    }
  }'
{
  "source_snapshot_id": "src_456",
  "upload_url": "https://storage.example/upload/abc",
  "upload_headers": {
    "Content-Type": "application/gzip"
  },
  "expires_at": "2026-03-31T18:55:00Z",
  "status": "pending_upload"
}
Reserves a durable source snapshot ID and returns an opaque upload target for the bundle archive. This is the first raw-API step before Create Agent or Publish New Version. The upload_url is provider-specific; upload the tarball there exactly as returned, then call Finalize Source Snapshot.

Headers

Authorization
string
required
Bearer token using your Dari API key.
Content-Type
string
required
Must be application/json

Request Body

format
string
required
Archive format. Today this must be tar.gz.
sha256
string
required
Lowercase SHA-256 digest of the archive bytes.
size_bytes
integer
required
Exact archive size in bytes.
metadata
object
Optional audit metadata such as commit_sha, CI identifiers, or provider run URLs.

Response Fields

source_snapshot_id
string
Durable source snapshot ID.
upload_url
string
Opaque provider upload URL for the archive bytes.
upload_headers
object
Required request headers for the upload step.
expires_at
string
Expiration time for the upload target.
status
string
Initial snapshot status, currently pending_upload.
curl -X POST https://api.dari.dev/v1/source-snapshots \
  -H "Authorization: Bearer $DARI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "format": "tar.gz",
    "sha256": "ea7c6ab2ebd3691173066598e6880159efb39df02ac170477dad66f5b83bea8e",
    "size_bytes": 612,
    "metadata": {
      "commit_sha": "deadbeef",
      "github_run_id": "42"
    }
  }'
{
  "source_snapshot_id": "src_456",
  "upload_url": "https://storage.example/upload/abc",
  "upload_headers": {
    "Content-Type": "application/gzip"
  },
  "expires_at": "2026-03-31T18:55:00Z",
  "status": "pending_upload"
}