Skip to main content
POST
/
api
/
v1
/
projects
/
{projectId}
/
roles
cURL
curl --request POST \
  --url https://us.infisical.com/api/v1/projects/{projectId}/roles \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "slug": "<string>",
  "name": "<string>",
  "description": "<string>",
  "permissions": [
    "<any>"
  ]
}'
{
  "role": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "name": "<string>",
    "description": "<string>",
    "slug": "<string>",
    "permissions": [
      {
        "subject": "<string>",
        "action": "<string>",
        "conditions": "<any>",
        "inverted": true
      }
    ],
    "createdAt": "2023-11-07T05:31:56Z",
    "updatedAt": "2023-11-07T05:31:56Z",
    "projectId": "<string>",
    "version": 1
  }
}
You can read more about the permissions field in the permissions documentation.

Authorizations

Authorization
string
header
required

An access token in Infisical

Path Parameters

projectId
string
required

Id of the project to create the role for.

Body

application/json
slug
string
required

The slug of the role.

Required string length: 1 - 64
name
string
required

The name of the role.

Minimum length: 1
permissions
object[]
required

The permissions assigned to the role.

  • Option 1
  • Option 2
  • Option 3
  • Option 4
  • Option 5
  • Option 6
  • Option 7
  • Option 8
  • Option 9
  • Option 10
  • Option 11
  • Option 12
  • Option 13
  • Option 14
  • Option 15
  • Option 16
  • Option 17
  • Option 18
  • Option 19
  • Option 20
  • Option 21
  • Option 22
  • Option 23
  • Option 24
  • Option 25
  • Option 26
  • Option 27
  • Option 28
  • Option 29
  • Option 30
  • Option 31
  • Option 32
  • Option 33
  • Option 34
  • Option 35
  • Option 36
  • Option 37
  • Option 38
  • Option 39
  • Option 40
  • Option 41
  • Option 42
  • Option 43
  • Option 44
  • Option 45
  • Option 46
description
string | null

The description for the role.

Response

Default Response

role
object
required