Skip to content

Update an AI grant.

PUT
/api/admin/ai-grants/{id}
Code sample: Shell / cURL
curl --request PUT \
--url https://auth.example.com/api/admin/ai-grants/example \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "scopes": "ai:read", "is_active": true, "expires_at": 1770007200 }'

Updates scopes, scope targets, expiration, or active state for an existing AI grant after validating allowed AI scopes and expiration bounds.

id
required
string

AI grant id.

Media type application/json
object
>= 1 properties
scopes
string
scope_targets
object | array | null
expires_at
integer | null format: int64
is_active
boolean
key
additional properties
Example
{
"scopes": "ai:read",
"is_active": true,
"expires_at": 1770007200
}

AI grant detail response.

Media type application/json
object
grant
required
object
id
required
string
tenant_id
required
string
client_id
required
string
ai_principal
required
string
scopes
required

Space-separated AI scopes.

string
scope_targets
object | array | null
is_active
required
boolean
expires_at
integer | null format: int64
created_by
string | null
created_at
required
integer format: int64
updated_at
required
integer format: int64
revoked_at
integer | null format: int64
revoked_by
string | null
key
additional properties
key
additional properties
Example
{
"grant": {
"id": "grant_123",
"tenant_id": "default",
"client_id": "client_123",
"ai_principal": "assistant:billing-agent",
"scopes": "ai:read ai:execute",
"scope_targets": {
"projects": [
"proj_123"
]
},
"is_active": true,
"expires_at": 1770007200,
"created_by": "admin_123",
"created_at": 1770000000,
"updated_at": 1770000000,
"revoked_at": null,
"revoked_by": null
}
}

Error response.

Media type application/json
object
error
string
message
string
error_description
string
key
additional properties
Example generated
{
"error": "example",
"message": "example",
"error_description": "example"
}

Error response.

Media type application/json
object
error
string
message
string
error_description
string
key
additional properties
Example generated
{
"error": "example",
"message": "example",
"error_description": "example"
}

Error response.

Media type application/json
object
error
string
message
string
error_description
string
key
additional properties
Example generated
{
"error": "example",
"message": "example",
"error_description": "example"
}

Error response.

Media type application/json
object
error
string
message
string
error_description
string
key
additional properties
Example generated
{
"error": "example",
"message": "example",
"error_description": "example"
}