Errors
Interpret Auth OAuth failures and Gateway HTTP / business-wrapper errors consistently in your client.
HTTP status codes
| Status | Typical meaning | Where |
|---|---|---|
400 | Malformed token request or invalid parameters | Auth /connect/token; some Gateway validation |
401 | Missing, expired, or invalid Bearer token; bad credentials or refresh token | Auth and Gateway |
403 | Authenticated but not allowed for the resource or action | Gateway |
404 | Unknown path or resource | Gateway |
415 | Unsupported media type (token calls must use form URL-encoded) | Auth |
5xx | Unexpected server or upstream failure | Auth or Gateway |
Retry 5xx with backoff. Do not retry 401/403 without fixing credentials or authorization.
OAuth error body (Auth)
Token endpoint errors return JSON such as:
{
"error": "invalid_grant",
"error_description": "invalid_username_or_password"
}
error | Common causes |
|---|---|
invalid_grant | Wrong password, invalid/expired refresh token, or grant rejected |
access_denied | User/org inactive, incomplete org profile, or policy denial |
invalid_client | Wrong client_id |
unsupported_grant_type | grant_type not password or refresh_token |
invalid_request | Missing required fields |
Wrong Content-Type example:
curl -X POST "https://earthlife.sarsatx.com/auth/connect/token" \
-H "Content-Type: application/json" \
-d '{"grant_type":"password"}'
Expect 415 Unsupported Media Type. Use application/x-www-form-urlencoded instead.
Gateway: IsSuccess wrapper
Create and list operations often return HTTP 200 with a business wrapper:
{
"IsSuccess": false,
"Message": "Request could not be completed. Check service inputs and organization eligibility.",
"ReturnedValue": null
}
List responses may also include TotalCount.
Always evaluate IsSuccess and Message, not only the HTTP status.
| Pattern | Applies to |
|---|---|
{ IsSuccess, Message, ReturnedValue: { OrderData, HasSubscription, PaymentURL } } | Create |
{ IsSuccess, Message, ReturnedValue: [...], TotalCount } | List (GetOrders) |
OrderModel directly | Details (GetOrderDetails) |
| Raw arrays | Lookups (GetImageTypesList, GetImageResolutions) |
Unauthorized Gateway call
curl -X GET "https://earthlife.sarsatx.com/gateway/order/Lookup/GetImageTypesList" \
-H "Accept: application/json"
Expected: HTTP 401 Unauthorized. Obtain or refresh a token, then retry with Authorization: Bearer {access_token}.
Recommended client handling
- On Auth
4xx, surfaceerror/error_descriptionto operators; do not spin retries oninvalid_grant. - On Gateway
401, refresh once; if refresh fails, re-authenticate with password grant. - On
IsSuccess: false, logMessageand fail the user-facing operation. - On
5xx, retry with exponential backoff and jitter.
Next steps
- Fix auth issues: Authentication
- Process overview: Getting started
- Contact: Support