ClouisleClouisle

Admin API Reference

Admin panel endpoint groups, permission codes, and usage boundaries

Admin routes are mounted under /api/v1/admin and cover dashboards, observability, audit logs, conversations, users, roles, permissions, site settings, models, SSO, notifications, teams, memory, Agents, tools, Skills, workflows, workflow metrics, TOTP, packages, knowledge bases, and messaging deliveries. They are used by the admin panel and return the unified code/data/msg envelope. They are not public APIs for anonymous calls.

Permission Model

Every endpoint declares the permission code it requires (admin:* or audit:*) through a dependency:

  • Superusers bypass everything: an account with is_superuser skips all permission-code checks.
  • Everyone else is judged by permission code: the account must hold the endpoint's declared code through a role. Codes come from the system permission definitions synced at startup and can be freely combined in roles (see /api/v1/admin/roles and /api/v1/admin/permissions).
  • API Keys carry the same checks: an API Key is validated against its bound user's permission set, so never grant an API Key unnecessary admin:* permissions.
  • Knowledge bases are the exception: /api/v1/admin/knowledge-bases reuses the platform knowledge-base routes, but switches the required code to admin:knowledge-base:{read,test,create,update,delete} based on the request path prefix and skips team-membership checks so the admin view can work across teams.

Authorization is enforced server-side. Hiding a menu entry in the UI is not a security boundary; third-party integrations must request the minimum permission codes.

Groups and Permission Codes

GroupMounted prefixPermission codes
Dashboard/api/v1/admin/dashboardadmin:dashboard:access
Observability/api/v1/admin/observabilityadmin:dashboard:access
Audit logs/api/v1/admin/audit-logsaudit:read (queries), audit:export (export, archive)
Conversations/api/v1/admin/conversationsadmin:conversation:read, admin:conversation:delete
Users/api/v1/admin/usersadmin:user:read, admin:user:create, admin:user:update, admin:user:delete
Roles/api/v1/admin/rolesadmin:role:read, admin:role:create, admin:role:update, admin:role:delete
Permissions/api/v1/admin/permissionsadmin:permission:read, admin:permission:create, admin:permission:update, admin:permission:delete
Site settings/api/v1/admin/site-settingsadmin:settings:read, admin:settings:update (archiving audit logs additionally needs audit:export)
Models/api/v1/admin/modelsadmin:model:read, admin:model:create, admin:model:update, admin:model:delete
Integrations/api/v1/admin/integrationsadmin:integrations:login:read/update (login domain), admin:integrations:settings:read/update (builtin-config domain)
Notifications/api/v1/admin/notificationsadmin:notification:create (create), admin:notification:delete (delete); listing narrows to global admin access or an authorized team
Messaging deliveries/api/v1/admin/deliveriesadmin:integrations:settings:read (read-only)
Teams/api/v1/admin/teamsadmin:team:read, admin:team:create, admin:team:delete
Memories/api/v1/admin/memoriesadmin:memory:read, admin:memory:update, admin:memory:delete
Agents/api/v1/admin/agentsadmin:app:read, admin:app:create, admin:app:update, admin:app:delete, admin:app:publish, admin:app:duplicate
Tools/api/v1/admin/toolsadmin:capability:read, admin:capability:create, admin:capability:update, admin:capability:delete, admin:capability:execute
Skills/api/v1/admin/skillsadmin:capability:read, admin:capability:create, admin:capability:update, admin:capability:delete, admin:capability:execute
Workflows/api/v1/admin/workflowsadmin:app:read, admin:app:create, admin:app:update, admin:app:delete, admin:app:publish, admin:app:duplicate
Workflow metrics/api/v1/admin/workflows/metricsadmin:dashboard:access (clearing the cache needs admin:settings:update)
TOTP/api/v1/admin/totpadmin:dashboard:access
Packages/api/v1/admin/packagesRequires an authenticated user (import/export validate against each resource's own access rules)
Knowledge bases/api/v1/admin/knowledge-basesadmin:knowledge-base:read, admin:knowledge-base:test, admin:knowledge-base:create, admin:knowledge-base:update, admin:knowledge-base:delete

The Agents and Workflows groups share the same admin:app:* codes, and Tools and Skills share the same admin:capability:* codes. Granting one group therefore affects the other.

Common Endpoints

MethodPathPurpose
GET/api/v1/admin/dashboard/statsSystem-wide totals (users, teams, Agents, workflows, conversations, tokens)
GET/api/v1/admin/dashboard/stats/trendsSystem growth trends
GET/api/v1/admin/observability/overviewRuntime observability overview
GET/api/v1/admin/observability/timeoutsTimeout statistics
GET/api/v1/admin/audit-logsPaginated audit-log query
GET/api/v1/admin/audit-logs/exportExport audit logs
GET/api/v1/admin/rolesList roles
PUT/api/v1/admin/roles/{role_id}/permissionsReplace a role's permission set
GET/api/v1/admin/permissions/scopesList permission scope options
GET/api/v1/admin/users/statsUser statistics
POST/api/v1/admin/users/{user_id}/deactivateDeactivate a user
GET/api/v1/admin/teamsList all teams
GET/api/v1/admin/memories/entitiesList memory entities
GET/api/v1/admin/memories/relationsList memory relations
GET/api/v1/admin/agents/filtersAgent filter options
POST/api/v1/admin/agents/{agent_id}/publishPublish an Agent
GET/api/v1/admin/tools/configList global tool configurations
GET/api/v1/admin/skills/filtersSkill filter options
GET/api/v1/admin/workflows/filtersWorkflow filter options
GET/api/v1/admin/totp/statsTOTP usage statistics
GET/api/v1/admin/notificationsAdmin-view notification list
GET/api/v1/admin/deliveriesFeishu/WeChat Agent-chat outbound delivery records
GET/api/v1/admin/knowledge-basesCross-team knowledge-base list

Workflow Metrics

Workflow execution metrics are not under /api/v1/workflows; they live under the admin prefix at /api/v1/admin/workflows/metrics/*. The router carries its own /workflows/metrics prefix, so it coexists with the /api/v1/admin/workflows CRUD routes without colliding.

MethodPathPurposePermission
GET/api/v1/admin/workflows/metrics/dashboardMetrics dashboard summary (includes running workflows)admin:dashboard:access
GET/api/v1/admin/workflows/metrics/workflows/{workflow_id}Execution metrics for one workflowadmin:dashboard:access
GET/api/v1/admin/workflows/metrics/nodesMetrics for every node typeadmin:dashboard:access
GET/api/v1/admin/workflows/metrics/nodes/{node_type}Metrics for one node typeadmin:dashboard:access
GET/api/v1/admin/workflows/metrics/runningCurrently running workflowsadmin:dashboard:access
GET/api/v1/admin/workflows/metrics/cacheMetrics cache statisticsadmin:dashboard:access
DELETE/api/v1/admin/workflows/metrics/cacheClear the metrics cacheadmin:settings:update
curl -X GET "https://your-domain.com/api/v1/admin/workflows/metrics/dashboard" \
  -H "Authorization: Bearer YOUR_ADMIN_TOKEN"

Messaging Delivery Log

GET /api/v1/admin/deliveries reads the durable outbound queue integration_deliveries shared by Feishu and WeChat Agent chat. It is read-only and requires admin:integrations:settings:read; superusers bypass the check. Message text, provider resource keys (media_key), credentials, and file contents are never returned. The admin panel's Monitoring > Delivery log (/deliveries) page uses the same endpoint.

sent only means the provider accepted the reply request; it does not mean the recipient read the message, opened a card, or downloaded an artifact.

Query parameters

ParameterTypeRequiredDefaultDescription
provider_typerepeated feishu / wechatNo-Filter by integration; repeating the parameter matches any listed value (OR)
statusrepeated pending / sending / sent / error / unavailable / unknownNo-Filter by delivery state; repeating the parameter matches any listed value (OR)
run_idstring (UUID)No-Exact filter on the originating AgentRun
filenamestring (1–500)No-Case-insensitive substring filter on artifact file names
limitinteger (1–100)No25Page size
offsetinteger (≥ 0)No0Page offset

Values inside provider_type and inside status are ORed; the two filters are combined with AND. The response is {items, total, limit, offset}, ordered by created_at and id descending.

curl -X GET "https://your-domain.com/api/v1/admin/deliveries?provider_type=feishu&provider_type=wechat&status=error&status=unknown&limit=25&offset=0" \
  -H "Authorization: Bearer YOUR_ADMIN_TOKEN"
{
  "code": 0,
  "data": {
    "items": [
      {
        "id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
        "provider_type": "feishu",
        "run_id": "1c2f1a2e-0f4e-4a8f-9d4a-2b0d7b3dcb6d",
        "user_id": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
        "agent_id": "550e8400-e29b-41d4-a716-446655440000",
        "chat_id": "oc_xxx",
        "message_id": "om_xxx",
        "event_key": "final-asset",
        "sequence": 0,
        "kind": "asset",
        "filename": "report.pdf",
        "content_type": "application/pdf",
        "size": 12345,
        "media_type": "file",
        "status": "error",
        "error": "feishu_agent_asset_upload_failed",
        "error_detail": "FeishuAPIError: Feishu API error 234001: Invalid request param. | HTTP 400 | code 234001 | {...}",
        "has_media_key": false,
        "created_at": "2026-10-22T10:03:13Z",
        "updated_at": "2026-10-22T10:03:13Z"
      }
    ],
    "total": 1,
    "limit": 25,
    "offset": 0
  },
  "msg": "success"
}

States

StateMeaning
pendingQueued, not yet claimed by a sender; preserved across restarts and feature pauses
sendingClaimed by one worker under a lease; an expired lease becomes unknown and is never resent automatically
sentThe provider accepted the reply request
errorA permanent failure, such as a provider rejection or unavailable artifact
unavailableThe run finished but the reply must not be sent (channel disabled, access revoked, missing conversation context)
unknownA timeout after transmission; the result is uncertain and must not be resent blindly

Fields and errors

FieldTypeDescription
idstring (UUID)Delivery row ID
provider_typestringfeishu or wechat
run_id / user_id / agent_idstring (UUID) | nullOriginating AgentRun, connected user, Agent
chat_id / message_idstring | nullProvider conversation ID / message ID
event_keystringEvent key, such as received, final, final-asset, or ask:<tool-call>
sequenceintegerChunk order within the same event
kindstringtext, markdown, asset, and so on
filename / content_type / sizestring / string / integer | nullArtifact name, MIME type, and size in bytes
media_typestring | nullProvider media type
statusstringOne of the states above
errorstring | nullStable failure key used for behaviour and localization
error_detailstring | nullProvider's original error: message, HTTP status, code, and response excerpt
has_media_keybooleanWhether a provider resource key is stored; the key itself is never returned
created_at / updated_atstring (ISO 8601)Creation and last update timestamps

error is a stable machine-readable key (for example feishu_agent_asset_upload_failed); error_detail preserves the provider's original text, HTTP status, and code so operators can diagnose permissions, parameters, or size limits.

Not the notification delivery table

GET /api/v1/admin/deliveries and integration_deliveries cover only Feishu/WeChat Agent chat. In-app notifications sent externally through email / webhook / feishu are recorded in notification_deliveries and read through deliveries[] on the notification admin APIs. WeChat is not a notification channel.

Upgrade relationship

The single table integration_deliveries replaces the former feishu_agent_deliveries and wechat_agent_deliveries. On first startup the API copies rows from the old tables and drops them, so the API, every worker, and Beat must run matching versions; an older process would write to a dropped table. Restoring the old image alone cannot recreate the queue table; rolling back requires the database backup taken before the upgrade.

Page behaviour, filters, and troubleshooting are documented in the Delivery log.

Request Example

curl -X GET "https://your-domain.com/api/v1/admin/users?page=1&page_size=20" \
  -H "Authorization: Bearer YOUR_ADMIN_TOKEN"

Integration Guidance

  • Third-party apps should prefer the Agent, workflow, conversation, and knowledge base resource endpoints over admin endpoints.
  • Admin automation must pin the Clouisle version, record the required permission codes, and check the OpenAPI Schema before upgrading.
  • Audit and user management operations contain sensitive data; use short-lived keys together with minimal rate limits.
  • Grant admin:* only when cross-team operations are genuinely required; day-to-day work should use team roles with platform permissions such as workflow:read or kb:read.

Common Errors

HTTP / codeMeaning
401 / 2000Authentication is missing
403 / 3000The required permission code is missing
404 / 4000Resource does not exist
1001Request validation failed

Last Updated: 2026-09-26

How is this guide?

On this page