控制台 API: admin-system
本页由 server/api/openapi.yaml 生成,内容为英文,请勿手工修改。
Settings, audit log, risk. Handlers: internal/admin/system.
GET /api/v1/admin/settings
Section titled “GET /api/v1/admin/settings”List runtime settings
operationId adminListSettings · auth: adminSession
| Status | Meaning | Body |
|---|---|---|
| 200 | OK | application/json SettingList |
| default | Error envelope. The HTTP status follows the error kind. | application/json Error |
Response 200 application/json — SettingList
data(array of Setting, required)key(string, required)type(“int” | “bool” | “string” | “json”, required)description(string, required)value(any, required) — Current value (any JSON).default_value(any, required) — Compiled-in default (any JSON).is_default(boolean, required)updated_by(string, required, nullable) updated_at(string, required, nullable)
PUT /api/v1/admin/settings/{key}
Section titled “PUT /api/v1/admin/settings/{key}”Set a runtime setting
operationId adminSetSetting · auth: adminSession
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
key |
path | string | yes |
Request body (required) application/json — SetSettingRequest
value(any, required) — Any JSON value matching the setting’s type.
| Status | Meaning | Body |
|---|---|---|
| 200 | OK | application/json Setting |
| default | Error envelope. The HTTP status follows the error kind. | application/json Error |
Response 200 application/json — Setting
key(string, required)type(“int” | “bool” | “string” | “json”, required)description(string, required)value(any, required) — Current value (any JSON).default_value(any, required) — Compiled-in default (any JSON).is_default(boolean, required)updated_by(string, required, nullable) updated_at(string, required, nullable)
GET /api/v1/admin/audit-log
Section titled “GET /api/v1/admin/audit-log”Audit trail
operationId adminListAuditLog · auth: adminSession
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
actor_user_id |
query | string<uuid> | no | |
org_id |
query | string<uuid> | no | |
action |
query | string | no | Exact, or a prefix when it ends with a dot. |
target_type |
query | string | no | |
target_id |
query | string | no | |
from |
query | string<date-time> | no | Inclusive lower bound. |
to |
query | string<date-time> | no | Exclusive upper bound. |
cursor |
query | string | no | Opaque cursor from a previous page’s next_cursor. |
limit |
query | integer<int32> | no | (minimum: 1, maximum: 200, default: 50) |
| Status | Meaning | Body |
|---|---|---|
| 200 | OK | application/json AuditEntryPage |
| default | Error envelope. The HTTP status follows the error kind. | application/json Error |
Response 200 application/json — AuditEntryPage
data(array of AuditEntry, required)id(string, required) actor_type(“user” | “admin” | “system”, required)actor_user_id(string, required, nullable) actor_email(string, required)org_id(string, required, nullable) action(string, required) —<resource>.<verb>, e.g. channel.update.target_type(string, required)target_id(string, required)request_id(string, required)ip(string, required)user_agent(string, required)before(any, required, nullable) — Snapshot of the changed fields before (any JSON, may be null).after(any, required, nullable) — Snapshot after (any JSON, may be null).created_at(string, required)
next_cursor(string, required, nullable) — Pass ascursorto fetch the next page; null on the last page.has_more(boolean, required)
GET /api/v1/admin/risk/events
Section titled “GET /api/v1/admin/risk/events”Risk events
operationId adminListRiskEvents · auth: adminSession
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
org_id |
query | string<uuid> | no | |
kind |
query | RiskEventKind | no | |
cursor |
query | string | no | Opaque cursor from a previous page’s next_cursor. |
limit |
query | integer<int32> | no | (minimum: 1, maximum: 200, default: 50) |
| Status | Meaning | Body |
|---|---|---|
| 200 | OK | application/json RiskEventPage |
| default | Error envelope. The HTTP status follows the error kind. | application/json Error |
Response 200 application/json — RiskEventPage
data(array of RiskEvent, required)id(string, required) kind(RiskEventKind, required)severity(“info” | “warning” | “critical”, required)org_id(string, required, nullable) user_id(string, required, nullable) ip(string, required)action(string, required)detail(object, required)created_at(string, required)
next_cursor(string, required, nullable) — Pass ascursorto fetch the next page; null on the last page.has_more(boolean, required)
GET /api/v1/admin/risk/tiers
Section titled “GET /api/v1/admin/risk/tiers”Trust tiers
operationId adminListTrustTiers · auth: adminSession
| Status | Meaning | Body |
|---|---|---|
| 200 | OK | application/json TrustTierList |
| default | Error envelope. The HTTP status follows the error kind. | application/json Error |
Response 200 application/json — TrustTierList
data(array of TrustTier, required)tier(integer, required) name(string, required)min_settled_topup_cents(integer, required) — Promotion threshold: lifetime settled top-ups. min_account_age_days(integer, required) max_topup_cents(integer, required, nullable) — Null = unlimited. max_topup_cents_per_day(integer, required, nullable) max_spend_per_day_nano(string, required, pattern: ”^-?[0-9]+$”, nullable) — Nano-USD as a decimal integer string; null when not set.limits(RateLimits, required) — Rate limits; 0 means unlimited for that dimension.rpm(integer, required) — Requests per minute. tpm(integer, required) — Tokens per minute. concurrency(integer, required) — Simultaneous in-flight requests.
auto_recharge_allowed(boolean, required)
PUT /api/v1/admin/risk/tiers/{tier}
Section titled “PUT /api/v1/admin/risk/tiers/{tier}”Replace a trust tier’s parameters
operationId adminUpdateTrustTier · auth: adminSession
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
tier |
path | integer<int32> | yes |
Request body (required) application/json — TrustTierInput
name(string, required)min_settled_topup_cents(integer, required) — Promotion threshold: lifetime settled top-ups. min_account_age_days(integer, required) max_topup_cents(integer, required, nullable) — Null = unlimited. max_topup_cents_per_day(integer, required, nullable) max_spend_per_day_nano(string, required, pattern: ”^-?[0-9]+$”, nullable) — Nano-USD as a decimal integer string; null when not set.limits(RateLimits, required) — Rate limits; 0 means unlimited for that dimension.rpm(integer, required) — Requests per minute. tpm(integer, required) — Tokens per minute. concurrency(integer, required) — Simultaneous in-flight requests.
auto_recharge_allowed(boolean, required)
| Status | Meaning | Body |
|---|---|---|
| 200 | OK | application/json TrustTier |
| default | Error envelope. The HTTP status follows the error kind. | application/json Error |
Response 200 application/json — TrustTier
tier(integer, required) name(string, required)min_settled_topup_cents(integer, required) — Promotion threshold: lifetime settled top-ups. min_account_age_days(integer, required) max_topup_cents(integer, required, nullable) — Null = unlimited. max_topup_cents_per_day(integer, required, nullable) max_spend_per_day_nano(string, required, pattern: ”^-?[0-9]+$”, nullable) — Nano-USD as a decimal integer string; null when not set.limits(RateLimits, required) — Rate limits; 0 means unlimited for that dimension.rpm(integer, required) — Requests per minute. tpm(integer, required) — Tokens per minute. concurrency(integer, required) — Simultaneous in-flight requests.
auto_recharge_allowed(boolean, required)
GET /api/v1/admin/risk/blocked-domains
Section titled “GET /api/v1/admin/risk/blocked-domains”Blocked email domains
operationId adminListBlockedDomains · auth: adminSession
| Status | Meaning | Body |
|---|---|---|
| 200 | OK | application/json BlockedDomainList |
| default | Error envelope. The HTTP status follows the error kind. | application/json Error |
Response 200 application/json — BlockedDomainList
data(array of BlockedDomain, required)domain(string, required)
POST /api/v1/admin/risk/blocked-domains
Section titled “POST /api/v1/admin/risk/blocked-domains”Block an email domain
operationId adminBlockDomain · auth: adminSession
Request body (required) application/json — BlockedDomain
domain(string, required)
| Status | Meaning | Body |
|---|---|---|
| 201 | OK | application/json BlockedDomain |
| default | Error envelope. The HTTP status follows the error kind. | application/json Error |
Response 201 application/json — BlockedDomain
domain(string, required)
DELETE /api/v1/admin/risk/blocked-domains/{domain}
Section titled “DELETE /api/v1/admin/risk/blocked-domains/{domain}”Unblock an email domain
operationId adminUnblockDomain · auth: adminSession
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
domain |
path | string | yes |
| Status | Meaning | Body |
|---|---|---|
| 204 | Done. | — |
| default | Error envelope. The HTTP status follows the error kind. | application/json Error |
GET /api/v1/admin/retention
Section titled “GET /api/v1/admin/retention”Data retention status
operationId adminGetRetention · auth: adminSession
The retention settings in force and the usage partitions the retention job detached or dropped.
| Status | Meaning | Body |
|---|---|---|
| 200 | OK | application/json RetentionStatus |
| default | Error envelope. The HTTP status follows the error kind. | application/json Error |
Response 200 application/json — RetentionStatus
usage_records_days(integer, required) — Days usage records are kept (0 = forever). upstream_attempts_days(integer, required) — Days upstream attempt records are kept (0 = forever). drop_partitions(boolean, required) — False = old partitions are detached and kept as tables; true = dropped.account_erase_grace_days(integer, required) ledger_retention(“forever”, required) — Ledger partitions are never detached or dropped.partitions(array of RetentionPartition, required)part_name(string, required)parent(“usage_records” | “upstream_attempts”, required)range_start(string, required) range_end(string, required) state(“detached” | “dropped”, required)row_count(integer, required) cost_nano(NanoUSD, required, pattern: ”^-?[0-9]+$”) — An amount of money in nano-USD (1 USD = 1,000,000,000) as a decimal integer string. It is a string because an int64 does not survive JavaScript numbers. Never a float.detached_at(string, required) dropped_at(string, required, nullable)
GET /api/v1/admin/admin-roles
Section titled “GET /api/v1/admin/admin-roles”Operators, their roles and the permission table
operationId adminListAdminRoles · auth: adminSession
| Status | Meaning | Body |
|---|---|---|
| 200 | OK | application/json AdminRoleList |
| default | Error envelope. The HTTP status follows the error kind. | application/json Error |
Response 200 application/json — AdminRoleList
data(array of AdminRoleAssignment, required)user_id(string, required) email(string, required)role(AdminRole, required)granted_by(string, required, nullable) granted_at(string, required, nullable)
permissions(array of AdminOperationPermission, required) — Every admin operation and the roles that may call it (super is always listed).operation_id(string, required)roles(array of AdminRole, required)
PUT /api/v1/admin/admin-roles/{user_id}
Section titled “PUT /api/v1/admin/admin-roles/{user_id}”Set an operator’s role
operationId adminSetAdminRole · auth: adminSession
super (every admin operation; the default) or one of the restricted roles. Errors: 422 not_an_operator,
admin_role_self_change, last_super_admin.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
user_id |
path | string<uuid> | yes |
Request body (required) application/json — SetAdminRoleRequest
role(AdminRole, required)
| Status | Meaning | Body |
|---|---|---|
| 200 | OK | application/json AdminRoleAssignment |
| default | Error envelope. The HTTP status follows the error kind. | application/json Error |
Response 200 application/json — AdminRoleAssignment
user_id(string, required) email(string, required)role(AdminRole, required)granted_by(string, required, nullable) granted_at(string, required, nullable)