Skip to content

Response

The Transpose SQL API has two types of response types: one for successes and one for errors. A success response will be returned on any request that completes successfully (even if no results are returned) along with a HTTP 200 status code. An error response will be returned on any request that fails, whether due to the client (i.e. you) or the server (i.e. us), along with a HTTP 4xx or 5xx status code. If you are out of credits, you will receive a 403 status code.

Success Response

The success response will always obey the following top-level JSON structure:

Name Type Description
status string The status of the response. Will be success for a success response.
stats object The stats of the executed query (specifically the count, size in megabytes, and time in milliseconds).
results list A list of objects containing the results of the request.

Here is an example of an actual success response following this structure:

{
    "status": "success",
    "stats": {
        "count": 1,
        "size": 196,
        "time": 0
    },
    "results": [
        {
            "address": "0xa330BF3A28a5C7BB36Da83837f450e89e456eaF1",
            "type": "wallet",
            "last_active_timestamp": "2022-10-01T17:26:11Z",
            "created_timestamp": "2022-10-01T17:26:11Z",
            "creator_address": null
        }
    ]
}

Error Response

The error response will always obey the following top-level JSON structure:

Name Type Description
status string The status of the response. Will be error for an error response.
message string A more descriptive error message explaining where the request failed.

Here is an example of an actual error response following this structure:

{
    "status": "error",
    "message": "Execution error: Table 'error_test' does not exist"
}

Got questions? Join our Discord

Discord is the primary home of the Transpose developer community. Join us to ask questions, share your work, and get help.