数据库

数据库

请求、对象与响应示例。

指南 →

基础地址与鉴权

创建库

POST /database/v1/databases

请求体

字段类型必填说明
namestring是名称
labelsobject否标签

返回: Database.

响应

HTTP 201

Success

application/json

名称类型说明
idstringDatabase identifier, prefixed db_. Pass it as database_id in every database, table, field, rows and events path.
namestringDisplay name given at creation or by the last update; it is not an identifier.
labelsobjectString tags attached to the database, as key and value pairs; empty object when none.
statusstringLifecycle state of the database. Table, field and row calls work only while it is active.
table_countintegerNumber of tables currently in the database, at most 50; refreshed when the schema changes.
size_bytesintegerStorage size; row writes and GET refresh usage at most once per five seconds, schema changes refresh immediately.
created_atstringTime the database was created, as an RFC 3339 UTC timestamp.
updated_atstringTime of the last change to the name, labels, status or usage snapshot, as an RFC 3339 UTC timestamp.
deleted_atstring | nullTime the database entered the deleting state, as an RFC 3339 UTC timestamp; null while it is active and again after a restore.
purge_atstring | nullPermanent deletion deadline for deleting databases; null otherwise.
curl -X POST "https://api.deepraxis.ai/database/v1/databases" \
  -H "Authorization: Bearer $PRAXIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"walk-lib-r1-DOC-5320-tasks","labels":{"purpose":"docs","sample":"walk-lib-r1-doc-5320-"}}'

响应示例 — HTTP 201

{
  "id": "db_d6f0d743d5a645e8",
  "name": "walk-lib-r1-DOC-5320-tasks",
  "labels": {
    "purpose": "docs",
    "sample": "walk-lib-r1-doc-5320-"
  },
  "status": "active",
  "table_count": 0,
  "size_bytes": 53248,
  "created_at": "2026-10-11T17:41:40.620Z",
  "updated_at": "2026-10-11T17:41:41.488Z",
  "deleted_at": null,
  "purge_at": null
}

列出库

GET /database/v1/databases

参数位置说明
cursorquery上一页返回的 next_cursor。
limitquery最多返回的条数。 (default: 20) (1–100)
labelsquery精确匹配标签,例如 labels[purpose]=docs。
statusquery库状态:active 或 deleting;省略时只列出 active。

返回: Page + object.

响应

HTTP 200

Success

application/json

名称类型说明
dataarray<object>Databases on this page, newest first (created_at descending, ties by id). Deleting databases are excluded unless status=deleting.
data[].idstringDatabase identifier, prefixed db_. Pass it as database_id in every database, table, field, rows and events path.
data[].namestringDisplay name given at creation or by the last update; it is not an identifier.
data[].labelsobjectString tags attached to the database, as key and value pairs; empty object when none.
data[].statusstringLifecycle state of the database. Table, field and row calls work only while it is active.
data[].table_countintegerNumber of tables currently in the database, at most 50; refreshed when the schema changes.
data[].size_bytesintegerStorage size; row writes and GET refresh usage at most once per five seconds, schema changes refresh immediately.
data[].created_atstringTime the database was created, as an RFC 3339 UTC timestamp.
data[].updated_atstringTime of the last change to the name, labels, status or usage snapshot, as an RFC 3339 UTC timestamp.
data[].deleted_atstring | nullTime the database entered the deleting state, as an RFC 3339 UTC timestamp; null while it is active and again after a restore.
data[].purge_atstring | nullPermanent deletion deadline for deleting databases; null otherwise.
next_cursorstring | nullOpaque 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 -g -X GET "https://api.deepraxis.ai/database/v1/databases?limit=10&labels[purpose]=docs&labels[sample]=walk-lib-r1-doc-5320-" \
  -H "Authorization: Bearer $PRAXIS_API_KEY"

响应示例 — HTTP 200

{
  "data": [
    {
      "id": "db_d6f0d743d5a645e8",
      "name": "walk-lib-r1-DOC-5320-tasks",
      "labels": {
        "purpose": "docs",
        "sample": "walk-lib-r1-doc-5320-"
      },
      "status": "active",
      "table_count": 0,
      "size_bytes": 53248,
      "created_at": "2026-10-11T17:41:40.620Z",
      "updated_at": "2026-10-11T17:41:41.488Z",
      "deleted_at": null,
      "purge_at": null
    }
  ],
  "next_cursor": null
}

读取库

GET /database/v1/databases/{database_id}

参数位置说明
database_idpath库 ID。

返回: Database.

响应

HTTP 200

Success

application/json

名称类型说明
idstringDatabase identifier, prefixed db_. Pass it as database_id in every database, table, field, rows and events path.
namestringDisplay name given at creation or by the last update; it is not an identifier.
labelsobjectString tags attached to the database, as key and value pairs; empty object when none.
statusstringLifecycle state of the database. Table, field and row calls work only while it is active.
table_countintegerNumber of tables currently in the database, at most 50; refreshed when the schema changes.
size_bytesintegerStorage size; row writes and GET refresh usage at most once per five seconds, schema changes refresh immediately.
created_atstringTime the database was created, as an RFC 3339 UTC timestamp.
updated_atstringTime of the last change to the name, labels, status or usage snapshot, as an RFC 3339 UTC timestamp.
deleted_atstring | nullTime the database entered the deleting state, as an RFC 3339 UTC timestamp; null while it is active and again after a restore.
purge_atstring | nullPermanent deletion deadline for deleting databases; null otherwise.
curl -X GET "https://api.deepraxis.ai/database/v1/databases/${DATABASE_ID}" \
  -H "Authorization: Bearer $PRAXIS_API_KEY"

响应示例 — HTTP 200

{
  "id": "db_d6f0d743d5a645e8",
  "name": "walk-lib-r1-DOC-5320-tasks",
  "labels": {
    "purpose": "docs",
    "sample": "walk-lib-r1-doc-5320-"
  },
  "status": "active",
  "table_count": 0,
  "size_bytes": 53248,
  "created_at": "2026-10-11T17:41:40.620Z",
  "updated_at": "2026-10-11T17:41:41.488Z",
  "deleted_at": null,
  "purge_at": null
}

更新库

PATCH /database/v1/databases/{database_id}

参数位置说明
database_idpath库 ID。

请求体

字段类型必填说明
namestring否名称
labelsobject否标签

返回: Database.

响应

HTTP 200

Success

application/json

名称类型说明
idstringDatabase identifier, prefixed db_. Pass it as database_id in every database, table, field, rows and events path.
namestringDisplay name given at creation or by the last update; it is not an identifier.
labelsobjectString tags attached to the database, as key and value pairs; empty object when none.
statusstringLifecycle state of the database. Table, field and row calls work only while it is active.
table_countintegerNumber of tables currently in the database, at most 50; refreshed when the schema changes.
size_bytesintegerStorage size; row writes and GET refresh usage at most once per five seconds, schema changes refresh immediately.
created_atstringTime the database was created, as an RFC 3339 UTC timestamp.
updated_atstringTime of the last change to the name, labels, status or usage snapshot, as an RFC 3339 UTC timestamp.
deleted_atstring | nullTime the database entered the deleting state, as an RFC 3339 UTC timestamp; null while it is active and again after a restore.
purge_atstring | nullPermanent deletion deadline for deleting databases; null otherwise.
curl -X PATCH "https://api.deepraxis.ai/database/v1/databases/${DATABASE_ID}" \
  -H "Authorization: Bearer $PRAXIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"walk-lib-r1-DOC-5320-notes"}'

响应示例 — HTTP 200

{
  "id": "db_d6f0d743d5a645e8",
  "name": "walk-lib-r1-DOC-5320-notes",
  "labels": {
    "purpose": "docs",
    "sample": "walk-lib-r1-doc-5320-"
  },
  "status": "active",
  "table_count": 0,
  "size_bytes": 53248,
  "created_at": "2026-10-11T17:41:40.620Z",
  "updated_at": "2026-10-11T17:41:43.514Z",
  "deleted_at": null,
  "purge_at": null
}

删除库

DELETE /database/v1/databases/{database_id}

参数位置说明
database_idpath库 ID。

返回: Database.

响应

HTTP 200

Success

application/json

名称类型说明
idstringDatabase identifier, prefixed db_. Pass it as database_id in every database, table, field, rows and events path.
namestringDisplay name given at creation or by the last update; it is not an identifier.
labelsobjectString tags attached to the database, as key and value pairs; empty object when none.
statusstringLifecycle state of the database. Table, field and row calls work only while it is active.
table_countintegerNumber of tables currently in the database, at most 50; refreshed when the schema changes.
size_bytesintegerStorage size; row writes and GET refresh usage at most once per five seconds, schema changes refresh immediately.
created_atstringTime the database was created, as an RFC 3339 UTC timestamp.
updated_atstringTime of the last change to the name, labels, status or usage snapshot, as an RFC 3339 UTC timestamp.
deleted_atstring | nullTime the database entered the deleting state, as an RFC 3339 UTC timestamp; null while it is active and again after a restore.
purge_atstring | nullPermanent deletion deadline for deleting databases; null otherwise.
curl -X DELETE "https://api.deepraxis.ai/database/v1/databases/${DATABASE_ID}" \
  -H "Authorization: Bearer $PRAXIS_API_KEY"

响应示例 — HTTP 200

{
  "id": "db_d6f0d743d5a645e8",
  "name": "walk-lib-r1-DOC-5320-notes",
  "labels": {
    "purpose": "docs",
    "sample": "walk-lib-r1-doc-5320-"
  },
  "status": "deleting",
  "table_count": 0,
  "size_bytes": 53248,
  "created_at": "2026-10-11T17:41:40.620Z",
  "updated_at": "2026-10-11T17:41:51.868Z",
  "deleted_at": "2026-10-11T17:41:51.868Z",
  "purge_at": "2026-10-18T17:41:51.868Z"
}

恢复库

POST /database/v1/databases/{database_id}/restore

参数位置说明
database_idpath库 ID。

返回: Database.

响应

HTTP 200

Success

application/json

名称类型说明
idstringDatabase identifier, prefixed db_. Pass it as database_id in every database, table, field, rows and events path.
namestringDisplay name given at creation or by the last update; it is not an identifier.
labelsobjectString tags attached to the database, as key and value pairs; empty object when none.
statusstringLifecycle state of the database. Table, field and row calls work only while it is active.
table_countintegerNumber of tables currently in the database, at most 50; refreshed when the schema changes.
size_bytesintegerStorage size; row writes and GET refresh usage at most once per five seconds, schema changes refresh immediately.
created_atstringTime the database was created, as an RFC 3339 UTC timestamp.
updated_atstringTime of the last change to the name, labels, status or usage snapshot, as an RFC 3339 UTC timestamp.
deleted_atstring | nullTime the database entered the deleting state, as an RFC 3339 UTC timestamp; null while it is active and again after a restore.
purge_atstring | nullPermanent deletion deadline for deleting databases; null otherwise.
curl -X POST "https://api.deepraxis.ai/database/v1/databases/${DATABASE_ID}/restore" \
  -H "Authorization: Bearer $PRAXIS_API_KEY"

响应示例 — HTTP 200

{
  "id": "db_d6f0d743d5a645e8",
  "name": "walk-lib-r1-DOC-5320-notes",
  "labels": {
    "purpose": "docs",
    "sample": "walk-lib-r1-doc-5320-"
  },
  "status": "active",
  "table_count": 0,
  "size_bytes": 53248,
  "created_at": "2026-10-11T17:41:40.620Z",
  "updated_at": "2026-10-11T17:41:51.528Z",
  "deleted_at": null,
  "purge_at": null
}

清除库

POST /database/v1/databases/{database_id}/purge

参数位置说明
database_idpath库 ID。

返回: object.

响应

HTTP 200

Permanently purged

application/json

名称类型说明
idstringId (db_…) of the database that was permanently purged; it no longer resolves.
objectstringResource type of the purged object; always database.
purgedbooleanAlways true: the database and all of its data were permanently removed and cannot be recovered.
curl -X POST "https://api.deepraxis.ai/database/v1/databases/${DATABASE_ID}/purge" \
  -H "Authorization: Bearer $PRAXIS_API_KEY"

响应示例 — HTTP 200

{
  "id": "db_d6f0d743d5a645e8",
  "object": "database",
  "purged": true
}

Database

字段类型必填说明
idstring是资源 ID; ^db_
namestring是名称
labelsobject是标签
status"provisioning" / "active" / "deleting" / "deleted" / "failed"是库状态
table_countinteger是表数量
size_bytesinteger是占用字节数
created_atdate-time是创建时间
updated_atdate-time是更新时间
deleted_atdate-time / null是删除时间;未删除时为 null
purge_atdate-time / null是—

Page

字段类型必填说明
dataJSON[]是资源数组
next_cursorstring / null是下一页游标;没有后续时为 null
导出

本页内容