All URIs are relative to https://app.launchdarkly.com
| Method | HTTP request | Description |
|---|---|---|
| deleteCustomRole | DELETE /api/v2/roles/{customRoleKey} | Delete custom role |
| getCustomRole | GET /api/v2/roles/{customRoleKey} | Get custom role |
| getCustomRoles | GET /api/v2/roles | List custom roles |
| patchCustomRole | PATCH /api/v2/roles/{customRoleKey} | Update custom role |
| postCustomRole | POST /api/v2/roles | Create custom role |
deleteCustomRole()
Delete a custom role by key
import {
CustomRolesApi,
Configuration
} from 'launchdarkly-api-typescript';
const configuration = new Configuration();
const apiInstance = new CustomRolesApi(configuration);
let customRoleKey: string; //The custom role key (default to undefined)
const { status, data } = await apiInstance.deleteCustomRole(
customRoleKey
);| Name | Type | Description | Notes |
|---|---|---|---|
| customRoleKey | [string] | The custom role key | defaults to undefined |
void (empty response body)
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 204 | Action succeeded | - |
| 401 | Invalid access token | - |
| 404 | Invalid resource identifier | - |
| 429 | Rate limited | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CustomRole getCustomRole()
Get a single custom role by key or ID
import {
CustomRolesApi,
Configuration
} from 'launchdarkly-api-typescript';
const configuration = new Configuration();
const apiInstance = new CustomRolesApi(configuration);
let customRoleKey: string; //The custom role key or ID (default to undefined)
const { status, data } = await apiInstance.getCustomRole(
customRoleKey
);| Name | Type | Description | Notes |
|---|---|---|---|
| customRoleKey | [string] | The custom role key or ID | defaults to undefined |
CustomRole
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Custom role response | - |
| 401 | Invalid access token | - |
| 403 | Forbidden | - |
| 404 | Invalid resource identifier | - |
| 429 | Rate limited | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CustomRoles getCustomRoles()
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.
import {
CustomRolesApi,
Configuration
} from 'launchdarkly-api-typescript';
const configuration = new Configuration();
const apiInstance = new CustomRolesApi(configuration);
let limit: number; //The maximum number of custom roles to return. Defaults to 20. (optional) (default to undefined)
let offset: number; //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`. (optional) (default to undefined)
const { status, data } = await apiInstance.getCustomRoles(
limit,
offset
);| Name | Type | Description | Notes |
|---|---|---|---|
| limit | [number] | The maximum number of custom roles to return. Defaults to 20. | (optional) defaults to undefined |
| offset | [number] | 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`. | (optional) defaults to undefined |
CustomRoles
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Custom roles collection response | - |
| 401 | Invalid access token | - |
| 403 | Forbidden | - |
| 429 | Rate limited | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CustomRole patchCustomRole(patchWithComment)
Update a single custom role. Updating a custom role uses a JSON patch or JSON merge patch representation of the desired changes. To learn more, read Updates.
To add an element to the policy array, set the path to /policy and then append /<array index>. Use /0 to add to the beginning of the array. Use /- to add to the end of the array.
import {
CustomRolesApi,
Configuration,
PatchWithComment
} from 'launchdarkly-api-typescript';
const configuration = new Configuration();
const apiInstance = new CustomRolesApi(configuration);
let customRoleKey: string; //The custom role key (default to undefined)
let patchWithComment: PatchWithComment; //
const { status, data } = await apiInstance.patchCustomRole(
customRoleKey,
patchWithComment
);| Name | Type | Description | Notes |
|---|---|---|---|
| patchWithComment | PatchWithComment | ||
| customRoleKey | [string] | The custom role key | defaults to undefined |
CustomRole
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Custom role response | - |
| 400 | Invalid request | - |
| 401 | Invalid access token | - |
| 404 | Invalid resource identifier | - |
| 409 | Status conflict | - |
| 429 | Rate limited | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CustomRole postCustomRole(customRolePost)
Create a new custom role
import {
CustomRolesApi,
Configuration,
CustomRolePost
} from 'launchdarkly-api-typescript';
const configuration = new Configuration();
const apiInstance = new CustomRolesApi(configuration);
let customRolePost: CustomRolePost; //
const { status, data } = await apiInstance.postCustomRole(
customRolePost
);| Name | Type | Description | Notes |
|---|---|---|---|
| customRolePost | CustomRolePost |
CustomRole
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 201 | Custom role response | - |
| 400 | Invalid request | - |
| 401 | Invalid access token | - |
| 403 | Forbidden | - |
| 409 | Status conflict | - |
| 429 | Rate limited | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]