Skip to main content
GET
/
api
/
v2
/
roles
List custom roles
curl --request GET \
  --url https://app.launchdarkly.com/api/v2/roles \
  --header 'Authorization: <api-key>'
{
  "items": [
    {
      "_id": "1234a56b7c89d012345e678f",
      "_links": {},
      "key": "example-custom-role",
      "name": "Example custom role",
      "policy": [
        {
          "effect": "allow",
          "resources": [
            "proj/*:env/*;qa_*:/flag/*"
          ],
          "notResources": [
            "<string>"
          ],
          "actions": [
            "*"
          ],
          "notActions": [
            "<string>"
          ]
        }
      ],
      "_access": {
        "denied": [
          {
            "action": "<string>",
            "reason": {
              "effect": "allow",
              "resources": [
                "proj/*:env/*;qa_*:/flag/*"
              ],
              "notResources": [
                "<string>"
              ],
              "actions": [
                "*"
              ],
              "notActions": [
                "<string>"
              ],
              "role_name": "<string>"
            }
          }
        ],
        "allowed": [
          {
            "action": "<string>",
            "reason": {
              "effect": "allow",
              "resources": [
                "proj/*:env/*;qa_*:/flag/*"
              ],
              "notResources": [
                "<string>"
              ],
              "actions": [
                "*"
              ],
              "notActions": [
                "<string>"
              ],
              "role_name": "<string>"
            }
          }
        ]
      },
      "description": "This custom role is just an example",
      "basePermissions": "reader",
      "resourceCategory": "<string>",
      "assignedTo": {
        "membersCount": 123,
        "teamsCount": 123
      },
      "_presetBundleVersion": 123,
      "_presetStatements": [
        {
          "effect": "allow",
          "resources": [
            "proj/*:env/*;qa_*:/flag/*"
          ],
          "notResources": [
            "<string>"
          ],
          "actions": [
            "*"
          ],
          "notActions": [
            "<string>"
          ]
        }
      ]
    }
  ],
  "_links": {},
  "totalCount": 123
}

Documentation Index

Fetch the complete documentation index at: https://launchdarkly-preview.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Query Parameters

limit
integer<int64>

The maximum number of custom roles to return. Defaults to 20.

offset
integer<int64>

Where to start in the list. Defaults to 0. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query limit.

Response

Custom roles collection response

items
object[]
required

An array of custom roles

The location and content type of related resources

totalCount
integer

The total number of custom roles