For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Trust CenterStatusSupportGet a demoPlatform
DocumentationEvals API ReferenceIntegrations & OTELPlatform SettingsSelf-HostingGuidesChangelog
DocumentationEvals API ReferenceIntegrations & OTELPlatform SettingsSelf-HostingGuidesChangelog
  • Get Started
    • Introduction
    • Quickstart
    • Authentication
    • Data Models
    • API Conventions
  • Data Models
      • GETList Projects
      • POSTCreate Project
      • GETRetrieve Project
      • PUTUpdate Project
      • DELDelete Project
        • GETList Project Policies
        • POSTCreate Project Policy
        • PUTUpdate Project Policy
        • DELDelete Project Policy
  • Evals
  • Legacy
LogoLogo
Trust CenterStatusSupportGet a demoPlatform
Data ModelsProjectsPolicies

Create Project Policy

POST
https://api.confident-ai.com/v1/projects/:projectId/policies
POST
/v1/projects/:projectId/policies
$curl -X POST https://api.confident-ai.com/v1/projects/projectId/policies \
> -H "CONFIDENT_API_KEY: <ORGANIZATION-API-KEY>" \
> -H "Content-Type: application/json" \
> -d '{
> "name": "View traces",
> "permissionIds": [
> "perm-uuid-1"
> ],
> "description": "Grants read access to traces"
>}'
200Successful
1{
2 "success": true,
3 "data": {
4 "policy": {
5 "id": "policy-uuid-1",
6 "name": "View traces",
7 "description": "Grants read access to traces",
8 "permissions": [
9 {
10 "id": "perm-uuid-1",
11 "name": "trace:read"
12 }
13 ]
14 }
15 }
16}

Creates a custom project policy from a set of permissions. Use GET /v1/organization/permissions to discover assignable permission ids.

Was this page helpful?
Previous

Update Project Policy

Next
Built with

Path parameters

projectIdstringRequired
The unique identifier of the project.

Headers

CONFIDENT_API_KEYstringRequired
The organization API key for your Confident AI organization.

Request

This endpoint expects an object.
namestringRequired
Name of the policy
permissionIdslist of stringsRequired
The ids of the permissions granted by this policy
descriptionstring or nullOptional
Optional description of the policy

Response

successboolean
Indicates if the request was successful
dataobject