Assign Projects
POSThttps://api.confident-ai.com/v2/organization/governance-policies/{policyId}/assign
Enrolls projects in a governance policy, so the controls it applies — its own and the ones it inherits — start gating them and get verdicts recorded against them. A project belongs to at most one policy, so a project currently on a different policy is moved to this one, and a project already on this one is left as it is. This is a partial-success operation: every id that names a project in your organization is enrolled and comes back in assignedProjectIds, while ids that name nothing come back in notFoundProjectIds instead of failing the request, so check that list rather than assuming the whole batch landed. Enrolling a project does not assess it — 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 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.