Overview

Example

In the Quickstart, you saw a first example of an error message.

This is what you could see in your Terminal:

{"error":"request_error","subCode":4,"message":"Invalid request body","detail":[{"code":"invalid_type","expected":"array","received":"undefined","path":["select"],"message":"Required"}]}

Or in JSON format:

{
    "error": "request_error",
    "subCode": 4,
    "message": "Invalid request body",
    "detail": [
        {
            "code": "invalid_type",
            "expected": "array",
            "received": "undefined",
            "path": [
                "select"
            ],
            "message": "Required"
        }
    ]
}

Error object

The error object in Morph API:

PropertyDescriptionExample
"error"The kind of error"request_error"
"subCode"number which categorizes further the error.4
"message"Short text that describes the error."Invalid request body"
"detail"An array of object giving additional information to help with debugging.See example below.

Success codes

HTTP status codeDescription
200Your request to Morph API was successful.

Error codes

RequestError

HTTP status code"error""subCode"definition
400request_error1Required parameter not specified: %s
400request_error2Invalid format: %s (%s)
(Please validate on the client side)
400request_error3Invalid ID format: %s
400request_error4Invalid RequestBody: %s
400request_error5Required header params is not found: %s

AuthError

HTTP status code"error""subCode"definition
401auth_error1Token is expired.
401auth_error2User associated with the token could not be found.
401auth_error3User have not signed up yet.
401auth_error4API Key is invalid.

DatabaseError

HTTP status code"error""subCode"definition
200database_error1Database does not exist.
200database_error2Database has already exist.
200database_error3The specified databaseSlug is already in use.

TableError

HTTP status code"error""subCode"definition
200table_error1Table does not exist.
200table_error2Table has already exist.
200table_error3You have no permission
200table_error4This table is read only table. cannot edit
200table_error5This table is not deletable. some referenced tables exist.
200table_error6Join is not allowed with the column

FieldError

HTTP status code"error""subCode"definition
200field_error1Field does not exist.
200field_error2Field has already exist.
200field_error3Relation is not allowed with the column
200field_error4Delete is not allowed with the column