Launch Week 02 wrapped — explore all five launches

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

POST/v1/organization/governance-policies/{policyId}/assign
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"
  ]
}'
200
{
  "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_KEYstringRequired

    The organization API key for your Confident AI organization.

Path parameters

  • policyIdstringRequired

    The unique identifier of the governance policy.

Request body

  • projectIdslist of stringsRequired

    The ids of the projects to assign or unassign.

Response

  • successboolean

    Indicates if the request was successful

  • dataobject

    Show 4 propertiesHide 4 properties
    • governancePolicyobject

      The governance policy that was modified.

      Show 2 propertiesHide 2 properties
      • idstring

        The unique identifier of the governance policy.

      • namestring

        The name of the governance policy.

    • assignedProjectIdslist of strings

      Ids of the projects now assigned to this policy, including any that were already enrolled.

    • notFoundProjectIdslist of strings

      Ids that do not exist in this organization. They are skipped (not assigned) and reported here rather than failing the request.

    • countinteger

      The number of projects now assigned (the length of assignedProjectIds).

Built byConfident AI