Launch Week 02 wrapped — explore all five launches

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.

POST/v2/organization/governance-policies/{policyId}/assign
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>"
  ]
}'
200
{
  "success": true,
  "data": {
    "governancePolicy": {
      "id": "<GOVERNANCE-POLICY-ID>",
      "name": "EU AI Act readiness"
    },
    "assignedProjectIds": [
      "<PROJECT-ID>"
    ],
    "notFoundProjectIds": [],
    "count": 1
  },
  "deprecated": false
}

Headers

  • CONFIDENT_API_KEYstringRequired

    The organization API key for your Confident AI organization.

Path parameters

  • policyIdstringRequired

    The id of the governance policy.

Request body

  • projectIdslist of stringsRequired

    The 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.

  • successboolean

    Indicates if the request was successful.

  • dataobject

    The 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
    • governancePolicyobject

      A governance policy, named by id.

      Show 2 propertiesHide 2 properties
      • idstring

        The id of the governance policy.

      • namestring

        The name of the governance policy.

    • assignedProjectIdslist of strings

      The ids of the projects now enrolled in this policy, including any that were already enrolled before the call.

    • notFoundProjectIdslist of strings

      The ids that name no project in this organization. They are skipped and reported here rather than failing the whole request.

    • countinteger

      How many projects are now enrolled, the length of assignedProjectIds.

  • deprecatedboolean

    Indicates if this endpoint is deprecated.

Built byConfident AI