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

List custom roles

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

Update custom role

Next
Built with

Authentication

Authorizationstring
API Key authentication via header

Query parameters

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

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
itemslist of objects
An array of custom roles
_linksmap from strings to objects
The location and content type of related resources
totalCountinteger
The total number of custom roles

Errors

401
Unauthorized Error
403
Forbidden Error
429
Too Many Requests Error