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 Roles
        • POSTCreate Project Role
        • PUTUpdate Project Role
        • DELDelete Project Role
  • Evals
  • Legacy
LogoLogo
Trust CenterStatusSupportGet a demoPlatform
Data ModelsProjectsRoles

Create Project Role

POST
https://api.confident-ai.com/v1/projects/:projectId/roles
POST
/v1/projects/:projectId/roles
$curl -X POST https://api.confident-ai.com/v1/projects/projectId/roles \
> -H "CONFIDENT_API_KEY: <ORGANIZATION-API-KEY>" \
> -H "Content-Type: application/json" \
> -d '{
> "name": "Analyst",
> "policyIds": [
> "policy-uuid-1"
> ],
> "description": "Read-only project access"
>}'
200Successful
1{
2 "success": true,
3 "data": {
4 "role": {
5 "id": "project-role-uuid-3",
6 "name": "Analyst",
7 "description": "Read-only project access",
8 "projectId": "PROJECT-ID",
9 "policies": [
10 {
11 "id": "policy-uuid-1",
12 "name": "View traces"
13 }
14 ]
15 }
16 }
17}

Creates a custom project role from a set of policies. The role name must be unique within the project and cannot collide with a system-defined role name.

Was this page helpful?
Previous

Update Project Role

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 role (must be unique within the organization and cannot be a system role name)

policyIdslist of stringsRequired
The ids of the policies to attach to this role
descriptionstring or nullOptional
Optional description of the role

Response

successboolean
Indicates if the request was successful
dataobject