Skip to main content
GET
/
api
/
v2
/
roles
/
{customRoleKey}
Get custom role
curl --request GET \
  --url https://app.launchdarkly.com/api/v2/roles/{customRoleKey} \
  --header 'Authorization: <api-key>'
{
  "_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>"
      ]
    }
  ]
}

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

Path Parameters

customRoleKey
string<string>
required

The custom role key or ID

Response

Custom role response

_id
string
required

The ID of the custom role

Example:

"1234a56b7c89d012345e678f"

The location and content type of related resources

key
string
required

The key of the custom role

Example:

"example-custom-role"

name
string
required

The name of the custom role

Example:

"Example custom role"

policy
object[]
required

An array of the policies that comprise this custom role

_access
object

Details on the allowed and denied actions for this custom role

description
string

The description of the custom role

Example:

"This custom role is just an example"

basePermissions
string

Base permissions to use for this role. Defaults to no_access (older roles defaulted to reader). Recommended to set this to no_access in all cases.

Example:

"reader"

resourceCategory
string

The category of resources this role is intended to manage. Can be organization, project, or any. Once set, this field cannot be changed.

assignedTo
object

The number of teams and members this role is assigned to

_presetBundleVersion
integer

If created from a preset, the preset bundle version

_presetStatements
object[]

If created from a preset, the read-only statements copied from the preset