Errors

This page describes various error responses with our API.

Trust Swiftly uses conventional HTTP response codes to indicate the success or failure of an API request. In general: Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, a user doesn't exist, etc.). Codes in the 5xx range indicate an error with Trust Swiftly's servers (these are rare).

HTTP Status Codes

HTTP Status Code

Status Message

Description

200

OK

Everything worked as expected.

201

Created

Resource was created successfully.

400

Bad Request

The request was unacceptable, often due to missing a required parameter.

401

Unauthorized

No valid API key provided.

403

Forbidden

Accessing the resource is forbidden for this user.

404

Not Found

The requested resource doesn't exist.

422

Unprocessable Entity

Required fields are missing or cannot be processed.

500, 502, 503, 504

Server Errors

Something went wrong on Trust Swiftly's end.

Error Types

Error Type

Description

api_auth_error

API Key Wrong or Unauthorized User

api_validation_error

Validation Failed

api_template_error

Invalid templateId provided

api_invalid_error

Invalid or No Data Provided for Update

api_user_error

User Not Found

api_resource_error

Resource Not Found

api_internal_error

Internal Error

Get Users

{
  "error_type": "api_user_error",
  "error_message": "User Not Found"
}

Create User

{
  "error_type": "api_invalid_error",
  "error_message": "The given data was invalid.",
  "errors": {
    "email": [
      "The email has already been taken."
    ]
  }
}

Update User

{
    "error_type": "api_user_error",
    "error_message": "User Not Found"
}

Delete User

{
  "error_type": "api_user_error",
  "error_message": "User Not Found"
}
{
  "error_type": "api_user_error",
  "error_message": "User Not Found"
}

Generate Token

{
  "error_type": "api_user_error",
  "error_message": "User Not Found"
}

Delete Token

{
  "error_type": "api_user_error",
  "error_message": "User Not Found"
}

Last updated