List agents

以 Markdown 格式查看

List agents with optional filters (status, departmentId, projectId, unassigned, environment, search) and sorting (sortBy=name|createdAt, sortDir=asc|desc). projectId and unassigned are mutually exclusive. When Collector is configured, period cost/requests/tokens and meta.costBreakdown are merged from GET /v1/analytics/saas/costs-by-entities with entityType=agent. Owner, admin, viewer.

请求头

Authorizationstring必需

Bearer {access_token}

X-Workspace-Idstring必需
Workspace UUID

查询参数

pageinteger可选默认为 1
Page number
pageSizeinteger可选默认为 20
Items per page
statusstring可选
active, inactive, archived
departmentIdstring可选
Department UUID
projectIdstring可选格式: "uuid"

Project UUID (mutually exclusive with unassigned)

unassignedboolean可选

Only agents without a project (mutually exclusive with projectId)

environmentstring可选
production, development, staging
searchstring可选

Search name/description

sortByenum可选默认为 createdAt
Sort field
允许的值:
sortDirenum可选默认为 desc
Sort direction
允许的值:

响应

data: list, meta: pagination

错误

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error