JSON API Documentation

CAUTION - THIS API IS NOT STABLE

It is not officially supported yet and might change without notice at any time. USE AT YOUR OWN RISK!


Table of Contents


GET /api/dbs

Response

application/json;charset=utf-8, application/json

Example Response Body

{
  "databases": [
    {
      "auditing": false,
      "createdUtc": "2023-02-15T10:22:06.487Z",
      "description": "This is a description of the database.",
      "environment": "Staging",
      "fileFormat": "sqlite",
      "fileName": "database.sqlite",
      "id": "01gd0anjtp0mex97a23s8s63j9",
      "lastModifiedUtc": "2023-03-11T14:56:17.198Z",
      "location": {
        "lat": 50,
        "long": 40,
        "name": "City X"
      },
      "owner": "johns-team",
      "readonlyId": "mfbqyg17y98vq",
      "schemaLocked": false,
      "schemaVersion": 0,
      "size": 123,
      "tables": [],
      "userVersion": 0,
      "viewsTab": false,
      "visibility": "public"
    }
  ],
  "numberOfDatabases": 1
}

POST /api/dbs

Request

application/json;charset=utf-8, application/json

Example Request Body

{
  "fileFormat": "csv",
  "name": "Example Database",
  "query": "CREATE TABLE users (name TEXT, email TEXT)",
  "team": "example-team"
}

Response

application/json;charset=utf-8, application/json

Example Response Body

{
  "id": "example-database-wqaldslkjfvlbdxqwehfhj",
  "ownerName": "some-user",
  "ownershipUtc": "2023-03-11T14:56:17.198Z"
}

DELETE /api/dbs/:dbId

:dbId - ID of the database to be served

Response

application/json;charset=utf-8, application/json

Example Response Body

{}

GET /api/dbs/:dbId

:dbId - ID of the database to be served

Response

application/json;charset=utf-8, application/json

Example Response Body

{
  "auditing": false,
  "createdUtc": "2023-02-15T10:22:06.487Z",
  "description": "This is a description of the database.",
  "environment": "Staging",
  "fileFormat": "sqlite",
  "fileName": "database.sqlite",
  "id": "01gd0anjtp0mex97a23s8s63j9",
  "lastModifiedUtc": "2023-03-11T14:56:17.198Z",
  "location": {
    "lat": 50,
    "long": 40,
    "name": "City X"
  },
  "owner": "johns-team",
  "readonlyId": "mfbqyg17y98vq",
  "schemaLocked": false,
  "schemaVersion": 0,
  "size": 123,
  "tables": [],
  "userVersion": 0,
  "viewsTab": false,
  "visibility": "public"
}

PATCH /api/dbs/:dbId

:dbId - ID of the database to be served

Request

application/json;charset=utf-8, application/json

Example Request Body

{
  "description": "New Database Description",
  "name": "New Database Name",
  "owner": {
    "contents": "johns-team",
    "tag": "TextValue"
  }
}

Response

application/json;charset=utf-8, application/json

Example Response Body

{}

GET /api/dbs/:dbId/apps

:dbId - ID of the database to be served

Response

application/json;charset=utf-8, application/json

Example Response Body

{
  "apps": []
}

GET /api/dbs/:dbId/azimutt-schema

:dbId - ID of the database to be served

Response

application/json;charset=utf-8, application/json

Example Response Body

{
  "relations": [],
  "tables": [
    {
      "checks": [
        {
          "columns": [
            "id"
          ],
          "name": "id_check",
          "predicate": "id IS 0"
        }
      ],
      "columns": [
        {
          "columns": [],
          "comment": null,
          "default": null,
          "name": "id",
          "nullable": false,
          "type": "TEXT"
        }
      ],
      "comment": "table storing todos",
      "primaryKey": {
        "columns": [
          "id"
        ],
        "name": "id"
      },
      "schema": "public",
      "table": "todos",
      "uniques": [
        {
          "columns": [
            "id"
          ],
          "definition": "(id)",
          "name": "id_unique"
        }
      ],
      "view": false
    }
  ]
}

POST /api/dbs/:dbId/charts

:dbId - ID of the database to be served

Request

application/json;charset=utf-8, application/json

Example Request Body

{
  "chartType": "BarChart",
  "headers": [],
  "hideNullValues": false,
  "labelRotation": 30,
  "table": "users",
  "title": "Example Chart"
}

Response

application/json;charset=utf-8, application/json

Example Response Body

{
  "chartType": "BarChart",
  "headers": [],
  "hideNullValues": false,
  "labelRotation": 30,
  "table": "users",
  "title": "Example Chart",
  "ulid": "01gdbtepbmpt3jk8y94yc05snr"
}

DELETE /api/dbs/:dbId/charts/:chartId

:dbId - ID of the database to be served

:chartId - ID of the chart

Response

application/json;charset=utf-8, application/json

Example Response Body

{}

PATCH /api/dbs/:dbId/charts/:chartId

:dbId - ID of the database to be served

:chartId - ID of the chart

Request

application/json;charset=utf-8, application/json

Example Request Body

{
  "chartType": "BarChart",
  "headers": [],
  "hideNullValues": false,
  "labelRotation": 30,
  "table": "users",
  "title": "Example Chart"
}

Response

application/json;charset=utf-8, application/json

Example Response Body

{}

GET /api/dbs/:dbId/dashboards

:dbId - ID of the database to be served

Response

application/json;charset=utf-8, application/json

Example Response Body

{
  "dashboards": []
}

POST /api/dbs/:dbId/dashboards

:dbId - ID of the database to be served

Request

application/json;charset=utf-8, application/json

Example Request Body

{
  "charts": [],
  "title": "Example Dashboard"
}

Response

application/json;charset=utf-8, application/json

Example Response Body

{
  "charts": [],
  "title": "Example Dashboard",
  "ulid": "01gd08ghjpx1vzzwdrp3pfcjh1"
}

DELETE /api/dbs/:dbId/dashboards/:dashboardId

:dbId - ID of the database to be served

:dashboardId - ID of the dashboard to be served

Response

application/json;charset=utf-8, application/json

Example Response Body

{}

PATCH /api/dbs/:dbId/dashboards/:dashboardId

:dbId - ID of the database to be served

:dashboardId - ID of the dashboard to be served

Request

application/json;charset=utf-8, application/json

Example Request Body

{
  "charts": [],
  "title": "Example Dashboard"
}

Response

application/json;charset=utf-8, application/json

Example Response Body

{}

GET /api/dbs/:dbId/env

:dbId - ID of the database to be served

Response

application/json;charset=utf-8, application/json

Example Response Body

{
  "envVars": [
    {
      "created_utc": "2022-01-01T00:00:00Z",
      "name": "ENVIRONMENT",
      "value": "production"
    }
  ]
}

POST /api/dbs/:dbId/env

:dbId - ID of the database to be served

Request

application/json;charset=utf-8, application/json

Example Request Body

{
  "name": "ENVIRONMENT",
  "value": "development"
}

Response

application/json;charset=utf-8, application/json

Example Response Body

{
  "created_utc": "2022-01-01T00:00:00Z",
  "name": "ENVIRONMENT",
  "value": "production"
}

DELETE /api/dbs/:dbId/env/:varName

:dbId - ID of the database to be served

:varName - Name of the environment variable to modify

Response

application/json;charset=utf-8, application/json

Example Response Body

{}

PATCH /api/dbs/:dbId/env/:varName

:dbId - ID of the database to be served

:varName - Name of the environment variable to modify

Request

application/json;charset=utf-8, application/json

Example Request Body

{
  "name": "ENVIRONMENT",
  "value": "development"
}

Response

application/json;charset=utf-8, application/json

Example Response Body

{}

GET /api/dbs/:dbId/functions

:dbId - ID of the database to be served

Response

application/json;charset=utf-8, application/json

Example Response Body

{
  "functions": []
}

POST /api/dbs/:dbId/functions

:dbId - ID of the database to be served

Request

application/json;charset=utf-8, application/json

Example Request Body

{
  "content": "export default function() { \n  console.info(\"Hello World!\") \n}",
  "description": "This is an awesome function",
  "name": "Awesome Function",
  "runtime": "deno"
}

Response

application/json;charset=utf-8, application/json

Example Response Body

{
  "content": null,
  "description": null,
  "diagnostics": null,
  "id": "01grkhvbtwgmchjfbxnqg6gxxg",
  "name": "Awesome Function",
  "runtime": "deno",
  "versions": [
    "01grkhvhzm0vszqbrcvhb0bwad"
  ]
}

DELETE /api/dbs/:dbId/functions/:funcId

:dbId - ID of the database to be served

:funcId - ID of the function

Response

application/json;charset=utf-8, application/json

Example Response Body

{}

GET /api/dbs/:dbId/functions/:funcId

:dbId - ID of the database to be served

:funcId - ID of the function

Response

application/json;charset=utf-8, application/json

Example Response Body

{
  "content": null,
  "description": null,
  "diagnostics": null,
  "id": "01grkhvbtwgmchjfbxnqg6gxxg",
  "name": "Awesome Function",
  "runtime": "deno",
  "versions": [
    "01grkhvhzm0vszqbrcvhb0bwad"
  ]
}

PATCH /api/dbs/:dbId/functions/:funcId

:dbId - ID of the database to be served

:funcId - ID of the function

Request

application/json;charset=utf-8, application/json

Example Request Body

{
  "content": "export default function() { \n  console.info(\"Hello World!\") \n}",
  "description": "This is an awesome function",
  "name": "Awesome Function",
  "runtime": "deno"
}

Response

application/json;charset=utf-8, application/json

Example Response Body

{
  "diagnostics": [],
  "id": "01hh1wcq83r49v3t3wss8z9t7k"
}

GET /api/dbs/:dbId/functions/:funcId/invocations

:dbId - ID of the database to be served

:funcId - ID of the function

Response

application/json;charset=utf-8, application/json

Example Response Body

{
  "invocations": [
    {
      "createdUtc": "2023-02-15T10:22:06.487Z",
      "data": "null",
      "logs": [
        {
          "message": "Hello world ^-^",
          "stream": "stdout",
          "utc": "2023-02-15T10:22:06.487Z"
        }
      ],
      "runtimeMs": 3.2
    }
  ]
}

POST /api/dbs/:dbId/functions/:funcId/republish

:dbId - ID of the database to be served

:funcId - ID of the function

Request

application/json;charset=utf-8, application/json

Example Request Body

{
  "runtime": "deno",
  "version": "my-old-but-awesome-function-version-id"
}

Response

application/json;charset=utf-8, application/json

Example Response Body

{
  "diagnostics": [],
  "id": "01hh1wcq83r49v3t3wss8z9t7k"
}

GET /api/dbs/:dbId/functions/:funcId/versions/:versionId

:dbId - ID of the database to be served

:funcId - ID of the function

:versionId - ID of the function version

Response

application/json;charset=utf-8, application/json

Example Response Body

{
  "content": null,
  "description": null,
  "diagnostics": null,
  "id": "01grkhvbtwgmchjfbxnqg6gxxg",
  "name": "Awesome Function",
  "runtime": "deno",
  "versions": [
    "01grkhvhzm0vszqbrcvhb0bwad"
  ]
}

POST /api/dbs/:dbId/prompt

:dbId - ID of the database to be served

Request

application/json;charset=utf-8, application/json

Example Request Body

{
  "funcId": "01hg5j9esf8xvwvrjej58feybn",
  "prompt": "Insert a new user",
  "tableName": null
}

Response

application/json;charset=utf-8, application/json

Example Response Body

{}

POST /api/dbs/:dbId/prompt/describe-database

:dbId - ID of the database to be served

Request

application/json;charset=utf-8, application/json

Example Request Body

{
  "funcId": "01hg5j9esf8xvwvrjej58feybn",
  "prompt": "Insert a new user",
  "tableName": null
}

Response

application/json;charset=utf-8, application/json

Example Response Body

{}

POST /api/dbs/:dbId/prompt/describe-function

:dbId - ID of the database to be served

Request

application/json;charset=utf-8, application/json

Example Request Body

{
  "funcId": "01hg5j9esf8xvwvrjej58feybn",
  "prompt": "Insert a new user",
  "tableName": null
}

Response

application/json;charset=utf-8, application/json

Example Response Body

{}

POST /api/dbs/:dbId/prompt/describe-table

:dbId - ID of the database to be served

Request

application/json;charset=utf-8, application/json

Example Request Body

{
  "funcId": "01hg5j9esf8xvwvrjej58feybn",
  "prompt": "Insert a new user",
  "tableName": null
}

Response

application/json;charset=utf-8, application/json

Example Response Body

{}

GET /api/dbs/:dbId/schema

:dbId - ID of the database to be served

Response

text/plain;charset=utf-8

Example Response Body

text/plain;charset=utf-8

GET /api/dbs/:dbId/settings

:dbId - ID of the database to be served

Response

application/json;charset=utf-8, application/json

Example Response Body

{}

PATCH /api/dbs/:dbId/settings

:dbId - ID of the database to be served

Request

application/json;charset=utf-8, application/json

Example Request Body

{
  "auditing": true,
  "envVars": [
    {
      "name": "HELLO",
      "value": "world"
    }
  ],
  "environment": {
    "contents": "production",
    "tag": "TextValue"
  },
  "schemaLocked": false,
  "viewsTab": true,
  "visibility": "public"
}

Response

application/json;charset=utf-8, application/json

Example Response Body

{}

GET /api/dbs/:dbId/tables/:id

:dbId - ID of the database to be served

:id - ID of the object

Response

application/json;charset=utf-8, application/json

Example Response Body

{
  "columns": [],
  "description": null,
  "maxCellLimitReached": false,
  "name": "Example Table",
  "numberOfRows": 0,
  "rowidColumnName": "rowid",
  "tableType": "Table"
}

PATCH /api/dbs/:dbId/tables/:id

:dbId - ID of the database to be served

:id - ID of the object

Request

application/json;charset=utf-8, application/json

Example Request Body

{
  "after": "existing_table",
  "description": "New Table Description",
  "name": "New Table Name"
}

Response

application/json;charset=utf-8, application/json

Example Response Body

{}

PUT /api/dbs/:dbId/tables/:id

:dbId - ID of the database to be served

:id - ID of the object

Request

application/json;charset=utf-8, application/json

Example Request Body

{}

Response

application/json;charset=utf-8, application/json

Example Response Body

{
  "columns": [],
  "description": null,
  "maxCellLimitReached": false,
  "name": "Example Table",
  "numberOfRows": 0,
  "rowidColumnName": "rowid",
  "tableType": "Table"
}

DELETE /api/dbs/:dbId/tables/:id/columns/:id

:dbId - ID of the database to be served

:id - ID of the object

:id - ID of the object

Response

application/json;charset=utf-8, application/json

Example Response Body

{}

PATCH /api/dbs/:dbId/tables/:id/columns/:id

:dbId - ID of the database to be served

:id - ID of the object

:id - ID of the object

Request

application/json;charset=utf-8, application/json

Example Request Body

{}

Response

application/json;charset=utf-8, application/json

Example Response Body

{}

PUT /api/dbs/:dbId/tables/:id/columns/:id

:dbId - ID of the database to be served

:id - ID of the object

:id - ID of the object

Request

application/json;charset=utf-8, application/json

Example Request Body

{}

Response

application/json;charset=utf-8, application/json

Example Response Body

{
  "gqlDataType": null,
  "inputElement": "InputText",
  "isGenerated": false,
  "isNonNull": false,
  "isOmittable": false,
  "isPrimaryKey": false,
  "isUnique": false,
  "items": null,
  "name": "",
  "sqliteDataType": "TEXT",
  "validations": null
}

GET /api/dbs/:dbId/tables/:id/export

:dbId - ID of the database to be served

:id - ID of the object

Response

application/json;charset=utf-8, application/json

Example Response Body

""

GET /api/dbs/:dbId/tables/:id/search/:searchTerm

:dbId - ID of the database to be served

:id - ID of the object

:searchTerm - Value to fuzzy find inside table

Response

application/json;charset=utf-8, application/json

Example Response Body

{
  "columns": [],
  "description": null,
  "maxCellLimitReached": false,
  "name": "Example Table",
  "numberOfRows": 0,
  "rowidColumnName": "rowid",
  "tableType": "Table"
}

DELETE /api/dbs/:dbId/tables/:tableId

:dbId - ID of the database to be served

:tableId - Name of table

Request

application/json;charset=utf-8, application/json

Example Request Body

{}

Response

application/json;charset=utf-8, application/json

Example Response Body

{}

GET /api/dbs/:dbId/tables/:tableId/columns/:columnName/files/:primaryKey/:equalsValue

:dbId - ID of the database to be served

:tableId - Name of table

:columnName - Name of column

:primaryKey - Name of primary key column

:equalsValue - Value to compare primary key to

Response

Example Response Body

PUT /api/dbs/:dbId/tables/:tableId/columns/:columnName/files/:primaryKey/:equalsValue

Multipart Request SamplesThis endpoint takes `multipart/form-data` requests. The following is a list of sample requests:

:dbId - ID of the database to be served

:tableId - Name of table

:columnName - Name of column

:primaryKey - Name of primary key column

:equalsValue - Value to compare primary key to

[DocNote {_noteTitle = "Multipart Request Samples", _noteBody = ["This endpoint takes `multipart/form-data` requests. The following is a list of sample requests:",""]}]

Response

application/json;charset=utf-8, application/json

Example Response Body

{}

POST /api/dbs/:dbId/vacuum

:dbId - ID of the database to be served

Response

application/json;charset=utf-8, application/json

Example Response Body

{}

GET /api/dbs/:id/charts

:id - ID of the object

Response

application/json;charset=utf-8, application/json

Example Response Body

{
  "charts": []
}

GET /api/docs

Response

text/html;charset=utf-8, text/html

Example Response Body

text/html;charset=utf-8

text/html

POST /api/events/paddle

[DocQueryParam {_paramName = "key", _paramValues = ["2Nug0JwezlPKjMu3PlwwSsLdIo76Ex1P"], _paramDesc = "Key to grant access to endpoint", _paramKind = Normal}]

Request

application/x-www-form-urlencoded

Example Request Body

application/x-www-form-urlencoded

subscription_id=7&
email=john%40example.org&
passthrough=Example%20String&
status=trialing&
checkout_id=6-d9e06ad42f600cc-bccba0a4b7&
p_signature=123abc&
custom_data=%7B%22airsequel_instance%22%3A%22corp.airsequel.net%22%2C%22airsequel_team_name%22%3A%22cool-team%22%7D&
update_url=https%3A%2F%2Fcheckout.paddle.com%2Fsubscription%2Fupdate%3Fuser%3D8%26subscription%3D5%26hash%3D236d383c6f2e68a88d79f3e598f2100ef398b701&
unit_price=unit_price&
quantity=42&
currency=EUR&
user_id=2&
marketing_consent=1&
alert_id=575684&
alert_name=subscription_created&
event_time=2023-08-06T15%3A33%3A25.859Z&
next_bill_date=2023-09-06&
source=Checkout&
subscription_plan_id=4&
linked_subscriptions=8%2C%204%2C%208&
cancel_url=https%3A%2F%2Fcheckout.paddle.com%2Fsubscription%2Fcancel%3Fuser%3D5%26subscription%3D2%26hash%3D29242ee38bc43ffd9f00ce51c4d38235faa0c989

Response

application/json;charset=utf-8, application/json

Example Response Body

{}

POST /api/login

Request

application/json;charset=utf-8, application/json

Example Request Body

{
  "password": "test123",
  "username": "john"
}

Response

application/json;charset=utf-8, application/json

Example Response Body

{
  "sessionToken": "ANnlP4ZQt2CFcaKsCuuGVc0SNNjQ4Ujm",
  "teams": [
    {
      "billing": null,
      "name": "Team 1",
      "numberOfDatabases": 1
    }
  ],
  "username": "john"
}

POST /api/logout

Request

application/json;charset=utf-8, application/json

Example Request Body

{}

Response

application/json;charset=utf-8, application/json

Example Response Body

{}

POST /api/prompt/create-database

Request

application/json;charset=utf-8, application/json

Example Request Body

{
  "funcId": "01hg5j9esf8xvwvrjej58feybn",
  "prompt": "Insert a new user",
  "tableName": null
}

Response

application/json;charset=utf-8, application/json

Example Response Body

{}

GET /api/settings

Response

application/json;charset=utf-8, application/json

Example Response Body

{}

PATCH /api/settings

Request

application/json;charset=utf-8, application/json

Example Request Body

{
  "allowedHosts": [
    "localhost",
    "example.org:1234"
  ],
  "envVars": [
    {
      "name": "HELLO",
      "value": "world"
    }
  ]
}

Response

application/json;charset=utf-8, application/json

Example Response Body

{}

GET /api/settings/env

Response

application/json;charset=utf-8, application/json

Example Response Body

{
  "envVars": [
    {
      "created_utc": "2022-01-01T00:00:00Z",
      "name": "ENVIRONMENT",
      "value": "production"
    }
  ]
}

POST /api/settings/env

Request

application/json;charset=utf-8, application/json

Example Request Body

{
  "name": "ENVIRONMENT",
  "value": "development"
}

Response

application/json;charset=utf-8, application/json

Example Response Body

{
  "created_utc": "2022-01-01T00:00:00Z",
  "name": "ENVIRONMENT",
  "value": "production"
}

DELETE /api/settings/env/:varName

:varName - Name of the environment variable to modify

Response

application/json;charset=utf-8, application/json

Example Response Body

{}

PATCH /api/settings/env/:varName

:varName - Name of the environment variable to modify

Request

application/json;charset=utf-8, application/json

Example Request Body

{
  "name": "ENVIRONMENT",
  "value": "development"
}

Response

application/json;charset=utf-8, application/json

Example Response Body

{}

GET /api/status

Response

application/json;charset=utf-8, application/json

Example Response Body

{}

DELETE /api/teams/:teamName

:teamName - Name of team

Response

application/json;charset=utf-8, application/json

Example Response Body

{}

GET /api/teams/:teamName

:teamName - Name of team

Response

application/json;charset=utf-8, application/json

Example Response Body

{
  "billing": {
    "email_address": "billing@good-corp.com",
    "plan": null,
    "subscription_id": 1
  },
  "created_utc": "2023-05-30T13:30:15.467Z",
  "databases": [
    {
      "environment": "Testing",
      "id": "01h2v1ask448h1wdaqdwvd90v9",
      "name": "App Database",
      "ownership_utc": "2023-05-30T13:32:46.788Z",
      "visibility": "private"
    }
  ],
  "name": "good-corp"
}

PATCH /api/teams/:teamName

:teamName - Name of team

Request

application/json;charset=utf-8, application/json

Example Request Body

{
  "billing_email_address": "john@example.com",
  "billing_plan": "pro",
  "billing_subscription_id": 1234567890,
  "name": "New Team Name"
}

Response

application/json;charset=utf-8, application/json

Example Response Body

{
  "billing": {
    "email_address": "billing@good-corp.com",
    "plan": null,
    "subscription_id": 1
  },
  "created_utc": "2023-05-30T13:30:15.467Z",
  "databases": [
    {
      "environment": "Testing",
      "id": "01h2v1ask448h1wdaqdwvd90v9",
      "name": "App Database",
      "ownership_utc": "2023-05-30T13:32:46.788Z",
      "visibility": "private"
    }
  ],
  "name": "good-corp"
}

GET /api/teams/:teamName/members

:teamName - Name of team

Response

application/json;charset=utf-8, application/json

Example Response Body

{}

DELETE /api/teams/:teamName/members/:username

:teamName - Name of team

:username - Username of the user

Response

application/json;charset=utf-8, application/json

Example Response Body

{}

PATCH /api/teams/:teamName/members/:username

:teamName - Name of team

:username - Username of the user

Request

application/json;charset=utf-8, application/json

Example Request Body

{
  "roles": [
    "Admin",
    "Editor"
  ]
}

Response

application/json;charset=utf-8, application/json

Example Response Body

{}

GET /api/teams/:teamName/tokens

:teamName - Name of team

Response

application/json;charset=utf-8, application/json

Example Response Body

{
  "tokens": []
}

POST /api/tokens

Request

application/json;charset=utf-8, application/json

Example Request Body

{
  "description": "Allows cool app to access GraphQL API",
  "expiration_utc": null,
  "name": "TokenPost for cool app",
  "permissions": [
    {
      "db_id": "01h3enjs4aa42a737wpmb31d0f",
      "name": "read"
    },
    {
      "db_id": "01h3enjy6vfr6na02sbs8yfqr5",
      "name": "write"
    }
  ],
  "team_name": "cool-team"
}

Response

application/json;charset=utf-8, application/json

Example Response Body

{
  "body": "ast_BKPda5Dx…",
  "created_utc": "2023-06-21T09:44:42Z",
  "description": "Allows cool app to access GraphQL API",
  "expiration_utc": null,
  "id": 1,
  "name": "Token for cool app",
  "permissions": [
    {
      "db_id": "01h3enjs4aa42a737wpmb31d0f",
      "db_name": "cool-app-database",
      "name": "read"
    },
    {
      "db_id": "01h3enjy6vfr6na02sbs8yfqr5",
      "db_name": "cool-app-database-2",
      "name": "write"
    }
  ]
}

DELETE /api/tokens/:tokenId

:tokenId - ID of the token

Response

application/json;charset=utf-8, application/json

Example Response Body

{}

GET /api/tokens/:tokenId

:tokenId - ID of the token

Response

application/json;charset=utf-8, application/json

Example Response Body

{
  "body": "ast_BKPda5Dx…",
  "created_utc": "2023-06-21T09:44:42Z",
  "description": "Allows cool app to access GraphQL API",
  "expiration_utc": null,
  "id": 1,
  "name": "Token for cool app",
  "permissions": [
    {
      "db_id": "01h3enjs4aa42a737wpmb31d0f",
      "db_name": "cool-app-database",
      "name": "read"
    },
    {
      "db_id": "01h3enjy6vfr6na02sbs8yfqr5",
      "db_name": "cool-app-database-2",
      "name": "write"
    }
  ]
}

PATCH /api/tokens/:tokenId

:tokenId - ID of the token

Request

application/json;charset=utf-8, application/json

Example Request Body

{
  "description": {
    "contents": "Allows cool app to access GraphQL API",
    "tag": "TextValue"
  },
  "expiration_utc": {
    "tag": "TextNull"
  },
  "name": "TokenPatch for cool app",
  "team_name": "cool-team"
}

Response

application/json;charset=utf-8, application/json

Example Response Body

{
  "body": "ast_BKPda5Dx…",
  "created_utc": "2023-06-21T09:44:42Z",
  "description": "Allows cool app to access GraphQL API",
  "expiration_utc": null,
  "id": 1,
  "name": "Token for cool app",
  "permissions": [
    {
      "db_id": "01h3enjs4aa42a737wpmb31d0f",
      "db_name": "cool-app-database",
      "name": "read"
    },
    {
      "db_id": "01h3enjy6vfr6na02sbs8yfqr5",
      "db_name": "cool-app-database-2",
      "name": "write"
    }
  ]
}

POST /api/users

Request

application/json;charset=utf-8, application/json

Example Request Body

{
  "email_address": "john@example.org",
  "password": "test123",
  "username": "john"
}

Response

application/json;charset=utf-8, application/json

Example Response Body

{}

GET /api/users/:username

:username - Username of the user

Response

application/json;charset=utf-8, application/json

Example Response Body

{
  "serverRoles": [
    "admin"
  ],
  "teams": [
    {
      "billing": null,
      "name": "Team 1",
      "numberOfDatabases": 1
    }
  ],
  "username": "john"
}

POST /api/users/invite

Request

application/json;charset=utf-8, application/json

Example Request Body

{
  "email": "joe@example.com"
}

Response

application/json;charset=utf-8, application/json

Example Response Body

{}

POST /api/users/reset-password

Request

application/json;charset=utf-8, application/json

Example Request Body

{
  "email": "joe@example.com"
}

Response

application/json;charset=utf-8, application/json

Example Response Body

{}

POST /api/users/reset-password/submit

Request

application/json;charset=utf-8, application/json

Example Request Body

{
  "password": "donotusethispassword",
  "resetKey": "joe@example.com"
}

Response

application/json;charset=utf-8, application/json

Example Response Body

{}

POST /dbs

Multipart Request SamplesThis endpoint takes `multipart/form-data` requests. The following is a list of sample requests:

[DocNote {_noteTitle = "Multipart Request Samples", _noteBody = ["This endpoint takes `multipart/form-data` requests. The following is a list of sample requests:",""]}]

Response

application/json;charset=utf-8, application/json

Example Response Body

{
  "id": "example-database-wqaldslkjfvlbdxqwehfhj",
  "ownerName": "some-user",
  "ownershipUtc": "2023-03-11T14:56:17.198Z"
}

PUT /dbs/:dbId

Multipart Request SamplesThis endpoint takes `multipart/form-data` requests. The following is a list of sample requests:

:dbId - ID of the database to be served

[DocNote {_noteTitle = "Multipart Request Samples", _noteBody = ["This endpoint takes `multipart/form-data` requests. The following is a list of sample requests:",""]}]

Response

application/json;charset=utf-8, application/json

Example Response Body

{
  "id": "example-database-wqaldslkjfvlbdxqwehfhj",
  "ownerName": "some-user",
  "ownershipUtc": "2023-03-11T14:56:17.198Z"
}

GET /dbs/:dbId/apps/:appId

:dbId - ID of the database to be served

:appId - ID of the app to be served

Response

Example Response Body

GET /dbs/:dbId/download

:dbId - ID of the database to be served

Response

Example Response Body

GET /dbs/:dbId/duplicate

:dbId - ID of the database to be served

Response

text/html;charset=utf-8, text/html

Example Response Body

text/html;charset=utf-8

text/html

GET /dbs/:dbId/graphql

:dbId - ID of the database to be served

Response

text/html;charset=utf-8, text/html

Example Response Body

text/html;charset=utf-8

text/html

POST /dbs/:dbId/graphql

:dbId - ID of the database to be served

Request

application/json;charset=utf-8, application/json

Example Request Body

{
  "operationName": null,
  "query": "{ users { name, email } }",
  "variables": null
}

Response

application/json;charset=utf-8, application/json

Example Response Body

{}

GET /dbs/:dbId/playground/default-query

:dbId - ID of the database to be served

Response

text/plain;charset=utf-8

Example Response Body

text/plain;charset=utf-8

GET /dbs/:dbId/regenerate-db-id

:dbId - ID of the database to be served

Response

text/html;charset=utf-8, text/html

Example Response Body

text/html;charset=utf-8

text/html

GET /dbs/:dbId/regenerate-readonly-id

:dbId - ID of the database to be served

Response

text/html;charset=utf-8, text/html

Example Response Body

text/html;charset=utf-8

text/html

POST /dbs/:dbId/sql

:dbId - ID of the database to be served

Request

application/json;charset=utf-8, application/json

Example Request Body

{
  "query": "SELECT * FROM users"
}

Response

application/json;charset=utf-8, application/json

Example Response Body

{
  "affectedTables": [
    "users"
  ],
  "errors": [],
  "rows": [
    {
      "id": 1,
      "name": "John"
    },
    {
      "id": 2,
      "name": "Jane"
    }
  ],
  "runtimeSeconds": 5.0e-2
}

DELETE /fns/:funcId

:funcId - ID of the function

Request

application/json;charset=utf-8, application/json

Example Request Body

{}

Response

application/json;charset=utf-8, application/json

Example Response Body

{}

GET /fns/:funcId

:funcId - ID of the function

Response

application/json;charset=utf-8, application/json

Example Response Body

{}

PATCH /fns/:funcId

:funcId - ID of the function

Request

application/json;charset=utf-8, application/json

Example Request Body

{}

Response

application/json;charset=utf-8, application/json

Example Response Body

{}

POST /fns/:funcId

:funcId - ID of the function

Request

application/json;charset=utf-8, application/json

Example Request Body

{}

Response

application/json;charset=utf-8, application/json

Example Response Body

{}

PUT /fns/:funcId

:funcId - ID of the function

Request

application/json;charset=utf-8, application/json

Example Request Body

{}

Response

application/json;charset=utf-8, application/json

Example Response Body

{}

GET /password-reset/:passwordResetKey

:passwordResetKey - Unique short-lived token used to reset passwords

Response

text/html;charset=utf-8, text/html

Example Response Body

text/html;charset=utf-8

text/html

GET /readonly/:readonlyId/duplicate

:readonlyId - Read-only ID of the database

Response

text/html;charset=utf-8, text/html

Example Response Body

text/html;charset=utf-8

text/html

GET /readonly/:readonlyId/graphql

:readonlyId - Read-only ID of the database

Response

text/html;charset=utf-8, text/html

Example Response Body

text/html;charset=utf-8

text/html

POST /readonly/:readonlyId/graphql

:readonlyId - Read-only ID of the database

Request

application/json;charset=utf-8, application/json

Example Request Body

{
  "operationName": null,
  "query": "{ users { name, email } }",
  "variables": null
}

Response

application/json;charset=utf-8, application/json

Example Response Body

{}

GET /readonly/:readonlyId/tables/:tableId/columns/:columnName/files/:primaryKey/:equalsValue

:readonlyId - Read-only ID of the database

:tableId - Name of table

:columnName - Name of column

:primaryKey - Name of primary key column

:equalsValue - Value to compare primary key to

Response

Example Response Body

GET /verify-email/:emailVerificationKey

:emailVerificationKey - Unique token to verify email address

Response

text/html;charset=utf-8, text/html

Example Response Body

text/html;charset=utf-8

text/html