Skip to main content

Stream API Errors

This page documents the error response format and the standardized error codes returned by Stream API endpoints. The goal is to provide a stable, predictable contract for client applications and integrators.

Error response envelope

All handled errors return a response body using the StreamBaseResponse envelope:

{
"error": {
"code": "STREAM_ERROR",
"message": "Something wrong happened, please contact support.",
"additional_info": "Optional human-readable details"
}
}
  • code: A stable error code from StreamErrorCodes.
  • message: A user‑facing message associated with the code.
  • additional_info: Optional, best‑effort details to aid debugging.

Common error classes and HTTP status codes

The following exception classes map to consistent HTTP status codes:

Exception classHTTP status
BadRequestError400
UnauthorizedError401
ForbiddenError403
PermissionForbiddenError403
NotFoundError404
GoneError410
UnprocessableEntityError422
DuplicateValueError422

Stream error codes

The following codes are used across all Stream API endpoints:

CodeMessage
STREAM_ERRORSomething wrong happened, please contact support.
STREAM_UNKNOWN_ERRORUnknown exception happened; this exception will be handled as soon as possible.
PHONE_ALREADY_REGISTEREDPhone is already registered.
INVALID_PARAMETERSRequest input is not valid.
INVOICE_FINALISEDInvoice is finalised and cannot undergo this action.
PAYMENT_REFUNDED_ALREADYDuplicate action; payment has already been refunded.
PAYMENT_REFUNDED_FAILEDCould not refund payment; processor failed.
DUPLICATE_CONSUMERConsumer already exists.
DUPLICATE_PAYMENTA payment with the given information already exists.
PERMISSION_FORBIDDENPermission forbidden.
PRODUCT_USED_IN_FINALIZED_INVOICEProduct cannot be updated; it is used by a finalized invoice.
COUPON_USED_IN_FINALIZED_INVOICECoupon cannot be updated; it is used by a finalized invoice.