The Silktide API handles all errors in a consistent way.

All errors return an appropriate HTTP code of 4xx (for errors in your request) or 5xx (for errors within Silktide, such as an unavailable service). By contrast, successful responses always return a HTTP code of 2xx.

The response payload contains an error object, such as:

{
  "error": {
    "type": "ModelNotFound",
    "message": "Website not found",
    "properties": {
      "model": "Website"
    }
  } 
}

type - string

A error code representing the type of error. For example, ModelNotFound indicates a requested model was not found. You can use these to reliably detect a specific error.


message - string

A descriptive error message suitable for end users. This can change dynamically or due to locale, and should not be used to detect a specific error, see type instead.


properties - object

An optional object of properties relating to the type of error. For example, for a ModelNotFound error, this contains a model property indicating what type of model was not found.