Skip to content

API Errors

Reference guide for error responses in the Attune API.


Overview

The Attune API uses a consistent error response format across most endpoints. This document explains the error structure and common error codes you may encounter.


Error Response Structure

API errors follow the next JSON structure:

json
{
  "message": "You do not have access to this namespace.",
  "errorCode": "namespace/unauthorized",
  "extraProps": { ... }
}
FieldTypeDescription
message OR errorstringHuman-readable error message
errorCodestringOptional specific error code from the categories below
extraPropsobjectOptional additional context (varies by error)

Error Categories

Quiz Errors

Error CodeDescription
quiz/not_startedQuiz has not started yet; action requires started quiz.
quiz/startedQuiz is already started; action requires not started.
quiz/endedQuiz has ended; action requires active quiz.
quiz/not_anonymousQuiz is not anonymous; action requires anonymous quiz.
quiz/anonymousQuiz is anonymous; action requires non-anonymous quiz.
quiz/not_foundQuiz with given ID does not exist.
quiz/not_inappQuiz is not in-app; action requires in-app quiz.
quiz/inappQuiz is in-app; action requires not in-app quiz.
quiz/updating_errorError occurred while updating quiz data.

Namespace Errors

Error CodeDescription
namespace/not_foundNamespace with given ID does not exist.
namespace/unauthorizedUser is not authorized for this namespace.

General Errors

Error CodeDescription
parameters/not_foundRequired parameters are missing.
parameters/invalidParameters provided are invalid.
request/not_foundRequested resource using provided parameter could not be found with input parameter.

User Errors

Error CodeDescription
users/not_foundUser with given ID/email does not exist.
users/unauthorizedUser is not authorized for this action.

CSV Errors

Error CodeDescription
csv/invalid_headerCSV file has invalid or missing header.

Common HTTP Status Codes

Status CodeDescriptionCommon Causes
400Bad RequestMissing or invalid parameters, malformed request
401UnauthorizedAuthentication required or failed
403ForbiddenUser lacks permission for the action
404Not FoundResource does not exist
500Internal Server ErrorUnexpected server error

Common Error Scenarios

  • Missing API key (x-api-key header not provided)
  • Missing authentication token (x-token header not provided)
  • Missing tenant identifier (x-tennant-id header not provided)
  • Invalid or expired token
  • Email not verified
  • User not found or unauthorized
  • Namespace not found or unauthorized
  • Quiz not found, not started, ended, or wrong type for action
  • Invalid parameters (IDs, query params, body fields)
  • CSV upload with invalid header
  • Forbidden actions (not admin, not namespace admin, not invited user, etc.)

Notes

  • Some errors include additional context in the extraProps field
  • Always check for error responses in your API integration