Error management

Shlink's REST API implements the Problem Details standard for error management.

Because of this, all error responses will have Content-Type: application/problem+json, and the payload will have at least the next properties:

  • type: A unique error code identifying the error.
  • detail: A human-friendly description of the error.
  • title: A short unique error title.
  • status: The same value returned as the responses status code.
{
  "type": "TAG_NOT_FOUND",
  "detail": "Tag with name \"foo\" could not be found",
  "title": "Tag not found",
  "status": 404
}

Some errors can have extra properties, depending on their nature.

{
  "type": "INVALID_SLUG",
  "detail": "Provided slug \"custom\" is already in use",
  "title": "Invalid custom slug",
  "status": 400,
  "customSlug": "custom"
}

Error interpretation depends on the context and the endpoint. Every endpoint includes the documentation for its specific errors.

For more information, read the API specification.