For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Sign inTry it free
DocsGuidesSDKsIntegrationsAPI docsTutorialsFlagship blog
DocsGuidesSDKsIntegrationsAPI docsTutorialsFlagship blog
  • REST API overview
    • Access Tokens
    • Account Members
    • Account Usage Beta
    • AI Configs
    • Announcements
    • Applications Beta
    • Approvals
    • Approvals Beta
    • Audit Log
    • Code References
    • Contexts
    • Context Settings
    • Custom Roles
      • POSTCreate custom role
      • DELDelete custom role
      • GETGet custom role
      • GETList custom roles
      • PATCHUpdate custom role
    • Data Export Destinations
    • Environments
    • Experiments
    • Feature Flags
    • Feature Flags Beta
    • Flag Import Configurations Beta
    • Flag Links Beta
    • Flag Triggers
    • Follow Flags
    • Holdouts Beta
    • Insights Charts Beta
    • Insights Deployments Beta
    • Insights Flag Events Beta
    • Insights Pull Requests Beta
    • Insights Repositories Beta
    • Insights Scores Beta
    • Integration Audit Log Subscriptions
    • Integration Delivery Configurations Beta
    • Integrations Beta
    • Layers
    • Metrics
    • Metrics Beta
    • OAuth2 Clients
    • Persistent Store Integrations Beta
    • Projects
    • Relay Proxy Configurations
    • Release Pipelines Beta
    • Releases Beta
    • Scheduled Changes
    • Segments
    • Tags
    • Teams
    • Teams Beta
    • Users
    • Users Beta
    • User Settings
    • Views Beta
    • Webhooks
    • Workflows
    • Workflow Templates
    • Other
Sign inTry it free
LogoLogo
REST API overviewCustom Roles

Get custom role

GET
/api/v2/roles/:customRoleKey
GET
/api/v2/roles/:customRoleKey
$curl https://app.launchdarkly.com/api/v2/roles/customRoleKey \
> -H "Authorization: <apiKey>"
1{
2 "_id": "1234a56b7c89d012345e678f",
3 "_links": {},
4 "key": "example-custom-role",
5 "name": "Example custom role",
6 "policy": [
7 {
8 "effect": "allow",
9 "resources": [
10 "proj/*:env/*;qa_*:/flag/*"
11 ],
12 "notResources": [
13 "string"
14 ],
15 "actions": [
16 "*"
17 ],
18 "notActions": [
19 "string"
20 ]
21 }
22 ],
23 "_access": {
24 "denied": [
25 {
26 "action": "string",
27 "reason": {
28 "effect": "allow",
29 "resources": [
30 "proj/*:env/*;qa_*:/flag/*"
31 ],
32 "notResources": [
33 "string"
34 ],
35 "actions": [
36 "*"
37 ],
38 "notActions": [
39 "string"
40 ],
41 "role_name": "string"
42 }
43 }
44 ],
45 "allowed": [
46 {
47 "action": "string",
48 "reason": {
49 "effect": "allow",
50 "resources": [
51 "proj/*:env/*;qa_*:/flag/*"
52 ],
53 "notResources": [
54 "string"
55 ],
56 "actions": [
57 "*"
58 ],
59 "notActions": [
60 "string"
61 ],
62 "role_name": "string"
63 }
64 }
65 ]
66 },
67 "description": "This custom role is just an example",
68 "basePermissions": "reader",
69 "resourceCategory": "string",
70 "assignedTo": {
71 "membersCount": 1,
72 "teamsCount": 1
73 },
74 "_presetBundleVersion": 1,
75 "_presetStatements": [
76 {
77 "effect": "allow",
78 "resources": [
79 "proj/*:env/*;qa_*:/flag/*"
80 ],
81 "notResources": [
82 "string"
83 ],
84 "actions": [
85 "*"
86 ],
87 "notActions": [
88 "string"
89 ]
90 }
91 ]
92}
Get a single custom role by key or ID
Was this page helpful?
Previous

List custom roles

Next
Built with

Authentication

Authorizationstring
API Key authentication via header

Path parameters

customRoleKeystringRequiredformat: "string"
The custom role key or ID

Response

Custom role response
_idstring
The ID of the custom role
_linksmap from strings to objects
The location and content type of related resources
keystring
The key of the custom role
namestring
The name of the custom role
policylist of objects
An array of the policies that comprise this custom role
_accessobject
Details on the allowed and denied actions for this custom role
descriptionstring
The description of the custom role
basePermissionsstring

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.

resourceCategorystring

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

assignedToobject
The number of teams and members this role is assigned to
_presetBundleVersioninteger
If created from a preset, the preset bundle version
_presetStatementslist of objects

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

Errors

401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
429
Too Many Requests Error