Backend API

Swell uses standard HTTP status codes to indicate the success or failure of an API request. A code in the range of 2xx indicates success, a code in the range of 4xx indicates there was a problem with the arguments provided (e.g., a required field was missing), and a code in the range of 5xx indicates an error occurred with Swell's servers.

A validation error object is returned when a request could not be fulfilled due to one or more invalid values.

Fields

code

string

A distinct code indicating the cause of the error.

message

string

A human-readable description of the error.

params

object

Object containing parameter values related to the error.

Response
{
  "errors": {
    "name": {
      "code": "REQUIRED",
      "message": "Required"
    },
    "email": {
      "code": "FORMAT_EMAIL",
      "message": "Must be a valid email address"
    }
  }
}

Swell API libraries return a validation error object in case of an invalid PUT, POST, or DELETE request, and throw in any other error case.