Update Member API Key
/enterprise/v1/sub-accounts/{subAccountId}/api-keys/{hash}status is required even for budget-only updates: ACTIVE or DISABLED. Optional name renames the key. allowedIps omitted/null keeps the list; [] clears it. Set spendLimitPresent=true to apply spendLimit, including null to remove the limit. Set limitResetPresent=true to apply limitReset, including null for lifetime. Without these flags, budget fields are not applied. Limits are USD and do not grant additional account funds.
Authentication
MANAGEMENT / PROVISIONING key with tenant:keys:write.
Authorization: Bearer <CONTROL_KEY>
Any subAccountId must belong to the authenticated enterprise. hash is a metadata identifier, never a raw key.
Approval and retries
Approval-enabled enterprises require Idempotency-Key and may receive HTTP 409 / APPROVAL_REQUIRED with data.operation.executed=false. Nothing has executed at that point. Other enterprises execute directly; do not assume arbitrary POST requests support idempotent retries.
Path parameters
subAccountIdstringrequired10-digit public member ID / 10 位成员编号
hashstringrequiredPublic key hash / 公开 Key hash
Request body
statusstringrequiredACTIVE | DISABLED
namestringKey name / Key 名称
allowedIpsstring[] | nullnull keeps current; [] clears / null 保持;[] 清空
spendLimitnumber | nullUSD > 0; null clears with presence flag / 美元正数,配合标志可传 null 清除
spendLimitPresentbooleantrue applies spendLimit / true 才应用 spendLimit
limitResetstring | nulldaily | weekly | monthly | null
limitResetPresentbooleantrue applies limitReset / true 才应用 limitReset
Fields use camelCase. Required and optional fields are described above.
1{
2 "status": "ACTIVE",
3 "spendLimit": 100,
4 "spendLimitPresent": true,
5 "limitReset": "monthly",
6 "limitResetPresent": true
7}Response
HTTP 200; code: 200. Values below are illustrative; fields use camelCase.
codeinteger200
dataobject | nulldata.hashstringdata.namestringdata.keyDisplaystringdata.workspaceCodestringdata.statusstringdata.allowedIpsarraydata.spendLimitnumberdata.limitResetstringdata.expiresAtstring | nulldata.createdAtstringErrors
Check both HTTP status and code; on failure inspect serviceCode, msg and traceId. Invalid credentials receive no data; missing scopes return API_KEY_SCOPE_DENIED. Cross-tenant resources are inaccessible. Acceptance or pending approval does not mean business completion.