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

1
{
2
"error_type": "api_user_error",
3
"error_message": "User Not Found"
4
}
Copied!

Create User

101
002
1
{
2
"error_type": "api_invalid_error",
3
"error_message": "The given data was invalid.",
4
"errors": {
5
"email": [
6
"The email has already been taken."
7
]
8
}
9
}
Copied!
1
{
2
"error_code": "api_template_error",
3
"error_message": "Invalid templateId provided."
4
}
Copied!

Update User

004
003
1
{
2
"error_type": "api_user_error",
3
"error_message": "User Not Found"
4
}
Copied!
1
{
2
"error_code": "api_invalid_error",
3
"error_message": "Invalid or No Data Provided for Update"
4
}
Copied!

Delete User

1
{
2
"error_type": "api_user_error",
3
"error_message": "User Not Found"
4
}
Copied!
1
{
2
"error_type": "api_user_error",
3
"error_message": "User Not Found"
4
}
Copied!

Generate Token

1
{
2
"error_type": "api_user_error",
3
"error_message": "User Not Found"
4
}
Copied!

Delete Token

1
{
2
"error_type": "api_user_error",
3
"error_message": "User Not Found"
4
}
Copied!
Last modified 10mo ago