Skip to content
中文

Tables

Guide →

Base URL and authentication

Create table

POST /database/v1/table/{database_id}/tables

Parameter Location Description
database_id path Identifier of the table database to act on: the id (db_…) returned by databaseCreateTableDatabase or databaseListTableDatabases. A display name is not accepted; the id of a key-value database returns 404 DATABASE_NOT_FOUND.

Request body

Field Type Required Description
name string yes Table name used in the rows path and in link references. Must match ^[a-z_][a-z0-9_]{0,62}$ and be unused in this database; it can be renamed later without affecting data.; ^[a-z_][a-z0-9_]{0,62}$
description string no Optional free-text note describing what the table stores. Returned as description on the table; omit it to store null.
fields NewField[] yes Initial field definitions, in display order; may be an empty array. At most 64 fields per table and at most 16 indexed or unique fields. Each item follows the NewField shape selected by its type.

Returns: Table.

Response

HTTP 201

Success

application/json

Name Type Description
id string Table identifier, prefixed tbl_. Stable across renames and accepted wherever a table path parameter takes an id or name.
name string Current table name, usable in the rows path; may change when the table is renamed.
description string | null Free-text note about the table, or null when none was set.
fields array<object> Field definitions of the table, in display order. Row values are keyed by each field's name.
fields[].id string Field identifier, prefixed fld_. Stable across renames; accepted wherever a field path parameter takes an id or name.
fields[].name string Current field name; rows are keyed by it in requests and responses. May change when the field is renamed.
fields[].description string | null Free-text note about the field, or null when none was set.
fields[].required boolean Whether every row must hold a non-null value for this field.
fields[].unique boolean Whether values must be distinct across rows; fixed at creation. A unique field is indexed, and a violation returns 409 UNIQUE_VIOLATION.
fields[].indexed boolean Whether an index is maintained for faster filters and ordering. Always false for json and link fields.
fields[].type string Scalar data type of the field; it cannot be changed after the field is created. / Type json: the value is any JSON document validated against options.schema. It cannot be changed after the field is created. / Type link: the value is the id of a row in another table (an array of ids when options.multiple is true). It cannot be changed after the field is created.
fields[].options object Scalar fields take no options; always an empty object. / Settings of a json field. schema is required. / Settings of a link field. Both linked_table_id and multiple are required.
fields[].default any Default JSON value for omitted insert fields; must match the field type and JSON schema. A datetime default of "now()" evaluates to server time on insertion and reads back as "now()" in the field definition. For string and json fields it is a literal string. Explicit null remains null. Link fields do not support defaults.
schema_revision integer Counter that starts at 1 and increases by one each time the table's name, description or fields change; use it to detect schema changes.
created_at string Time the table was created, as an RFC 3339 UTC timestamp.
updated_at string Time of the last schema change to the table, as an RFC 3339 UTC timestamp.
row_count integer Number of rows currently stored. Returned only by databaseGetTable; absent from list, create and field responses.
终端窗口
curl -X POST "https://api.deepraxis.com/database/v1/table/${DATABASE_ID}/tables" \
-H "Authorization: Bearer $PRAXIS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"tasks","fields":[{"name":"title","type":"string","required":true,"unique":true},{"name":"done","type":"boolean"}]}'

Response example — HTTP 201

{
"id": "tbl_2f51c604bca34b47",
"name": "tasks",
"description": null,
"schema_revision": 1,
"created_at": "2026-11-27T03:16:34.251Z",
"updated_at": "2026-11-27T03:16:34.251Z",
"fields": [
{
"id": "fld_28334d168e2544de",
"name": "title",
"type": "string",
"description": null,
"required": true,
"unique": true,
"indexed": false
},
{
"id": "fld_e7fd0a5d1c0f4f16",
"name": "done",
"type": "boolean",
"description": null,
"required": false,
"unique": false,
"indexed": false
}
]
}

List tables

GET /database/v1/table/{database_id}/tables

Parameter Location Description
database_id path Identifier of the table database to act on: the id (db_…) returned by databaseCreateTableDatabase or databaseListTableDatabases. A display name is not accepted; the id of a key-value database returns 404 DATABASE_NOT_FOUND.

Returns: Page + object.

Response

HTTP 200

Success

application/json

Name Type Description
data array<object> Every table of the database with its fields, in creation order; at most 50 items.
data[].id string Table identifier, prefixed tbl_. Stable across renames and accepted wherever a table path parameter takes an id or name.
data[].name string Current table name, usable in the rows path; may change when the table is renamed.
data[].description string | null Free-text note about the table, or null when none was set.
data[].fields array<object> Field definitions of the table, in display order. Row values are keyed by each field's name.
data[].schema_revision integer Counter that starts at 1 and increases by one each time the table's name, description or fields change; use it to detect schema changes.
data[].created_at string Time the table was created, as an RFC 3339 UTC timestamp.
data[].updated_at string Time of the last schema change to the table, as an RFC 3339 UTC timestamp.
data[].row_count integer Number of rows currently stored. Returned only by databaseGetTable; absent from list, create and field responses.
next_cursor string | null Opaque cursor for the next page, or null when there are no more items. Databases list: pass it as cursor. Events list: pass it as after_seq (order asc) or before_seq (order desc).
终端窗口
curl -X GET "https://api.deepraxis.com/database/v1/table/${DATABASE_ID}/tables" \
-H "Authorization: Bearer $PRAXIS_API_KEY"

Response example — HTTP 200

{
"data": [
{
"id": "tbl_2f51c604bca34b47",
"name": "tasks",
"description": null,
"schema_revision": 1,
"created_at": "2026-11-27T03:16:34.251Z",
"updated_at": "2026-11-27T03:16:34.251Z",
"fields": [
{
"id": "fld_28334d168e2544de",
"name": "title",
"type": "string",
"description": null,
"required": true,
"unique": true,
"indexed": false
},
{
"id": "fld_e7fd0a5d1c0f4f16",
"name": "done",
"type": "boolean",
"description": null,
"required": false,
"unique": false,
"indexed": false
}
]
}
],
"next_cursor": null
}

Get table

GET /database/v1/table/{database_id}/tables/{table}

Parameter Location Description
database_id path Identifier of the table database to act on: the id (db_…) returned by databaseCreateTableDatabase or databaseListTableDatabases. A display name is not accepted; the id of a key-value database returns 404 DATABASE_NOT_FOUND.
table path table ID or name.

Returns: Table.

Response

HTTP 200

Success

application/json

Name Type Description
id string Table identifier, prefixed tbl_. Stable across renames and accepted wherever a table path parameter takes an id or name.
name string Current table name, usable in the rows path; may change when the table is renamed.
description string | null Free-text note about the table, or null when none was set.
fields array<object> Field definitions of the table, in display order. Row values are keyed by each field's name.
fields[].id string Field identifier, prefixed fld_. Stable across renames; accepted wherever a field path parameter takes an id or name.
fields[].name string Current field name; rows are keyed by it in requests and responses. May change when the field is renamed.
fields[].description string | null Free-text note about the field, or null when none was set.
fields[].required boolean Whether every row must hold a non-null value for this field.
fields[].unique boolean Whether values must be distinct across rows; fixed at creation. A unique field is indexed, and a violation returns 409 UNIQUE_VIOLATION.
fields[].indexed boolean Whether an index is maintained for faster filters and ordering. Always false for json and link fields.
fields[].type string Scalar data type of the field; it cannot be changed after the field is created. / Type json: the value is any JSON document validated against options.schema. It cannot be changed after the field is created. / Type link: the value is the id of a row in another table (an array of ids when options.multiple is true). It cannot be changed after the field is created.
fields[].options object Scalar fields take no options; always an empty object. / Settings of a json field. schema is required. / Settings of a link field. Both linked_table_id and multiple are required.
fields[].default any Default JSON value for omitted insert fields; must match the field type and JSON schema. A datetime default of "now()" evaluates to server time on insertion and reads back as "now()" in the field definition. For string and json fields it is a literal string. Explicit null remains null. Link fields do not support defaults.
schema_revision integer Counter that starts at 1 and increases by one each time the table's name, description or fields change; use it to detect schema changes.
created_at string Time the table was created, as an RFC 3339 UTC timestamp.
updated_at string Time of the last schema change to the table, as an RFC 3339 UTC timestamp.
row_count integer Number of rows currently stored. Returned only by databaseGetTable; absent from list, create and field responses.
终端窗口
curl -X GET "https://api.deepraxis.com/database/v1/table/${DATABASE_ID}/tables/tasks" \
-H "Authorization: Bearer $PRAXIS_API_KEY"

Response example — HTTP 200

{
"id": "tbl_2f51c604bca34b47",
"name": "tasks",
"description": null,
"schema_revision": 1,
"created_at": "2026-11-27T03:16:34.251Z",
"updated_at": "2026-11-27T03:16:34.251Z",
"fields": [
{
"id": "fld_28334d168e2544de",
"name": "title",
"type": "string",
"description": null,
"required": true,
"unique": true,
"indexed": false
},
{
"id": "fld_e7fd0a5d1c0f4f16",
"name": "done",
"type": "boolean",
"description": null,
"required": false,
"unique": false,
"indexed": false
}
],
"row_count": 0
}

Update table

PATCH /database/v1/table/{database_id}/tables/{table}

Parameter Location Description
database_id path Identifier of the table database to act on: the id (db_…) returned by databaseCreateTableDatabase or databaseListTableDatabases. A display name is not accepted; the id of a key-value database returns 404 DATABASE_NOT_FOUND.
table path table ID or name.

Request body

Field Type Required Description
name string no New table name matching ^[a-z_][a-z0-9_]{0,62}$ and unused in this database. Omit it to keep the current name.
description string / null no New description text, or null to clear it. Omit it to keep the current description.

Returns: Table.

Response

HTTP 200

Success

application/json

Name Type Description
id string Table identifier, prefixed tbl_. Stable across renames and accepted wherever a table path parameter takes an id or name.
name string Current table name, usable in the rows path; may change when the table is renamed.
description string | null Free-text note about the table, or null when none was set.
fields array<object> Field definitions of the table, in display order. Row values are keyed by each field's name.
fields[].id string Field identifier, prefixed fld_. Stable across renames; accepted wherever a field path parameter takes an id or name.
fields[].name string Current field name; rows are keyed by it in requests and responses. May change when the field is renamed.
fields[].description string | null Free-text note about the field, or null when none was set.
fields[].required boolean Whether every row must hold a non-null value for this field.
fields[].unique boolean Whether values must be distinct across rows; fixed at creation. A unique field is indexed, and a violation returns 409 UNIQUE_VIOLATION.
fields[].indexed boolean Whether an index is maintained for faster filters and ordering. Always false for json and link fields.
fields[].type string Scalar data type of the field; it cannot be changed after the field is created. / Type json: the value is any JSON document validated against options.schema. It cannot be changed after the field is created. / Type link: the value is the id of a row in another table (an array of ids when options.multiple is true). It cannot be changed after the field is created.
fields[].options object Scalar fields take no options; always an empty object. / Settings of a json field. schema is required. / Settings of a link field. Both linked_table_id and multiple are required.
fields[].default any Default JSON value for omitted insert fields; must match the field type and JSON schema. A datetime default of "now()" evaluates to server time on insertion and reads back as "now()" in the field definition. For string and json fields it is a literal string. Explicit null remains null. Link fields do not support defaults.
schema_revision integer Counter that starts at 1 and increases by one each time the table's name, description or fields change; use it to detect schema changes.
created_at string Time the table was created, as an RFC 3339 UTC timestamp.
updated_at string Time of the last schema change to the table, as an RFC 3339 UTC timestamp.
row_count integer Number of rows currently stored. Returned only by databaseGetTable; absent from list, create and field responses.
终端窗口
curl -X PATCH "https://api.deepraxis.com/database/v1/table/${DATABASE_ID}/tables/tasks" \
-H "Authorization: Bearer $PRAXIS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"description":"Tasks for an agent"}'

Response example — HTTP 200

{
"id": "tbl_2f51c604bca34b47",
"name": "tasks",
"description": "Tasks for an agent",
"schema_revision": 2,
"created_at": "2026-11-27T03:16:34.251Z",
"updated_at": "2026-11-27T03:16:36.697Z",
"fields": [
{
"id": "fld_28334d168e2544de",
"name": "title",
"type": "string",
"description": null,
"required": true,
"unique": true,
"indexed": false
},
{
"id": "fld_e7fd0a5d1c0f4f16",
"name": "done",
"type": "boolean",
"description": null,
"required": false,
"unique": false,
"indexed": false
}
]
}

Delete table

DELETE /database/v1/table/{database_id}/tables/{table}

Parameter Location Description
database_id path Identifier of the table database to act on: the id (db_…) returned by databaseCreateTableDatabase or databaseListTableDatabases. A display name is not accepted; the id of a key-value database returns 404 DATABASE_NOT_FOUND.
table path table ID or name.

Returns: object.

Response

HTTP 200

Success

application/json

Name Type Description
deleted boolean Always true: the table and all of its rows were dropped immediately and cannot be recovered.
终端窗口
curl -X DELETE "https://api.deepraxis.com/database/v1/table/${DATABASE_ID}/tables/tasks" \
-H "Authorization: Bearer $PRAXIS_API_KEY"

Response example — HTTP 200

{
"deleted": true
}

Table

Field Type Required Description
id string yes Table identifier, prefixed tbl_. Stable across renames and accepted wherever a table path parameter takes an id or name.; ^tbl_
name string yes Current table name, usable in the rows path; may change when the table is renamed.
description string / null yes Free-text note about the table, or null when none was set.
fields Field[] yes Field definitions of the table, in display order. Row values are keyed by each field's name.
schema_revision integer yes Counter that starts at 1 and increases by one each time the table's name, description or fields change; use it to detect schema changes.
created_at date-time yes Time the table was created, as an RFC 3339 UTC timestamp.
updated_at date-time yes Time of the last schema change to the table, as an RFC 3339 UTC timestamp.
row_count integer no Number of rows currently stored. Returned only by databaseGetTable; absent from list, create and field responses.

Field · Page