DocsErrors

Failure handling

Errors

The response envelope, HTTP statuses, and the error codes worth branching on.

The failure surface#

ServerError (.errorCode, .message) and ParseError.

python
from AnalyticsClient import ServerError, ParseError

try:
    workspace = ac.get_workspace_instance(ORG_ID, WORKSPACE_ID)
    print(workspace.get_views())
except ServerError as err:
    # err.errorCode is the stable value to branch on.
    if err.errorCode == 8535:
        pass        # token invalid or under-scoped
    elif err.errorCode == 7301:
        pass        # caller lacks permission
    elif err.errorCode == 7103:
        pass        # workspace does not exist
    print(err.errorCode, err.message)
except ParseError as err:
    print("Malformed response:", err)

The response envelope#

The API has exactly three response shapes.

ShapeHTTPBody
Success with data200{"status":"success","summary":"...","data":{...}}
Success, nothing to return204Empty.
Failure4xx, 5xx{"status":"failure","summary":"<CONSTANT>","data":{"errorCode":<int>,"errorMessage":"..."}}

Synchronous export endpoints are the exception: on success they return the file itself with a matching Content-Type, and only use the JSON envelope on failure.

A failure response#

json
{
  "status": "failure",
  "summary": "SECURITY_NOT_PERMITTED",
  "data": {
    "errorCode": 7301,
    "errorMessage": "You (user@zylker.com) do not have the permission to do this operation."
  }
}

Branch on errorCode. summary is a stable constant you can log, and errorMessage is localised prose — log it, do not parse it.

HTTP status codes#

StatusMeaningRetry?
200Success with a payload.—
204Success, nothing to return.—
400The request is wrong: bad config, validation failure, business-rule violation, limit exceeded.No. Fix the request.
401Authentication failed — token missing, expired, revoked, under-scoped or from the wrong region.Only after refreshing.
403Authenticated but not allowed: missing role or permission, or a feature not on your plan.No.
404The organization, workspace or view in the path does not exist.No. Fix the identifier.
409Needs explicit confirmation, or conflicts with current state.Yes, after acknowledging.
500Unexpected server-side failure.Yes, after a short delay.

Codes worth branching on#

CodeConstantMeaningWhat to do
8535INVALID_OAUTHTOKENToken missing, expired, revoked, under-scoped, or issued in another region.Check scopes and region. See Authentication.
8083ORGID_NOT_PRESENT_IN_THE_HEADEROrganization id missing.The SDK sets this; it usually means the instance was built without an org id.
7301SECURITY_NOT_PERMITTEDAuthenticated user lacks the role or permission.Change the caller or grant permission. Not retryable.
7103—Workspace does not exist, or is not visible to this user.Check the workspace id and the user's access.
7104—View does not exist, or is not visible to this user.Check the view id.
8241—Operation would touch system-tagged data.Resend with validateSystemTags: false once you have confirmed.
8132—Too many concurrent export jobs (limit is 5 per organization).Wait for a running job to finish.
8133—Resource is restricted for synchronous export: over one million rows, from a live connect workspace, or a dashboard or query table.Use the asynchronous job flow.
18072—A refetch is already running for this table.Wait; do not retry in a loop.
7429—A copy is already running for this workspace.Wait for it to finish.
7005—Unexpected server error.Retry after a short delay; escalate if persistent.

A retry policy that works#

  • Retry 500s and the concurrency guards above, with exponential backoff.
  • Retry once after a 401, having refreshed the token — but if you are constructing one client and reusing it, the SDK has already done this.
  • Never retry 400 (other than the guards), 403 or 404. The request or the caller is wrong; repeating it just burns API units.
  • Back off for the full lockout when throttled. See Limits.
  • Limits — throttles, quotas and concurrency guards.
  • Authentication — the token throttle, which reports through Zoho Accounts rather than this envelope.
Zoho Analytics Python SDK · REST API v2 Generated 2026-10-27