Create Project Policy
POSThttps://api.confident-ai.com/v1/projects/{projectId}/policies
Creates a custom project policy from a set of permissions. Use GET /v1/organization/permissions to discover assignable permission ids.
curl -X POST "https://api.confident-ai.com/v1/projects/{projectId}/policies" \
-H "CONFIDENT_API_KEY: <ORGANIZATION-API-KEY>" \
-H "Content-Type: application/json" \
-d '{
"name": "View traces",
"description": "Grants read access to traces",
"permissionIds": [
"perm-uuid-1"
]
}'{
"success": true,
"data": {
"policy": {
"id": "policy-uuid-1",
"name": "View traces",
"description": "Grants read access to traces",
"permissions": [
{
"id": "perm-uuid-1",
"name": "trace:read"
}
]
}
}
}Headers
CONFIDENT_API_KEYstringRequiredThe organization API key for your Confident AI organization.
Path parameters
projectIdstringRequiredThe unique identifier of the project.
Request body
namestringRequiredName of the policy
descriptionstringOptional description of the policy
permissionIdslist of stringsRequiredThe ids of the permissions granted by this policy
Response
successbooleanIndicates if the request was successful
dataobjectShow 1 propertyHide 1 property
policyobjectShow 4 propertiesHide 4 properties
idstringUnique identifier for the policy
namestringName of the policy
descriptionstringOptional description of the policy
permissionslist of objectsThe permissions granted by this policy
Show 2 propertiesHide 2 properties
idstringUnique identifier
namestringName