Assign Projects to Governance Policy
(v2)POST
Enrolls projects in a governance policy, so the controls it applies — its own and the ones it inherits — start gating them. A project belongs to at most one policy, so one currently on a different policy is moved here, and one already here is left as it is. Enrolling does not assess — call assess on the policy, or wait for the next scheduled run, for verdicts to appear.
curl -X POST "https://api.confident-ai.com/v2/organization/governance-policies/{policyId}/assign" \
-H "CONFIDENT_API_KEY: <ORGANIZATION-API-KEY>" \
-H "Content-Type: application/json" \
-d '{
"projectIds": [
"<PROJECT-ID>"
]
}'{
"success": true,
"data": {
"governancePolicy": {
"id": "<GOVERNANCE-POLICY-ID>",
"name": "EU AI Act readiness"
},
"assignedProjectIds": [
"<PROJECT-ID>"
],
"notFoundProjectIds": [],
"count": 1
},
"deprecated": false
}Headers
CONFIDENT_API_KEYstringRequiredThe organization API key for your Confident AI organization.
Path parameters
policyIdstringRequiredThe id of the governance policy.
Request body
projectIdslist of stringsRequiredThe ids of the projects to assign to, or unassign from, the governance policy. Send at least one. Ids the operation cannot act on are reported back rather than failing the request, so check the response's skipped list.
Response
Assign Projects to Governance Policy succeeded.
successbooleanIndicates if the request was successful.
dataobjectThe outcome of enrolling projects in a governance policy. This is a partial-success operation: every id that names a project in your organization is enrolled, and the rest come back in
notFoundProjectIds.Show 4 propertiesHide 4 properties
governancePolicyobjectA governance policy, named by id.
Show 2 propertiesHide 2 properties
idstringThe id of the governance policy.
namestringThe name of the governance policy.
assignedProjectIdslist of stringsThe ids of the projects now enrolled in this policy, including any that were already enrolled before the call.
notFoundProjectIdslist of stringsThe ids that name no project in this organization. They are skipped and reported here rather than failing the whole request.
countintegerHow many projects are now enrolled, the length of
assignedProjectIds.
deprecatedbooleanIndicates if this endpoint is deprecated.