Update Policy
PUThttps://api.confident-ai.com/v2/projects/{projectId}/policies/{policyId}
Replaces a project policy's name, description, and granted permissions. The change reaches people through the roles the policy is attached to, and it reaches them immediately: permissions are resolved from the role on each request, so every member holding any of those roles gains or loses the affected permissions on their next call. permissionIds is the policy's complete permission set rather than an addition to it, so sending an empty array makes the policy grant nothing.
curl -X PUT "https://api.confident-ai.com/v2/projects/{projectId}/policies/{policyId}" \
-H "CONFIDENT_API_KEY: <ORGANIZATION-API-KEY>" \
-H "Content-Type: application/json" \
-d '{
"name": "Billing read-only",
"description": "Lets a role read invoices and model costs, but change neither.",
"permissionIds": [
"<PERMISSION-ID>"
]
}'{
"success": true,
"data": {
"id": "<POLICY-ID>",
"name": "Billing read-only",
"description": "Lets a role read invoices and model costs, but change neither.",
"permissions": [
{
"id": "<PERMISSION-ID>",
"name": "billing:read"
}
]
},
"deprecated": false
}Headers
CONFIDENT_API_KEYstringRequiredThe organization API key for your Confident AI organization.
Path parameters
projectIdstringRequiredThe id of the project the policy belongs to.
policyIdstringRequiredThe id of the project policy.
Request body
namestringRequiredThe name of the policy, unique within the organization or project that owns it. It is what identifies the policy when attaching it to a role.
descriptionstring | nullWhat the policy is for. On an update, omit it to leave the stored description unchanged, or send null to clear it.
permissionIdslist of stringsRequiredThe ids of the permissions this policy grants. This is the policy's complete permission set: on an update the list replaces what is stored rather than adding to it, and an empty array leaves the policy granting nothing. Discover assignable ids with the permissions endpoint of the same scope; an id from the other scope's catalog is stored but never matches a permission check here.
Response
Update Policy succeeded.
successbooleanIndicates if the request was successful.
dataobjectA named set of permissions owned by an organization or by a project. A policy is attached to roles of the same scope, never to a member directly, so it only grants anything once a role that holds it is assigned to someone.
Show 4 propertiesHide 4 properties
idstringThe id of the policy, generated by Confident AI.
namestringThe name of the policy.
descriptionstring | nullWhat the policy is for, or null when it has no description.
permissionslist of objectsThe permissions this policy grants.
Show 2 propertiesHide 2 properties
idstringThe id of the permission, generated by Confident AI.
namestringThe permission, written as
resource:action— the resource it applies to, then what it allows on it.
deprecatedbooleanIndicates if this endpoint is deprecated.