Skip to content

TablesDB

SERVER

The TablesDB service allows you to create structured tables of rows, query and filter lists of rows, and manage an advanced set of read and write access permissions.

All data returned by the TablesDB service are represented as structured JSON rows.

The TablesDB service can contain multiple databases, each database can contain multiple tables. A table is a group of similarly structured rows. The accepted structure of rows is defined by table columns. The table columns help you ensure all your user-submitted data is validated and stored according to the table structure.

Using Appwrite permissions architecture, you can assign read or write access to each table or row in your project for either a specific user, team, user role, or even grant it with public access (any). You can learn more about how Appwrite handles permissions and access control.

Base URL
https://<REGION>.cloud.appwrite.io/v1

Create database

Create a new Database.

  • Request
    • databaseId string
      required

      Unique Id. Choose a custom ID or generate a random ID with ID.unique(). Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.

    • name string
      required

      Database name. Max length: 128 chars.

    • enabled boolean

      Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.

  • Response
Endpoint
POST /tablesdb
GraphQL
mutation {
    tablesDBCreate(
        databaseId: "<DATABASE_ID>",
        name: "<NAME>",
        enabled: false
    ) {
        _id
        name
        _createdAt
        _updatedAt
        enabled
        type
    }
}

Get database

Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.

  • Request
    • databaseId string
      required

      Database ID.

  • Response
Endpoint
GET /tablesdb/{databaseId}
GraphQL

List databases

Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.

  • Request
    • queries array

      Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: name

    • search string

      Search term to filter your list results. Max length: 256 chars.

  • Response
Endpoint
GET /tablesdb
GraphQL

Update database

Update a database by its unique ID.

  • Request
    • databaseId string
      required

      Database ID.

    • name string
      required

      Database name. Max length: 128 chars.

    • enabled boolean

      Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.

  • Response
Endpoint
PUT /tablesdb/{databaseId}
GraphQL
mutation {
    tablesDBUpdate(
        databaseId: "<DATABASE_ID>",
        name: "<NAME>",
        enabled: false
    ) {
        _id
        name
        _createdAt
        _updatedAt
        enabled
        type
    }
}

Delete database

Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.

  • Request
    • databaseId string
      required

      Database ID.

  • Response
    • 204 no content
Endpoint
DELETE /tablesdb/{databaseId}
GraphQL
mutation {
    tablesDBDelete(
        databaseId: "<DATABASE_ID>"
    ) {
        status
    }
}

Create table

Create a new Table. Before using this route, you should create a new database resource using either a server integration API or directly from your database console.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Unique Id. Choose a custom ID or generate a random ID with ID.unique(). Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.

    • name string
      required

      Table name. Max length: 128 chars.

    • rowSecurity boolean

      Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a row. Learn more about permissions.

    • enabled boolean

      Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled.

  • Response
    • 201 application/json
Endpoint
POST /tablesdb/{databaseId}/tables
GraphQL
mutation {
    tablesDBCreateTable(
        databaseId: "<DATABASE_ID>",
        tableId: "<TABLE_ID>",
        name: "<NAME>",
        permissions: ["read("any")"],
        rowSecurity: false,
        enabled: false
    ) {
        _id
        _createdAt
        _updatedAt
        _permissions
        databaseId
        name
        enabled
        rowSecurity
        columns
        indexes {
            _id
            _createdAt
            _updatedAt
            key
            type
            status
            error
            columns
            lengths
            orders
        }
    }
}

Get table

Get a table by its unique ID. This endpoint response returns a JSON object with the table metadata.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID.

  • Response
    • 200 application/json
Endpoint
GET /tablesdb/{databaseId}/tables/{tableId}
GraphQL

List tables

Get a list of all tables that belong to the provided databaseId. You can use the search parameter to filter your results.

  • Request
    • databaseId string
      required

      Database ID.

    • queries array

      Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: name, enabled, rowSecurity

    • search string

      Search term to filter your list results. Max length: 256 chars.

  • Response
Endpoint
GET /tablesdb/{databaseId}/tables
GraphQL

Update table

Update a table by its unique ID.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID.

    • name string
      required

      Table name. Max length: 128 chars.

    • rowSecurity boolean

      Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a document. Learn more about permissions.

    • enabled boolean

      Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled.

  • Response
    • 200 application/json
Endpoint
PUT /tablesdb/{databaseId}/tables/{tableId}
GraphQL
mutation {
    tablesDBUpdateTable(
        databaseId: "<DATABASE_ID>",
        tableId: "<TABLE_ID>",
        name: "<NAME>",
        permissions: ["read("any")"],
        rowSecurity: false,
        enabled: false
    ) {
        _id
        _createdAt
        _updatedAt
        _permissions
        databaseId
        name
        enabled
        rowSecurity
        columns
        indexes {
            _id
            _createdAt
            _updatedAt
            key
            type
            status
            error
            columns
            lengths
            orders
        }
    }
}

Delete table

Delete a table by its unique ID. Only users with write permissions have access to delete this resource.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID.

  • Response
    • 204 no content
Endpoint
DELETE /tablesdb/{databaseId}/tables/{tableId}
GraphQL
mutation {
    tablesDBDeleteTable(
        databaseId: "<DATABASE_ID>",
        tableId: "<TABLE_ID>"
    ) {
        status
    }
}

Create boolean column

Create a boolean column.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID. You can create a new table using the Database service server integration.

    • key string
      required

      Column Key.

    • required boolean
      required

      Is column required?

    • default boolean

      Default value for column when not provided. Cannot be set when column is required.

    • array boolean

      Is column an array?

  • Response
Endpoint
POST /tablesdb/{databaseId}/tables/{tableId}/columns/boolean
GraphQL
mutation {
    tablesDBCreateBooleanColumn(
        databaseId: "<DATABASE_ID>",
        tableId: "<TABLE_ID>",
        key: "",
        required: false,
        default: false,
        array: false
    ) {
        key
        type
        status
        error
        required
        array
        _createdAt
        _updatedAt
        default
    }
}

Create datetime column

Create a date time column according to the ISO 8601 standard.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID.

    • key string
      required

      Column Key.

    • required boolean
      required

      Is column required?

    • default string

      Default value for the column in ISO 8601 format. Cannot be set when column is required.

    • array boolean

      Is column an array?

  • Response
Endpoint
POST /tablesdb/{databaseId}/tables/{tableId}/columns/datetime
GraphQL
mutation {
    tablesDBCreateDatetimeColumn(
        databaseId: "<DATABASE_ID>",
        tableId: "<TABLE_ID>",
        key: "",
        required: false,
        default: "",
        array: false
    ) {
        key
        type
        status
        error
        required
        array
        _createdAt
        _updatedAt
        format
        default
    }
}

Create email column

Create an email column.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID.

    • key string
      required

      Column Key.

    • required boolean
      required

      Is column required?

    • default string

      Default value for column when not provided. Cannot be set when column is required.

    • array boolean

      Is column an array?

  • Response
Endpoint
POST /tablesdb/{databaseId}/tables/{tableId}/columns/email
GraphQL
mutation {
    tablesDBCreateEmailColumn(
        databaseId: "<DATABASE_ID>",
        tableId: "<TABLE_ID>",
        key: "",
        required: false,
        default: "email@example.com",
        array: false
    ) {
        key
        type
        status
        error
        required
        array
        _createdAt
        _updatedAt
        format
        default
    }
}

Create enum column

Create an enumeration column. The elements param acts as a white-list of accepted values for this column.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID.

    • key string
      required

      Column Key.

    • elements array
      required

      Array of enum values.

    • required boolean
      required

      Is column required?

    • default string

      Default value for column when not provided. Cannot be set when column is required.

    • array boolean

      Is column an array?

  • Response
Endpoint
POST /tablesdb/{databaseId}/tables/{tableId}/columns/enum
GraphQL
mutation {
    tablesDBCreateEnumColumn(
        databaseId: "<DATABASE_ID>",
        tableId: "<TABLE_ID>",
        key: "",
        elements: [],
        required: false,
        default: "<DEFAULT>",
        array: false
    ) {
        key
        type
        status
        error
        required
        array
        _createdAt
        _updatedAt
        elements
        format
        default
    }
}

Create float column

Create a float column. Optionally, minimum and maximum values can be provided.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID.

    • key string
      required

      Column Key.

    • required boolean
      required

      Is column required?

    • min number

      Minimum value

    • max number

      Maximum value

    • default number

      Default value. Cannot be set when required.

    • array boolean

      Is column an array?

  • Response
Endpoint
POST /tablesdb/{databaseId}/tables/{tableId}/columns/float
GraphQL
mutation {
    tablesDBCreateFloatColumn(
        databaseId: "<DATABASE_ID>",
        tableId: "<TABLE_ID>",
        key: "",
        required: false,
        min: 0,
        max: 0,
        default: 0,
        array: false
    ) {
        key
        type
        status
        error
        required
        array
        _createdAt
        _updatedAt
        min
        max
        default
    }
}

Create integer column

Create an integer column. Optionally, minimum and maximum values can be provided.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID.

    • key string
      required

      Column Key.

    • required boolean
      required

      Is column required?

    • min integer

      Minimum value

    • max integer

      Maximum value

    • default integer

      Default value. Cannot be set when column is required.

    • array boolean

      Is column an array?

  • Response
Endpoint
POST /tablesdb/{databaseId}/tables/{tableId}/columns/integer
GraphQL
mutation {
    tablesDBCreateIntegerColumn(
        databaseId: "<DATABASE_ID>",
        tableId: "<TABLE_ID>",
        key: "",
        required: false,
        min: 0,
        max: 0,
        default: 0,
        array: false
    ) {
        key
        type
        status
        error
        required
        array
        _createdAt
        _updatedAt
        min
        max
        default
    }
}

Create IP address column

Create IP address column.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID.

    • key string
      required

      Column Key.

    • required boolean
      required

      Is column required?

    • default string

      Default value. Cannot be set when column is required.

    • array boolean

      Is column an array?

  • Response
Endpoint
POST /tablesdb/{databaseId}/tables/{tableId}/columns/ip
GraphQL
mutation {
    tablesDBCreateIpColumn(
        databaseId: "<DATABASE_ID>",
        tableId: "<TABLE_ID>",
        key: "",
        required: false,
        default: "",
        array: false
    ) {
        key
        type
        status
        error
        required
        array
        _createdAt
        _updatedAt
        format
        default
    }
}

Create line column

Create a geometric line attribute.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID. You can create a new table using the TablesDB service server integration.

    • key string
      required

      Column Key.

    • required boolean
      required

      Is column required?

    • default array

      Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required.

  • Response
Endpoint
POST /tablesdb/{databaseId}/tables/{tableId}/columns/line
GraphQL
mutation {
    tablesDBCreateLineColumn(
        databaseId: "<DATABASE_ID>",
        tableId: "<TABLE_ID>",
        key: "",
        required: false,
        default: ""
    ) {
        key
        type
        status
        error
        required
        array
        _createdAt
        _updatedAt
        default
    }
}

Create point column

Create a geometric point attribute.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID. You can create a new table using the TablesDB service server integration.

    • key string
      required

      Column Key.

    • required boolean
      required

      Is column required?

    • default array

      Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required.

  • Response
Endpoint
POST /tablesdb/{databaseId}/tables/{tableId}/columns/point
GraphQL
mutation {
    tablesDBCreatePointColumn(
        databaseId: "<DATABASE_ID>",
        tableId: "<TABLE_ID>",
        key: "",
        required: false,
        default: ""
    ) {
        key
        type
        status
        error
        required
        array
        _createdAt
        _updatedAt
        default
    }
}

Create polygon column

Create a geometric polygon attribute.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID. You can create a new table using the TablesDB service server integration.

    • key string
      required

      Column Key.

    • required boolean
      required

      Is column required?

    • default array

      Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required.

  • Response
Endpoint
POST /tablesdb/{databaseId}/tables/{tableId}/columns/polygon
GraphQL
mutation {
    tablesDBCreatePolygonColumn(
        databaseId: "<DATABASE_ID>",
        tableId: "<TABLE_ID>",
        key: "",
        required: false,
        default: ""
    ) {
        key
        type
        status
        error
        required
        array
        _createdAt
        _updatedAt
        default
    }
}

Create relationship column

Create relationship column. Learn more about relationship columns.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID.

    • relatedTableId string
      required

      Related Table ID.

    • type string
      required

      Relation type

    • twoWay boolean

      Is Two Way?

    • key string

      Column Key.

    • twoWayKey string

      Two Way Column Key.

    • onDelete string

      Constraints option

  • Response
Endpoint
POST /tablesdb/{databaseId}/tables/{tableId}/columns/relationship
GraphQL
mutation {
    tablesDBCreateRelationshipColumn(
        databaseId: "<DATABASE_ID>",
        tableId: "<TABLE_ID>",
        relatedTableId: "<RELATED_TABLE_ID>",
        type: "oneToOne",
        twoWay: false,
        key: "",
        twoWayKey: "",
        onDelete: "cascade"
    ) {
        key
        type
        status
        error
        required
        array
        _createdAt
        _updatedAt
        relatedTable
        relationType
        twoWay
        twoWayKey
        onDelete
        side
    }
}

Create string column

Create a string column.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID. You can create a new table using the Database service server integration.

    • key string
      required

      Column Key.

    • size integer
      required

      Column size for text columns, in number of characters.

    • required boolean
      required

      Is column required?

    • default string

      Default value for column when not provided. Cannot be set when column is required.

    • array boolean

      Is column an array?

    • encrypt boolean

      Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried.

  • Response
Endpoint
POST /tablesdb/{databaseId}/tables/{tableId}/columns/string
GraphQL
mutation {
    tablesDBCreateStringColumn(
        databaseId: "<DATABASE_ID>",
        tableId: "<TABLE_ID>",
        key: "",
        size: 1,
        required: false,
        default: "<DEFAULT>",
        array: false,
        encrypt: false
    ) {
        key
        type
        status
        error
        required
        array
        _createdAt
        _updatedAt
        size
        default
        encrypt
    }
}

Create URL column

Create a URL column.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID.

    • key string
      required

      Column Key.

    • required boolean
      required

      Is column required?

    • default string

      Default value for column when not provided. Cannot be set when column is required.

    • array boolean

      Is column an array?

  • Response
Endpoint
POST /tablesdb/{databaseId}/tables/{tableId}/columns/url
GraphQL
mutation {
    tablesDBCreateUrlColumn(
        databaseId: "<DATABASE_ID>",
        tableId: "<TABLE_ID>",
        key: "",
        required: false,
        default: "https://example.com",
        array: false
    ) {
        key
        type
        status
        error
        required
        array
        _createdAt
        _updatedAt
        format
        default
    }
}

Get column

Get column by ID.

Endpoint
GET /tablesdb/{databaseId}/tables/{tableId}/columns/{key}
GraphQL

List columns

List columns in the table.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID.

    • queries array

      Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: key, type, size, required, array, status, error

  • Response
Endpoint
GET /tablesdb/{databaseId}/tables/{tableId}/columns
GraphQL

Update boolean column

Update a boolean column. Changing the default value will not update already existing rows.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID. You can create a new table using the Database service server integration.

    • key string
      required

      Column Key.

    • required boolean
      required

      Is column required?

    • default boolean
      required

      Default value for column when not provided. Cannot be set when column is required.

    • newKey string

      New Column Key.

  • Response
Endpoint
PATCH /tablesdb/{databaseId}/tables/{tableId}/columns/boolean/{key}
GraphQL
mutation {
    tablesDBUpdateBooleanColumn(
        databaseId: "<DATABASE_ID>",
        tableId: "<TABLE_ID>",
        key: "",
        required: false,
        default: false,
        newKey: ""
    ) {
        key
        type
        status
        error
        required
        array
        _createdAt
        _updatedAt
        default
    }
}

Update dateTime column

Update a date time column. Changing the default value will not update already existing rows.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID.

    • key string
      required

      Column Key.

    • required boolean
      required

      Is column required?

    • default string
      required

      Default value for column when not provided. Cannot be set when column is required.

    • newKey string

      New Column Key.

  • Response
Endpoint
PATCH /tablesdb/{databaseId}/tables/{tableId}/columns/datetime/{key}
GraphQL
mutation {
    tablesDBUpdateDatetimeColumn(
        databaseId: "<DATABASE_ID>",
        tableId: "<TABLE_ID>",
        key: "",
        required: false,
        default: "",
        newKey: ""
    ) {
        key
        type
        status
        error
        required
        array
        _createdAt
        _updatedAt
        format
        default
    }
}

Update email column

Update an email column. Changing the default value will not update already existing rows.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID.

    • key string
      required

      Column Key.

    • required boolean
      required

      Is column required?

    • default string
      required

      Default value for column when not provided. Cannot be set when column is required.

    • newKey string

      New Column Key.

  • Response
Endpoint
PATCH /tablesdb/{databaseId}/tables/{tableId}/columns/email/{key}
GraphQL
mutation {
    tablesDBUpdateEmailColumn(
        databaseId: "<DATABASE_ID>",
        tableId: "<TABLE_ID>",
        key: "",
        required: false,
        default: "email@example.com",
        newKey: ""
    ) {
        key
        type
        status
        error
        required
        array
        _createdAt
        _updatedAt
        format
        default
    }
}

Update enum column

Update an enum column. Changing the default value will not update already existing rows.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID.

    • key string
      required

      Column Key.

    • elements array
      required

      Updated list of enum values.

    • required boolean
      required

      Is column required?

    • default string
      required

      Default value for column when not provided. Cannot be set when column is required.

    • newKey string

      New Column Key.

  • Response
Endpoint
PATCH /tablesdb/{databaseId}/tables/{tableId}/columns/enum/{key}
GraphQL
mutation {
    tablesDBUpdateEnumColumn(
        databaseId: "<DATABASE_ID>",
        tableId: "<TABLE_ID>",
        key: "",
        elements: [],
        required: false,
        default: "<DEFAULT>",
        newKey: ""
    ) {
        key
        type
        status
        error
        required
        array
        _createdAt
        _updatedAt
        elements
        format
        default
    }
}

Update float column

Update a float column. Changing the default value will not update already existing rows.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID.

    • key string
      required

      Column Key.

    • required boolean
      required

      Is column required?

    • default number
      required

      Default value. Cannot be set when required.

    • min number

      Minimum value

    • max number

      Maximum value

    • newKey string

      New Column Key.

  • Response
Endpoint
PATCH /tablesdb/{databaseId}/tables/{tableId}/columns/float/{key}
GraphQL
mutation {
    tablesDBUpdateFloatColumn(
        databaseId: "<DATABASE_ID>",
        tableId: "<TABLE_ID>",
        key: "",
        required: false,
        default: 0,
        min: 0,
        max: 0,
        newKey: ""
    ) {
        key
        type
        status
        error
        required
        array
        _createdAt
        _updatedAt
        min
        max
        default
    }
}

Update integer column

Update an integer column. Changing the default value will not update already existing rows.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID.

    • key string
      required

      Column Key.

    • required boolean
      required

      Is column required?

    • default integer
      required

      Default value. Cannot be set when column is required.

    • min integer

      Minimum value

    • max integer

      Maximum value

    • newKey string

      New Column Key.

  • Response
Endpoint
PATCH /tablesdb/{databaseId}/tables/{tableId}/columns/integer/{key}
GraphQL
mutation {
    tablesDBUpdateIntegerColumn(
        databaseId: "<DATABASE_ID>",
        tableId: "<TABLE_ID>",
        key: "",
        required: false,
        default: 0,
        min: 0,
        max: 0,
        newKey: ""
    ) {
        key
        type
        status
        error
        required
        array
        _createdAt
        _updatedAt
        min
        max
        default
    }
}

Update IP address column

Update an ip column. Changing the default value will not update already existing rows.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID.

    • key string
      required

      Column Key.

    • required boolean
      required

      Is column required?

    • default string
      required

      Default value. Cannot be set when column is required.

    • newKey string

      New Column Key.

  • Response
Endpoint
PATCH /tablesdb/{databaseId}/tables/{tableId}/columns/ip/{key}
GraphQL
mutation {
    tablesDBUpdateIpColumn(
        databaseId: "<DATABASE_ID>",
        tableId: "<TABLE_ID>",
        key: "",
        required: false,
        default: "",
        newKey: ""
    ) {
        key
        type
        status
        error
        required
        array
        _createdAt
        _updatedAt
        format
        default
    }
}

Update line column

Update a line column. Changing the default value will not update already existing documents.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID. You can create a new table using the TablesDB service server integration.

    • key string
      required

      Column Key.

    • required boolean
      required

      Is column required?

    • default array

      Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required.

    • newKey string

      New Column Key.

  • Response
Endpoint
PATCH /tablesdb/{databaseId}/tables/{tableId}/columns/line/{key}
GraphQL
mutation {
    tablesDBUpdateLineColumn(
        databaseId: "<DATABASE_ID>",
        tableId: "<TABLE_ID>",
        key: "",
        required: false,
        default: "",
        newKey: ""
    ) {
        key
        type
        status
        error
        required
        array
        _createdAt
        _updatedAt
        default
    }
}

Update point column

Update a point column. Changing the default value will not update already existing documents.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID. You can create a new table using the TablesDB service server integration.

    • key string
      required

      Column Key.

    • required boolean
      required

      Is column required?

    • default array

      Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required.

    • newKey string

      New Column Key.

  • Response
Endpoint
PATCH /tablesdb/{databaseId}/tables/{tableId}/columns/point/{key}
GraphQL
mutation {
    tablesDBUpdatePointColumn(
        databaseId: "<DATABASE_ID>",
        tableId: "<TABLE_ID>",
        key: "",
        required: false,
        default: "",
        newKey: ""
    ) {
        key
        type
        status
        error
        required
        array
        _createdAt
        _updatedAt
        default
    }
}

Update polygon column

Update a polygon column. Changing the default value will not update already existing documents.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID. You can create a new table using the TablesDB service server integration.

    • key string
      required

      Column Key.

    • required boolean
      required

      Is column required?

    • default array

      Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required.

    • newKey string

      New Column Key.

  • Response
Endpoint
PATCH /tablesdb/{databaseId}/tables/{tableId}/columns/polygon/{key}
GraphQL
mutation {
    tablesDBUpdatePolygonColumn(
        databaseId: "<DATABASE_ID>",
        tableId: "<TABLE_ID>",
        key: "",
        required: false,
        default: "",
        newKey: ""
    ) {
        key
        type
        status
        error
        required
        array
        _createdAt
        _updatedAt
        default
    }
}

Update relationship column

Update relationship column. Learn more about relationship columns.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID.

    • key string
      required

      Column Key.

    • onDelete string

      Constraints option

    • newKey string

      New Column Key.

  • Response
Endpoint
PATCH /tablesdb/{databaseId}/tables/{tableId}/columns/{key}/relationship
GraphQL
mutation {
    tablesDBUpdateRelationshipColumn(
        databaseId: "<DATABASE_ID>",
        tableId: "<TABLE_ID>",
        key: "",
        onDelete: "cascade",
        newKey: ""
    ) {
        key
        type
        status
        error
        required
        array
        _createdAt
        _updatedAt
        relatedTable
        relationType
        twoWay
        twoWayKey
        onDelete
        side
    }
}

Update string column

Update a string column. Changing the default value will not update already existing rows.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID. You can create a new table using the Database service server integration.

    • key string
      required

      Column Key.

    • required boolean
      required

      Is column required?

    • default string
      required

      Default value for column when not provided. Cannot be set when column is required.

    • size integer

      Maximum size of the string column.

    • newKey string

      New Column Key.

  • Response
Endpoint
PATCH /tablesdb/{databaseId}/tables/{tableId}/columns/string/{key}
GraphQL
mutation {
    tablesDBUpdateStringColumn(
        databaseId: "<DATABASE_ID>",
        tableId: "<TABLE_ID>",
        key: "",
        required: false,
        default: "<DEFAULT>",
        size: 1,
        newKey: ""
    ) {
        key
        type
        status
        error
        required
        array
        _createdAt
        _updatedAt
        size
        default
        encrypt
    }
}

Update URL column

Update an url column. Changing the default value will not update already existing rows.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID.

    • key string
      required

      Column Key.

    • required boolean
      required

      Is column required?

    • default string
      required

      Default value for column when not provided. Cannot be set when column is required.

    • newKey string

      New Column Key.

  • Response
Endpoint
PATCH /tablesdb/{databaseId}/tables/{tableId}/columns/url/{key}
GraphQL
mutation {
    tablesDBUpdateUrlColumn(
        databaseId: "<DATABASE_ID>",
        tableId: "<TABLE_ID>",
        key: "",
        required: false,
        default: "https://example.com",
        newKey: ""
    ) {
        key
        type
        status
        error
        required
        array
        _createdAt
        _updatedAt
        format
        default
    }
}

Delete column

Deletes a column.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID.

    • key string
      required

      Column Key.

  • Response
    • 204 no content
Endpoint
DELETE /tablesdb/{databaseId}/tables/{tableId}/columns/{key}
GraphQL
mutation {
    tablesDBDeleteColumn(
        databaseId: "<DATABASE_ID>",
        tableId: "<TABLE_ID>",
        key: ""
    ) {
        status
    }
}

Create index

Creates an index on the columns listed. Your index should include all the columns you will query in a single request. Type can be key, fulltext, or unique.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID. You can create a new table using the Database service server integration.

    • key string
      required

      Index Key.

    • type string
      required

      Index type.

    • columns array
      required

      Array of columns to index. Maximum of 100 columns are allowed, each 32 characters long.

    • orders array

      Array of index orders. Maximum of 100 orders are allowed.

    • lengths array

      Length of index. Maximum of 100

  • Response
    • 202 application/json
Endpoint
POST /tablesdb/{databaseId}/tables/{tableId}/indexes
GraphQL
mutation {
    tablesDBCreateIndex(
        databaseId: "<DATABASE_ID>",
        tableId: "<TABLE_ID>",
        key: "",
        type: "key",
        columns: [],
        orders: [],
        lengths: []
    ) {
        _id
        _createdAt
        _updatedAt
        key
        type
        status
        error
        columns
        lengths
        orders
    }
}

Get index

Get index by ID.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID. You can create a new table using the Database service server integration.

    • key string
      required

      Index Key.

  • Response
    • 200 application/json
Endpoint
GET /tablesdb/{databaseId}/tables/{tableId}/indexes/{key}
GraphQL

List indexes

List indexes on the table.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID. You can create a new table using the Database service server integration.

    • queries array

      Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: key, type, status, attributes, error

  • Response
Endpoint
GET /tablesdb/{databaseId}/tables/{tableId}/indexes
GraphQL

Delete index

Delete an index.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID. You can create a new table using the Database service server integration.

    • key string
      required

      Index Key.

  • Response
    • 204 no content
Endpoint
DELETE /tablesdb/{databaseId}/tables/{tableId}/indexes/{key}
GraphQL
mutation {
    tablesDBDeleteIndex(
        databaseId: "<DATABASE_ID>",
        tableId: "<TABLE_ID>",
        key: ""
    ) {
        status
    }
}

Create row

Create a new Row. Before using this route, you should create a new table resource using either a server integration API or directly from your database console.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID. You can create a new table using the Database service server integration. Make sure to define columns before creating rows.

    • rowId string

      Row ID. Choose a custom ID or generate a random ID with ID.unique(). Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.

    • data object

      Row data as JSON object.

    • permissions array

      An array of permissions strings. By default, only the current user is granted all permissions. Learn more about permissions.

  • Response
    • 201 application/json
  • Rate limits

    This endpoint is not limited when using Server SDKs with API keys. If you are using SSR with setSession, these rate limits will still apply. Learn more about SSR rate limits.

    The limit is applied for each unique limit key.

    Time frame
    Attempts
    Key
    1 minutes120 requestsIP + METHOD + URL + USER ID
Endpoint
POST /tablesdb/{databaseId}/tables/{tableId}/rows
GraphQL
mutation {
    tablesDBCreateRow(
        databaseId: "<DATABASE_ID>",
        tableId: "<TABLE_ID>",
        rowId: "<ROW_ID>",
        data: "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":30,\"isAdmin\":false}",
        permissions: ["read("any")"]
    ) {
        _id
        _sequence
        _tableId
        _databaseId
        _createdAt
        _updatedAt
        _permissions
        data
    }
}

Create rows

Create new Rows. Before using this route, you should create a new table resource using either a server integration API or directly from your database console.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID. You can create a new table using the Database service server integration. Make sure to define columns before creating rows.

    • rows array

      Array of documents data as JSON objects.

  • Response
  • Rate limits

    This endpoint is not limited when using Server SDKs with API keys. If you are using SSR with setSession, these rate limits will still apply. Learn more about SSR rate limits.

    The limit is applied for each unique limit key.

    Time frame
    Attempts
    Key
    1 minutes120 requestsIP + METHOD + URL + USER ID
Endpoint
POST /tablesdb/{databaseId}/tables/{tableId}/rows
GraphQL
mutation {
    tablesDBCreateRows(
        databaseId: "<DATABASE_ID>",
        tableId: "<TABLE_ID>",
        rows: []
    ) {
        total
        rows {
            _id
            _sequence
            _tableId
            _databaseId
            _createdAt
            _updatedAt
            _permissions
            data
        }
    }
}

Get row

Get a row by its unique ID. This endpoint response returns a JSON object with the row data.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID. You can create a new table using the Database service server integration.

    • rowId string
      required

      Row ID.

    • queries array

      Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long.

  • Response
    • 200 application/json
Endpoint
GET /tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}
GraphQL

List rows

Get a list of all the user's rows in a given table. You can use the query params to filter your results.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID. You can create a new table using the TableDB service server integration.

    • queries array

      Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long.

  • Response
Endpoint
GET /tablesdb/{databaseId}/tables/{tableId}/rows
GraphQL

Update row

Update a row by its unique ID. Using the patch method you can pass only specific fields that will get updated.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID.

    • rowId string
      required

      Row ID.

    • data object

      Row data as JSON object. Include only columns and value pairs to be updated.

  • Response
    • 200 application/json
  • Rate limits

    This endpoint is not limited when using Server SDKs with API keys. If you are using SSR with setSession, these rate limits will still apply. Learn more about SSR rate limits.

    The limit is applied for each unique limit key.

    Time frame
    Attempts
    Key
    1 minutes120 requestsIP + METHOD + URL + USER ID
Endpoint
PATCH /tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}
GraphQL
mutation {
    tablesDBUpdateRow(
        databaseId: "<DATABASE_ID>",
        tableId: "<TABLE_ID>",
        rowId: "<ROW_ID>",
        data: "{}",
        permissions: ["read("any")"]
    ) {
        _id
        _sequence
        _tableId
        _databaseId
        _createdAt
        _updatedAt
        _permissions
        data
    }
}

Update rows

Update all rows that match your queries, if no queries are submitted then all rows are updated. You can pass only specific fields to be updated.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID.

    • data object

      Row data as JSON object. Include only column and value pairs to be updated.

    • queries array

      Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long.

  • Response
  • Rate limits

    This endpoint is not limited when using Server SDKs with API keys. If you are using SSR with setSession, these rate limits will still apply. Learn more about SSR rate limits.

    The limit is applied for each unique limit key.

    Time frame
    Attempts
    Key
    1 minutes120 requestsIP + METHOD + URL + USER ID
Endpoint
PATCH /tablesdb/{databaseId}/tables/{tableId}/rows
GraphQL
mutation {
    tablesDBUpdateRows(
        databaseId: "<DATABASE_ID>",
        tableId: "<TABLE_ID>",
        data: "{}",
        queries: []
    ) {
        total
        rows {
            _id
            _sequence
            _tableId
            _databaseId
            _createdAt
            _updatedAt
            _permissions
            data
        }
    }
}

Upsert a row

Create or update a Row. Before using this route, you should create a new table resource using either a server integration API or directly from your database console.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID.

    • rowId string
      required

      Row ID.

    • data object

      Row data as JSON object. Include all required columns of the row to be created or updated.

  • Response
    • 201 application/json
  • Rate limits

    This endpoint is not limited when using Server SDKs with API keys. If you are using SSR with setSession, these rate limits will still apply. Learn more about SSR rate limits.

    The limit is applied for each unique limit key.

    Time frame
    Attempts
    Key
    1 minutes120 requestsIP + METHOD + URL + USER ID
Endpoint
PUT /tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}
GraphQL
mutation {
    tablesDBUpsertRow(
        databaseId: "<DATABASE_ID>",
        tableId: "<TABLE_ID>",
        rowId: "<ROW_ID>",
        data: "{}",
        permissions: ["read("any")"]
    ) {
        _id
        _sequence
        _tableId
        _databaseId
        _createdAt
        _updatedAt
        _permissions
        data
    }
}

Upsert rows

Create or update Rows. Before using this route, you should create a new table resource using either a server integration API or directly from your database console.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID.

    • rows array
      required

      Array of row data as JSON objects. May contain partial rows.

  • Response
  • Rate limits

    This endpoint is not limited when using Server SDKs with API keys. If you are using SSR with setSession, these rate limits will still apply. Learn more about SSR rate limits.

    The limit is applied for each unique limit key.

    Time frame
    Attempts
    Key
    1 minutes120 requestsIP + METHOD + URL + USER ID
Endpoint
PUT /tablesdb/{databaseId}/tables/{tableId}/rows
GraphQL
mutation {
    tablesDBUpsertRows(
        databaseId: "<DATABASE_ID>",
        tableId: "<TABLE_ID>",
        rows: []
    ) {
        total
        rows {
            _id
            _sequence
            _tableId
            _databaseId
            _createdAt
            _updatedAt
            _permissions
            data
        }
    }
}

Delete row

Delete a row by its unique ID.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID. You can create a new table using the Database service server integration.

    • rowId string
      required

      Row ID.

  • Response
    • 204 no content
  • Rate limits

    This endpoint is not limited when using Server SDKs with API keys. If you are using SSR with setSession, these rate limits will still apply. Learn more about SSR rate limits.

    The limit is applied for each unique limit key.

    Time frame
    Attempts
    Key
    1 minutes60 requestsIP + METHOD + URL + USER ID
Endpoint
DELETE /tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}
GraphQL
mutation {
    tablesDBDeleteRow(
        databaseId: "<DATABASE_ID>",
        tableId: "<TABLE_ID>",
        rowId: "<ROW_ID>"
    ) {
        status
    }
}

Delete rows

Bulk delete rows using queries, if no queries are passed then all rows are deleted.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID. You can create a new table using the Database service server integration.

    • queries array

      Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long.

  • Response
  • Rate limits

    This endpoint is not limited when using Server SDKs with API keys. If you are using SSR with setSession, these rate limits will still apply. Learn more about SSR rate limits.

    The limit is applied for each unique limit key.

    Time frame
    Attempts
    Key
    1 minutes60 requestsIP + METHOD + URL + USER ID
Endpoint
DELETE /tablesdb/{databaseId}/tables/{tableId}/rows
GraphQL
mutation {
    tablesDBDeleteRows(
        databaseId: "<DATABASE_ID>",
        tableId: "<TABLE_ID>",
        queries: []
    ) {
        total
        rows {
            _id
            _sequence
            _tableId
            _databaseId
            _createdAt
            _updatedAt
            _permissions
            data
        }
    }
}

Increment row column

Increment a specific column of a row by a given value.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID.

    • rowId string
      required

      Row ID.

    • column string
      required

      Column key.

    • value number

      Value to increment the column by. The value must be a number.

    • max number

      Maximum value for the column. If the current value is greater than this value, an error will be thrown.

  • Response
    • 200 application/json
  • Rate limits

    This endpoint is not limited when using Server SDKs with API keys. If you are using SSR with setSession, these rate limits will still apply. Learn more about SSR rate limits.

    The limit is applied for each unique limit key.

    Time frame
    Attempts
    Key
    1 minutes120 requestsIP + METHOD + URL + USER ID
Endpoint
PATCH /tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/{column}/increment
GraphQL
mutation {
    tablesDBIncrementRowColumn(
        databaseId: "<DATABASE_ID>",
        tableId: "<TABLE_ID>",
        rowId: "<ROW_ID>",
        column: "",
        value: 0,
        max: 0
    ) {
        _id
        _sequence
        _tableId
        _databaseId
        _createdAt
        _updatedAt
        _permissions
        data
    }
}

Decrement row column

Decrement a specific column of a row by a given value.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID.

    • rowId string
      required

      Row ID.

    • column string
      required

      Column key.

    • value number

      Value to increment the column by. The value must be a number.

    • min number

      Minimum value for the column. If the current value is lesser than this value, an exception will be thrown.

  • Response
    • 200 application/json
  • Rate limits

    This endpoint is not limited when using Server SDKs with API keys. If you are using SSR with setSession, these rate limits will still apply. Learn more about SSR rate limits.

    The limit is applied for each unique limit key.

    Time frame
    Attempts
    Key
    1 minutes120 requestsIP + METHOD + URL + USER ID
Endpoint
PATCH /tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/{column}/decrement
GraphQL
mutation {
    tablesDBDecrementRowColumn(
        databaseId: "<DATABASE_ID>",
        tableId: "<TABLE_ID>",
        rowId: "<ROW_ID>",
        column: "",
        value: 0,
        min: 0
    ) {
        _id
        _sequence
        _tableId
        _databaseId
        _createdAt
        _updatedAt
        _permissions
        data
    }
}