All URIs are relative to https://app.launchdarkly.com
| Method | HTTP request | Description |
|---|---|---|
| deleteProject | DELETE /api/v2/projects/{projectKey} | Delete project |
| getFlagDefaultsByProject | GET /api/v2/projects/{projectKey}/flag-defaults | Get flag defaults for project |
| getProject | GET /api/v2/projects/{projectKey} | Get project |
| getProjects | GET /api/v2/projects | List projects |
| patchFlagDefaultsByProject | PATCH /api/v2/projects/{projectKey}/flag-defaults | Update flag default for project |
| patchProject | PATCH /api/v2/projects/{projectKey} | Update project |
| postProject | POST /api/v2/projects | Create project |
| putFlagDefaultsByProject | PUT /api/v2/projects/{projectKey}/flag-defaults | Create or update flag defaults for project |
deleteProject(projectKey)
Delete project
Delete a project by key. Use this endpoint with caution. Deleting a project will delete all associated environments and feature flags. You cannot delete the last project in an account.
import LaunchDarklyApi from 'launchdarkly-api';
let defaultClient = LaunchDarklyApi.ApiClient.instance;
// Configure API key authorization: ApiKey
let ApiKey = defaultClient.authentications['ApiKey'];
ApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKey.apiKeyPrefix = 'Token';
let apiInstance = new LaunchDarklyApi.ProjectsApi();
let projectKey = "projectKey_example"; // String | The project key
apiInstance.deleteProject(projectKey, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| projectKey | String | The project key |
null (empty response body)
- Content-Type: Not defined
- Accept: application/json
FlagDefaultsRep getFlagDefaultsByProject(projectKey)
Get flag defaults for project
Get the flag defaults for a specific project.
import LaunchDarklyApi from 'launchdarkly-api';
let defaultClient = LaunchDarklyApi.ApiClient.instance;
// Configure API key authorization: ApiKey
let ApiKey = defaultClient.authentications['ApiKey'];
ApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKey.apiKeyPrefix = 'Token';
let apiInstance = new LaunchDarklyApi.ProjectsApi();
let projectKey = "projectKey_example"; // String | The project key
apiInstance.getFlagDefaultsByProject(projectKey, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| projectKey | String | The project key |
- Content-Type: Not defined
- Accept: application/json
Project getProject(projectKey, opts)
Get project
Get a single project by key. ### Expanding the project response LaunchDarkly supports one field for expanding the "Get project" response. By default, these fields are not included in the response. To expand the response, append the `expand` query parameter and add a comma-separated list with any of the following fields: * `environments` includes a paginated list of the project environments. For example, `expand=environments` includes the `environments` field for the project in the response.
import LaunchDarklyApi from 'launchdarkly-api';
let defaultClient = LaunchDarklyApi.ApiClient.instance;
// Configure API key authorization: ApiKey
let ApiKey = defaultClient.authentications['ApiKey'];
ApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKey.apiKeyPrefix = 'Token';
let apiInstance = new LaunchDarklyApi.ProjectsApi();
let projectKey = "projectKey_example"; // String | The project key.
let opts = {
'expand': "expand_example" // String | A comma-separated list of properties that can reveal additional information in the response.
};
apiInstance.getProject(projectKey, opts, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| projectKey | String | The project key. | |
| expand | String | A comma-separated list of properties that can reveal additional information in the response. | [optional] |
- Content-Type: Not defined
- Accept: application/json
Projects getProjects(opts)
List projects
Return a list of projects. By default, this returns the first 20 projects. Page through this list with the `limit` parameter and by following the `first`, `prev`, `next`, and `last` links in the `_links` field that returns. If those links do not appear, the pages they refer to don't exist. For example, the `first` and `prev` links will be missing from the response on the first page, because there is no previous page and you cannot return to the first page when you are already on the first page. ### Filtering projects LaunchDarkly supports three fields for filters: - `query` is a string that matches against the projects' names and keys. It is not case sensitive. - `tags` is a `+`-separated list of project tags. It filters the list of projects that have all of the tags in the list. - `keys` is a `|` separated list of project keys. It filters the list to projects that have any of the keys in the list. For example, the filter `filter=query:abc,tags:tag-1+tag-2` matches projects with the string `abc` in their name or key and also are tagged with `tag-1` and `tag-2`. The filter is not case-sensitive. The documented values for `filter` query parameters are prior to URL encoding. For example, the `+` in `filter=tags:tag-1+tag-2` must be encoded to `%2B`. ### Sorting projects LaunchDarkly supports two fields for sorting: - `name` sorts by project name. - `createdOn` sorts by the creation date of the project. For example, `sort=name` sorts the response by project name in ascending order. ### Expanding the projects response LaunchDarkly supports one field for expanding the "List projects" response. By default, these fields are not included in the response. To expand the response, append the `expand` query parameter and add a comma-separated list with the `environments` field. * `environments` includes a paginated list of the project environments. For example, `expand=environments` includes the `environments` field for each project in the response.
import LaunchDarklyApi from 'launchdarkly-api';
let defaultClient = LaunchDarklyApi.ApiClient.instance;
// Configure API key authorization: ApiKey
let ApiKey = defaultClient.authentications['ApiKey'];
ApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKey.apiKeyPrefix = 'Token';
let apiInstance = new LaunchDarklyApi.ProjectsApi();
let opts = {
'limit': 789, // Number | The number of projects to return in the response. Defaults to 20.
'offset': 789, // Number | Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and returns the next `limit` items.
'filter': "filter_example", // String | A comma-separated list of filters. Each filter is constructed as `field:value`.
'sort': "sort_example", // String | A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order.
'expand': "expand_example" // String | A comma-separated list of properties that can reveal additional information in the response.
};
apiInstance.getProjects(opts, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| limit | Number | The number of projects to return in the response. Defaults to 20. | [optional] |
| offset | Number | Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and returns the next `limit` items. | [optional] |
| filter | String | A comma-separated list of filters. Each filter is constructed as `field:value`. | [optional] |
| sort | String | A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order. | [optional] |
| expand | String | A comma-separated list of properties that can reveal additional information in the response. | [optional] |
- Content-Type: Not defined
- Accept: application/json
UpsertPayloadRep patchFlagDefaultsByProject(projectKey, patchOperation)
Update flag default for project
Update a flag default. Updating a flag default uses a JSON patch or JSON merge patch representation of the desired changes. To learn more, read Updates.
import LaunchDarklyApi from 'launchdarkly-api';
let defaultClient = LaunchDarklyApi.ApiClient.instance;
// Configure API key authorization: ApiKey
let ApiKey = defaultClient.authentications['ApiKey'];
ApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKey.apiKeyPrefix = 'Token';
let apiInstance = new LaunchDarklyApi.ProjectsApi();
let projectKey = "projectKey_example"; // String | The project key
let patchOperation = [new LaunchDarklyApi.PatchOperation()]; // [PatchOperation] |
apiInstance.patchFlagDefaultsByProject(projectKey, patchOperation, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| projectKey | String | The project key | |
| patchOperation | [PatchOperation] |
- Content-Type: application/json
- Accept: application/json
ProjectRep patchProject(projectKey, patchOperation)
Update project
Update a project. Updating a project uses a JSON patch representation of the desired changes. To learn more, read Updates.<br/><br/>To add an element to the project fields that are arrays, set the `path` to the name of the field 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 LaunchDarklyApi from 'launchdarkly-api';
let defaultClient = LaunchDarklyApi.ApiClient.instance;
// Configure API key authorization: ApiKey
let ApiKey = defaultClient.authentications['ApiKey'];
ApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKey.apiKeyPrefix = 'Token';
let apiInstance = new LaunchDarklyApi.ProjectsApi();
let projectKey = "projectKey_example"; // String | The project key
let patchOperation = [{"op":"add","path":"/tags/0","value":"another-tag"}]; // [PatchOperation] |
apiInstance.patchProject(projectKey, patchOperation, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| projectKey | String | The project key | |
| patchOperation | [PatchOperation] |
- Content-Type: application/json
- Accept: application/json
ProjectRep postProject(projectPost)
Create project
Create a new project with the given key and name. Project keys must be unique within an account.
import LaunchDarklyApi from 'launchdarkly-api';
let defaultClient = LaunchDarklyApi.ApiClient.instance;
// Configure API key authorization: ApiKey
let ApiKey = defaultClient.authentications['ApiKey'];
ApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKey.apiKeyPrefix = 'Token';
let apiInstance = new LaunchDarklyApi.ProjectsApi();
let projectPost = {"key":"project-key-123abc","name":"My Project"}; // ProjectPost |
apiInstance.postProject(projectPost, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| projectPost | ProjectPost |
- Content-Type: application/json
- Accept: application/json
UpsertPayloadRep putFlagDefaultsByProject(projectKey, upsertFlagDefaultsPayload)
Create or update flag defaults for project
Create or update flag defaults for a project.
import LaunchDarklyApi from 'launchdarkly-api';
let defaultClient = LaunchDarklyApi.ApiClient.instance;
// Configure API key authorization: ApiKey
let ApiKey = defaultClient.authentications['ApiKey'];
ApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKey.apiKeyPrefix = 'Token';
let apiInstance = new LaunchDarklyApi.ProjectsApi();
let projectKey = "projectKey_example"; // String | The project key
let upsertFlagDefaultsPayload = new LaunchDarklyApi.UpsertFlagDefaultsPayload(); // UpsertFlagDefaultsPayload |
apiInstance.putFlagDefaultsByProject(projectKey, upsertFlagDefaultsPayload, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| projectKey | String | The project key | |
| upsertFlagDefaultsPayload | UpsertFlagDefaultsPayload |
- Content-Type: application/json
- Accept: application/json