Logo

Docs

Error Response

How to return and parse errors.

Errors use the same response shape across the API.

interface ErrorResponse {
  error: {
    status: number;
    message: string;
    details?: ErrorDetail[];
    requestId?: string;
  };
}

interface ErrorDetail {
  message: string;
  param?: string;
  value?: unknown;
}

Fields:

FieldDescription
statusHTTP status code.
messageShort description of what went wrong.
detailsOptional list of specific request issues.
requestIdOptional id used for logs and support. If shown to users, make it easy to copy.

Error Details

Use error details when one response needs to point out multiple request issues. Use one detail per invalid item.

  • message: Short description of the issue
  • param: The affected query parameter, for example fields[song]
  • value: The invalid value

On this page