Error Codes

Errors use standard HTTP status codes and a consistent JSON envelope:

{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Payload does not match the kpi widget schema",
    "details": ["`value` must be a number"]
  }
}

code is a stable UPPERCASE string. message is human-readable. details is optional — present only when there's per-field context to give (chiefly validation).

Codes

StatusCodeMeaning
400BAD_REQUESTBody isn't valid JSON, isn't an object, or as_of isn't a valid timestamp
401UNAUTHORIZEDMissing, invalid, or expired API credentials
403FORBIDDENThe key lacks the required model:action permission
404NOT_FOUNDThe widget doesn't exist in your org
422VALIDATION_ERRORdata failed the widget type's schema — see details
503—The auth service is unreachable; retry

Validation errors

A 422 lists every schema problem in details, so you can fix the whole payload in one pass:

{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Payload does not match the line widget schema",
    "details": [
      "series[0].name must be a string",
      "series[0].points[1].y must be a number"
    ]
  }
}

See Widget Types for each type's schema.