server-api
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSteedos Server API | Steedos 服务端 API
Steedos 服务端 API
Overview | 概述
概述
The Steedos Server exposes REST APIs under the namespace. All data/object/function endpoints require authentication via .
/api/v6/AuthGuardSteedos 服务端在 命名空间下提供 REST API。所有数据/对象/函数端点需要身份认证。
/api/v6/Steedos 服务端在 命名空间下提供 REST API。所有数据/对象/函数端点需要通过 进行身份认证。
/api/v6/AuthGuardSteedos 服务端在 命名空间下提供 REST API。所有数据/对象/函数端点需要身份认证。
/api/v6/Authentication | 认证
认证
All protected endpoints use cookie-based authentication:
- Cookies: (tenant ID) +
X-Space-Id(auth token)X-Auth-Token - Bearer Token: (Swagger/API calls)
Authorization: Bearer <token>
The server extracts user context as: .
{ user: userId, space: spaceId }所有受保护的端点使用基于Cookie的身份认证:
- Cookies:(租户ID) +
X-Space-Id(认证令牌)X-Auth-Token - Bearer Token:(Swagger/API调用时使用)
Authorization: Bearer <token>
服务端提取的用户上下文为:。
{ user: userId, space: spaceId }Swagger / OpenAPI
Swagger / OpenAPI
- Swagger UI:
GET /api/v6 - OpenAPI JSON:
GET /api/v6-json
API Tags: Auth, Users, Records, Mongodb, Files, Rooms, Tables, Pages, Services, Email, Docs, Automation, Oidc, App
- Swagger UI:
GET /api/v6 - OpenAPI JSON:
GET /api/v6-json
API 标签:Auth、Users、Records、Mongodb、Files、Rooms、Tables、Pages、Services、Email、Docs、Automation、Oidc、App
Data API — /api/v6/data
| 数据 API
/api/v6/data数据 API — /api/v6/data
/api/v6/dataCRUD operations for any object's records. All endpoints are under .
@UseGuards(AuthGuard)用于对任意对象的记录执行CRUD操作。所有端点均受 保护。
@UseGuards(AuthGuard)Create Record | 创建记录
创建记录
POST /api/v6/data/:objectNameBody: Record JSON object. You can specify or it will be auto-generated.
_idAuto-generated fields: , , , , ,
createdcreated_bymodifiedmodified_byspaceownerResponse: — The created record with all auto-generated fields.
200json
// Request
POST /api/v6/data/orders
{ "customer": "acme_corp", "total_amount": 5000 }
// Response
{
"_id": "f5e2b3c4-...",
"customer": "acme_corp",
"total_amount": 5000,
"created": "2026-04-18T...",
"created_by": "user_id",
"modified": "2026-04-18T...",
"modified_by": "user_id",
"owner": "user_id",
"space": "tenant_id"
}POST /api/v6/data/:objectName请求体:记录的JSON对象。您可以指定 ,否则系统将自动生成。
_id自动生成字段:、、、、、
createdcreated_bymodifiedmodified_byspaceowner响应: — 包含所有自动生成字段的已创建记录。
200json
// 请求
POST /api/v6/data/orders
{ "customer": "acme_corp", "total_amount": 5000 }
// 响应
{
"_id": "f5e2b3c4-...",
"customer": "acme_corp",
"total_amount": 5000,
"created": "2026-04-18T...",
"created_by": "user_id",
"modified": "2026-04-18T...",
"modified_by": "user_id",
"owner": "user_id",
"space": "tenant_id"
}List Records | 查询记录列表
查询记录列表
GET /api/v6/data/:objectNameQuery Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
| string | all | Comma-separated or JSON array: |
| string (JSON) | none | Filter criteria: |
| string | none | Sort string: |
| number | 0 | Pagination offset |
| number | 100 | Records per page |
Response:
json
{
"data": [...],
"totalCount": 42
}GET /api/v6/data/:objectName查询参数:
| 参数 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| string | 全部 | 逗号分隔或JSON数组: |
| string (JSON) | 无 | 筛选条件: |
| string | 无 | 排序字符串: |
| number | 0 | 分页偏移量 |
| number | 100 | 每页记录数 |
响应:
json
{
"data": [...],
"totalCount": 42
}Get Single Record | 获取单条记录
获取单条记录
GET /api/v6/data/:objectName/:recordIdResponse: — The record object. if not found.
200404GET /api/v6/data/:objectName/:recordId响应: — 记录对象。若未找到则返回。
200404Update Record | 更新记录
更新记录
PATCH /api/v6/data/:objectName/:idBody: Partial record with fields to update.
Response: — The updated record. if not found.
200404PATCH /api/v6/data/:objectName/:id请求体:包含待更新字段的部分记录对象。
响应: — 更新后的记录。若未找到则返回。
200404Delete Record | 删除记录
删除记录
DELETE /api/v6/data/:objectName/:idResponse: — . if not found.
200{ "deleted": true, "_id": "..." }404DELETE /api/v6/data/:objectName/:id响应: — 。若未找到则返回。
200{ "deleted": true, "_id": "..." }404Filter Operators | 筛选运算符
筛选运算符
| Operator | Description |
|---|---|
| Equal |
| Not equal |
| Less than |
| Greater than |
| Less than or equal |
| Greater than or equal |
| Starts with (strings) |
| Ends with (strings) |
| Contains (strings) |
| Does not contain (strings) |
| 运算符 | 描述 |
|---|---|
| 等于 |
| 不等于 |
| 小于 |
| 大于 |
| 小于等于 |
| 大于等于 |
| 以指定字符串开头(仅适用于字符串) |
| 以指定字符串结尾(仅适用于字符串) |
| 包含指定字符串(仅适用于字符串) |
| 不包含指定字符串(仅适用于字符串) |
Complex Filters | 复合筛选
复合筛选
json
// AND
[["status", "=", "active"], "and", ["amount", ">", 1000]]
// OR
[["status", "=", "active"], "or", ["status", "=", "pending"]]
// Nested
[["field", "=", 10], "and", [["other", "<", 3], "or", ["other", ">", 11]]]json
// 逻辑与
[["status", "=", "active"], "and", ["amount", ">", 1000]]
// 逻辑或
[["status", "=", "active"], "or", ["status", "=", "pending"]]
// 嵌套筛选
[["field", "=", 10], "and", [["other", "<", 3], "or", ["other", ">", 11]]]Objects API — /api/v6/objects
| 对象元数据 API
/api/v6/objects对象元数据 API — /api/v6/objects
/api/v6/objectsGet Object Configuration | 获取对象配置
获取对象配置
GET /api/v6/objects/:objectApiNameReturns the full object schema (fields, listviews, permissions, etc.).
GET /api/v6/objects/:objectApiName返回完整的对象 schema(字段、列表视图、权限等)。
Get Simplified Object | 获取简化对象
获取简化对象
GET /api/v6/objects/:objectApiName/simplifiedReturns only , , and non-hidden fields (with , , per field).
namelabellabeltypenameGET /api/v6/objects/:objectApiName/simplified仅返回、以及非隐藏字段(每个字段包含、、)。
namelabellabeltypenameFunctions API — /api/v6/functions
| 函数执行 API
/api/v6/functions函数执行 API — /api/v6/functions
/api/v6/functionsExecute Function (GET) | 执行函数 (GET)
执行函数 (GET)
GET /api/v6/functions/:objectApiName/:functionApiName?param1=value1Query parameters are passed to the function as .
ctx.inputGET /api/v6/functions/:objectApiName/:functionApiName?param1=value1查询参数将作为传递给函数。
ctx.inputExecute Function (POST) | 执行函数 (POST)
执行函数 (POST)
POST /api/v6/functions/:objectApiName/:functionApiNameBody: JSON object passed to the function as .
ctx.inputBoth methods merge and into the parameters:
objectNamefunctionApiNamejavascript
// Inside the function handler, ctx.input contains:
{
objectName: "orders",
functionApiName: "approve_order",
...bodyOrQueryParams
}POST /api/v6/functions/:objectApiName/:functionApiName请求体:JSON对象,将作为传递给函数。
ctx.input两种方式都会将和合并到参数中:
objectNamefunctionApiNamejavascript
// 在函数处理器内部,ctx.input包含以下内容:
{
objectName: "orders",
functionApiName: "approve_order",
...bodyOrQueryParams
}File Upload API | 文件上传 API
文件上传 API
POST /api/instance/:instanceId/fileMultipart form data with field name . Uses .
fileFileInterceptorPOST /api/instance/:instanceId/file使用字段名为的多部分表单数据,采用处理。
fileFileInterceptorApp / Health Endpoints | 应用/健康端点
应用/健康端点
| Endpoint | Method | Description |
|---|---|---|
| GET | Returns public env settings, asset URLs, server status |
| GET | Returns |
| GET/POST | Returns |
| 端点 | 请求方法 | 描述 |
|---|---|---|
| GET | 返回公共环境设置、资源URL、服务状态 |
| GET | 返回 |
| GET/POST | 返回 |
Public Settings Response | 公共设置响应
公共设置响应
json
{
"rootUrl": "https://example.com",
"assetUrls": ["...assets.json", "...assets.json"],
"unpkgUrl": "/unpkg",
"serverStatus": "running",
"steedosVersion": "3.0.13",
"steedosAmisVersion": "6.3.0-patch.8",
"PUBLIC_SETTINGS": { ... }
}json
{
"rootUrl": "https://example.com",
"assetUrls": ["...assets.json", "...assets.json"],
"unpkgUrl": "/unpkg",
"serverStatus": "running",
"steedosVersion": "3.0.13",
"steedosAmisVersion": "6.3.0-patch.8",
"PUBLIC_SETTINGS": { ... }
}