Project Roles
Create
Overview
- Introduction
- Authentication
- Examples
Endpoints
- Identities
- Universal Auth
- Organizations
- Projects
- Project Users
- Project Identities
- Project Roles
- Environments
- Folders
- Secret Tags
- Secrets
- Secret Imports
- Identity Specific Privilege
- Integrations
- Service Tokens
- Audit Logs
- Certificate Authorities
- Certificates
Project Roles
Create
Create a project role
POST
/
api
/
v1
/
workspace
/
{projectSlug}
/
roles
curl --request POST \
--url https://app.infisical.com/api/v1/workspace/{projectSlug}/roles \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"slug": "<string>",
"name": "<string>",
"description": "<string>",
"permissions": [
{
"action": "read",
"subject": "role",
"conditions": {
"environment": "<string>",
"secretPath": {
"$glob": "<string>"
}
}
}
]
}'
{
"role": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"slug": "<string>",
"permissions": [
{
"subject": "<string>",
"action": "<string>",
"conditions": {
"environment": "<string>",
"secretPath": {
"$glob": "<string>"
}
}
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"projectId": "<string>"
}
}
Authorizations
An access token in Infisical
Path Parameters
Slug of the project to create the role for.
Body
application/json
The slug of the role.
Minimum length:
1
The name of the role.
Minimum length:
1
The permissions assigned to the role.
Describe what action an entity can take. Possible actions: create, edit, delete, and read
Available options:
read
, create
, edit
, delete
The entity this permission pertains to. Possible options: secrets, environments
Available options:
role
, member
, groups
, settings
, integrations
, webhooks
, service-tokens
, environments
, tags
, audit-logs
, ip-allowlist
, workspace
, secrets
, secret-rollback
, secret-approval
, secret-rotation
, identity
, certificate-authorities
, certificates
When specified, only matching conditions will be allowed to access given resource.
The description for the role.
Response
200 - application/json
Default Response
Was this page helpful?
curl --request POST \
--url https://app.infisical.com/api/v1/workspace/{projectSlug}/roles \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"slug": "<string>",
"name": "<string>",
"description": "<string>",
"permissions": [
{
"action": "read",
"subject": "role",
"conditions": {
"environment": "<string>",
"secretPath": {
"$glob": "<string>"
}
}
}
]
}'
{
"role": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"slug": "<string>",
"permissions": [
{
"subject": "<string>",
"action": "<string>",
"conditions": {
"environment": "<string>",
"secretPath": {
"$glob": "<string>"
}
}
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"projectId": "<string>"
}
}