API Status Codes

Branch on the HTTP status code — and on code where v2 provides it — rather than parsing message text. Exact error shapes vary by endpoint and scenario.

Success Responses

CodeMeaning
200The request succeeded and the body contains the requested data
201The resource was created; the body contains it
202Accepted for processing, but not finished — results become available asynchronously

Error Formats

v2 — Contracting v2, Hierarchies & Identity

{
  "message": "Validation failed",
  "details": [
    { "param": "primaryEmail", "message": "must not be blank" }
  ],
  "code": "validation_failed"
}
FieldDescription
messageHuman-readable summary. Do not parse it for branching.
detailsPer-field validation errors (param + message). Empty for non-400 responses.
codeStable machine-readable code — branch on this.

Identity code values: validation_failed, unauthorized, unauthorized_scope, resource_not_found, conflict, unprocessable, unsupported_media_type, rate_limited, internal.

Contracting v2 does not return code — only message and details. Branch on the HTTP status code for those endpoints.

404 instead of 403 across accounts: requesting a v2 resource that exists but belongs to another customer returns 404, never 403, so resource existence is not leaked across account boundaries. A 403 means your token lacks the required scope.

ProducerSync

{
  "timestamp": 1613510729601,
  "status": 500,
  "error": "Internal Server Error",
  "message": "Error message describing why this was an error.",
  "path": "/v2/{endpoint}"
}

Errors and What To Do

CodeMeaningWhat to check
400Validation error in parameters or bodyParameter names, required fields, and value formats. v2 lists the offending fields in details
401Missing or invalid credentialsThe Authorization: Bearer header, whether the token has expired, and that client_id/client_secret match the token URL you called
403Authenticated, but not permittedYour token is missing a required scope — see Scopes
404No matching resourceThe endpoint path and any ID or NPN in it. On v2, also means the resource belongs to another account
405Unsupported HTTP method for this endpointWhether you're writing to a read-only surface — all Contracting v2 endpoints are GET
429Rate limit exceededBack off and retry — see Rate Limits
500Unexpected server-side errorDo not retry immediately. These are usually transient and alert our team automatically
502 / 504Invalid or missing response from an upstream serverUsually transient; retry with backoff

Requests that return a 404 for a non-existent NPN are not billed.

Reporting an Error

Include the trace ID from the response headers when you contact support@agentsync.io — it lets us find your exact request in our logs. Capture it on failures, not just successes. See Traceability for the header name for each API.