List Roles
GEThttps://api.confident-ai.com/v2/projects/{projectId}/roles
Lists every role a member of this project can be given: the custom roles the project owns, plus the global, system-defined roles (projectId is null) that every project can assign. Each role is returned with the project policies attached to it, which is where its permissions come from — a global role's permissions are system-defined instead, so it comes back with an empty policies array. Project roles govern access inside this project only; access to organization-wide settings comes from the member's organization role.
curl -X GET "https://api.confident-ai.com/v2/projects/{projectId}/roles" \
-H "CONFIDENT_API_KEY: <ORGANIZATION-API-KEY>"{
"success": true,
"data": {
"roles": [
{
"id": "<ROLE-ID>",
"name": "Release Manager",
"description": "Can publish prompts and run evaluations, but not delete data.",
"policies": [
{
"id": "<POLICY-ID>",
"name": "Billing read-only"
}
],
"projectId": "<PROJECT-ID>"
}
]
},
"deprecated": false
}Headers
CONFIDENT_API_KEYstringRequiredThe organization API key for your Confident AI organization.
Path parameters
projectIdstringRequiredThe id of the project, which must belong to your organization.
Response
List Roles succeeded.
successbooleanIndicates if the request was successful.
dataobjectEvery project role a member can be given in this project, owned and global together.
Show 1 propertyHide 1 property
roleslist of objectsThe roles this project can assign: the roles it owns, plus the global, system-defined roles available to every project.
Show 5 propertiesHide 5 properties
idstringThe id of the role, generated by Confident AI.
namestringThe name of the role.
descriptionstring | nullWhat the role is for, or null when it has no description.
policieslist of objectsThe project policies attached to the role, whose permissions together are everything a member holding it can do in the project. A global role's permissions are system-defined rather than drawn from policies, so its list is empty.
Show 2 propertiesHide 2 properties
idstringThe id of the policy, generated by Confident AI.
namestringThe name of the policy.
projectIdstring | null
deprecatedbooleanIndicates if this endpoint is deprecated.