v5

latestOpenAPI 3.0.3Apache 2.0raw.githubusercontent.com2026-02-283466592.5 MB
Custom roles

List custom roles

Get a complete list of custom roles. This includes project and organization roles that you create, or that are provided as presets by LaunchDarkly. It does not include base roles.

get/api/v2/roles

Query parameters

limitinteger

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

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

offsetinteger

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.

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

_linksobject

The location and content type of related resources

totalCountinteger

The total number of custom roles

Example response

{
  "items": [
    {
      "_id": "1234a56b7c89d012345e678f",
      "_access": {
        "denied": [
          {
            "reason": {
              "resources": [
                "proj/*:env/*;qa_*:/flag/*"
              ],
              "actions": [
                "*"
              ],
              "effect": "allow"
            }
          }
        ],
        "allowed": [
          {
            "reason": {
              "resources": [
                "proj/*:env/*;qa_*:/flag/*"
              ],
              "actions": [
                "*"
              ],
              "effect": "allow"
            }
          }
        ]
      },
      "description": "This custom role is just an example",
      "key": "example-custom-role",
      "name": "Example custom role",
      "policy": [
        {
          "resources": [
            "proj/*:env/*;qa_*:/flag/*"
          ],
          "actions": [
            "*"
          ],
          "effect": "allow"
        }
      ],
      "_presetStatements": [
        {
          "resources": [
            "proj/*:env/*;qa_*:/flag/*"
          ],
          "actions": [
            "*"
          ],
          "effect": "allow"
        }
      ]
    }
  ]
}