Introducing confident-trace — our new tracing SDK

Assign Projects to Governance Policy

(v1)

POST

Assigns one or more projects to a governance policy, moving any that are already on a different policy. This is a partial-success operation: assigned ids are returned in assignedProjectIds, unknown ids in notFoundProjectIds, and count is the number now assigned.

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