Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Understand error responses and how to handle them
{ "error": { "code": "not_found", "message": "The requested contract does not exist or is not accessible", "request_id": "req_abc123def456" } }
code
message
request_id
400
validation_failed
401
unauthorized
403
forbidden
404
not_found
429
rate_limited
500
internal_error
const response = await fetch(url, { headers }); if (!response.ok) { const body = await response.json(); const { code, message, request_id } = body.error; switch (code) { case "rate_limited": const retryAfter = response.headers.get("Retry-After"); // Wait and retry break; case "unauthorized": // Check your API key break; case "not_found": // Resource doesn't exist or isn't in your scope break; default: console.error(`API error [${request_id}]: ${code} - ${message}`); } }
X-Request-ID
curl -v https://prod-api.civicmarketplace.com/v1/contracts/ctr_invalid \ -H "Authorization: Bearer cmp_live_YOUR_KEY" # Response headers will include: # X-Request-ID: req_abc123def456