Assign Projects to Governance Policy
POSThttps://api.confident-ai.com/v1/organization/governance-policies/{policyId}/assign
Assigns one or more projects to a governance policy. A project already on a different policy is moved to this one. This is a partial-success operation. Projects that exist are assigned and returned in assignedProjectIds, while ids that do not exist in the organization are reported in notFoundProjectIds instead of failing the request. count is the number now assigned (re-assigning an already-enrolled project still counts it).
curl -X POST "https://api.confident-ai.com/v1/organization/governance-policies/{policyId}/assign" \
-H "CONFIDENT_API_KEY: <ORGANIZATION-API-KEY>" \
-H "Content-Type: application/json" \
-d '{
"projectIds": [
"project-uuid-1",
"project-uuid-2"
]
}'{
"success": true,
"data": {
"governancePolicy": {
"id": "gov-policy-uuid-1",
"name": "Production Gate"
},
"assignedProjectIds": [
"project-uuid-1",
"project-uuid-2"
],
"notFoundProjectIds": [],
"count": 2
}
}Headers
CONFIDENT_API_KEYstringRequiredThe organization API key for your Confident AI organization.
Path parameters
policyIdstringRequiredThe unique identifier of the governance policy.
Request body
projectIdslist of stringsRequiredThe ids of the projects to assign or unassign.
Response
successbooleanIndicates if the request was successful
dataobjectShow 4 propertiesHide 4 properties
governancePolicyobjectThe governance policy that was modified.
Show 2 propertiesHide 2 properties
idstringThe unique identifier of the governance policy.
namestringThe name of the governance policy.
assignedProjectIdslist of stringsIds of the projects now assigned to this policy, including any that were already enrolled.
notFoundProjectIdslist of stringsIds that do not exist in this organization. They are skipped (not assigned) and reported here rather than failing the request.
countintegerThe number of projects now assigned (the length of assignedProjectIds).