Skip to content
Zaraftis API
Esc
↑↓navigate↵open⌘Jpreview

Create a scan report

Creates a report that cannot change later from exact source ids. Free: the scan was already paid for. Returns 202 with a task. Body: { scan_id (terminal scan, uuid, required), audit_id?, gsc_snapshot_id?, ga4_snapshot_id?, baseline_report_ids? }. Every included source is an exact id: an unknown or inaccessible id answers 404; a same-workspace source that belongs to a different brand or carries no usable result answers 422 incomplete_evidence with details.unavailable_source_ids; a baseline whose scan is not strictly earlier answers 409. An identical selection stored before this request returns the existing report instead of creating a duplicate; the completed task identifies the resulting report_id. Exact source-ID validation occurs before the task is accepted.

POST/scan-reports
Authorization
AuthorizationBearer token · headerrequired

API key sent as Authorization: Bearer <key>. A key belongs to one workspace, has scopes, and can be limited to some brands.

or
AuthorizationOAuth2 access token · headerrequired

OAuth 2.1 sign-in (authorization code with PKCE) used by AI assistants that connect through the Zaraftis MCP server. Discovery URLs are at https://api.zaraftis.com/api/auth.

Header parameters
Idempotency-Keystringrequired

A new value, such as a UUID, for each new request. Send the same value to retry a request safely; see https://docs.zaraftis.com/conventions#safe-retries-with-idempotency-key.

min length 1 · max length 64
Request body
requiredapplication/json
scan_idstring<uuid>required
matches ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
audit_idstring<uuid>
matches ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
gsc_snapshot_idstring<uuid>
matches ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
ga4_snapshot_idstring<uuid>
matches ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
baseline_report_idsstring<uuid>[]
Responses
202

Accepted report creation (task reference)

AcceptedScanReportEnvelope
400

bad_request or validation_failed

successbooleanrequired
errorobjectrequired
Show properties
codestringrequired
messagestringrequired
retryablebooleanrequired
detailsobject
field_errorsobject[]
Show properties
Array of object
fieldstringrequired
codestringrequired
Allowed:requiredformattoo_smalltoo_largeunrecognized_keyinvalid
messagestringrequired
request_idRequestIdrequired
404

not_found: unknown id, or an id this key cannot see

successbooleanrequired
errorobjectrequired
Show properties
codestringrequired
messagestringrequired
retryablebooleanrequired
detailsobject
field_errorsobject[]
Show properties
Array of object
fieldstringrequired
codestringrequired
Allowed:requiredformattoo_smalltoo_largeunrecognized_keyinvalid
messagestringrequired
request_idRequestIdrequired
409

conflict, duplicate_url, or idempotency_conflict

successbooleanrequired
errorobjectrequired
Show properties
codestringrequired
messagestringrequired
retryablebooleanrequired
detailsobject
field_errorsobject[]
Show properties
Array of object
fieldstringrequired
codestringrequired
Allowed:requiredformattoo_smalltoo_largeunrecognized_keyinvalid
messagestringrequired
request_idRequestIdrequired
422

incomplete_evidence

successbooleanrequired
errorobjectrequired
Show properties
codestringrequired
messagestringrequired
retryablebooleanrequired
detailsobject
field_errorsobject[]
Show properties
Array of object
fieldstringrequired
codestringrequired
Allowed:requiredformattoo_smalltoo_largeunrecognized_keyinvalid
messagestringrequired
request_idRequestIdrequired
Request
curl -X POST 'https://api.zaraftis.com/v1/scan-reports' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Idempotency-Key: string' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "scan_id": "9a59f0f5-5572-476d-a7fc-c960ef43a5af",
  "audit_id": "78c04fa6-cfb4-46a0-9aa5-3681ba4f3897",
  "gsc_snapshot_id": "7e81950b-220f-48de-8e3c-3254eb376afb",
  "ga4_snapshot_id": "94516159-0fec-4a5a-96b0-837506fe3d40",
  "baseline_report_ids": [
    "497f6eca-6276-4993-bfeb-53cbbbba6f08"
  ]
}'
Response
Accepted report creation (task reference)

Was this page helpful?