Skip to main content

Errors

Interpret Auth OAuth failures and Gateway HTTP / business-wrapper errors consistently in your client.

HTTP status codes

StatusTypical meaningWhere
400Malformed token request or invalid parametersAuth /connect/token; some Gateway validation
401Missing, expired, or invalid Bearer token; bad credentials or refresh tokenAuth and Gateway
403Authenticated but not allowed for the resource or actionGateway
404Unknown path or resourceGateway
415Unsupported media type (token calls must use form URL-encoded)Auth
5xxUnexpected server or upstream failureAuth 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"
}
errorCommon causes
invalid_grantWrong password, invalid/expired refresh token, or grant rejected
access_deniedUser/org inactive, incomplete org profile, or policy denial
invalid_clientWrong client_id
unsupported_grant_typegrant_type not password or refresh_token
invalid_requestMissing 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.

PatternApplies to
{ IsSuccess, Message, ReturnedValue: { OrderData, HasSubscription, PaymentURL } }Create
{ IsSuccess, Message, ReturnedValue: [...], TotalCount }List (GetOrders)
OrderModel directlyDetails (GetOrderDetails)
Raw arraysLookups (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}.

  1. On Auth 4xx, surface error / error_description to operators; do not spin retries on invalid_grant.
  2. On Gateway 401, refresh once; if refresh fails, re-authenticate with password grant.
  3. On IsSuccess: false, log Message and fail the user-facing operation.
  4. On 5xx, retry with exponential backoff and jitter.

Next steps