Error Reference
Every error code from the StoneDock Connect API, explained.
Error Response Format
Error bodies are flat — error is the stable, snake_case or UPPER_SNAKE string to branch your
code on. Most endpoint-level validation errors use a lowercase error string with an optional
message and/or endpoint-specific extra fields (details, allowed, missing); errors caught
by the shared exception handler (FHIR-layer failures, not-found patients/practitioners) use an
UPPER_SNAKE code field plus a correlationId you can reference in a support request:
{
"error": "invalid_status",
"allowed": ["draft", "active", "on-hold"]
}{
"code": "PATIENT_NOT_FOUND",
"message": "The requested patient was not found or has not completed provisioning.",
"correlationId": "c0ffee-1234"
}Error Codes
Authentication Errors (401)
error | Cause | Resolution |
|---|---|---|
missing_credentials | X-API-Key header absent | Include the header on every /partner/v1/* request |
authentication_failed | API key doesn't exist, was revoked, or doesn't match the environment (sandbox vs. production) | Check your key in the Partner Portal |
A missing, invalid, or expired X-Consent-Assertion also returns 401 on any
/partner/v1/users/{id}/* endpoint — regenerate a fresh consent token (see
Authentication).
Authorization Errors (403)
error | Cause | Resolution |
|---|---|---|
partner_auth_required | Endpoint requires partner authentication but no valid context was established | Confirm your API key header is present and well-formed |
insufficient_scope | Your partner application doesn't have the scope this endpoint requires | Request the scope be granted to your application |
scope_not_available | The scope requested is reserved and not grantable yet (e.g. a Phase 3 sensitive-category scope) | Contact partners@onepath.health |
Consent revocation also surfaces as a 403 on endpoints gated by X-Consent-Assertion.
Not Found (404)
| Code | Cause | Resolution |
|---|---|---|
fhir_patient_not_found (varies by endpoint) | No user with this externalId exists for your partner, or provisioning hasn't finished | Verify the id; call /onboard if new |
PATIENT_NOT_FOUND / PRACTITIONER_NOT_FOUND | Shared exception-handler equivalents for the same condition on some code paths | Same as above |
Most resource-specific 404s follow the pattern {resource}_not_found (e.g.
practitioner_not_provisioned, questionnaire_response_not_found) — check the endpoint's own
docs in the API Reference for the exact string.
Conflict (409)
| Cause | Resolution |
|---|---|
externalId already onboarded | /onboard is idempotent — re-calling it returns the existing user rather than erroring |
version_conflict | You passed a stale expectedVersion/If-Match on a concurrent-edit-guarded resource (visit notes, medications) |
Validation Errors (422)
Validation failures carry a details array of { field, issue } (or endpoint-specific shape) —
check it rather than hardcoding field names, since the set of required fields can grow across API
versions.
Rate Limit (429)
No response body — respect the Retry-After header (seconds) and the X-RateLimit-* headers.
See Rate Limits.
Server Errors (5xx)
Safe to retry. Use exponential backoff.