All URIs are relative to https://app.launchdarkly.com
Method | HTTP request | Description |
---|---|---|
delete_project | DELETE /api/v2/projects/{projectKey} | Delete project |
get_flag_defaults_by_project | GET /api/v2/projects/{projectKey}/flag-defaults | Get flag defaults for project |
get_project | GET /api/v2/projects/{projectKey} | Get project |
get_projects | GET /api/v2/projects | List projects |
patch_flag_defaults_by_project | PATCH /api/v2/projects/{projectKey}/flag-defaults | Update flag default for project |
patch_project | PATCH /api/v2/projects/{projectKey} | Update project |
post_project | POST /api/v2/projects | Create project |
put_flag_defaults_by_project | PUT /api/v2/projects/{projectKey}/flag-defaults | Create or update flag defaults for project |
delete_project(project_key)
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.
- Api Key Authentication (ApiKey):
import time
import launchdarkly_api
from launchdarkly_api.api import projects_api
from launchdarkly_api.model.invalid_request_error_rep import InvalidRequestErrorRep
from launchdarkly_api.model.forbidden_error_rep import ForbiddenErrorRep
from launchdarkly_api.model.not_found_error_rep import NotFoundErrorRep
from launchdarkly_api.model.rate_limited_error_rep import RateLimitedErrorRep
from launchdarkly_api.model.unauthorized_error_rep import UnauthorizedErrorRep
from pprint import pprint
# Defining the host is optional and defaults to https://app.launchdarkly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = launchdarkly_api.Configuration(
host = "https://app.launchdarkly.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: ApiKey
configuration.api_key['ApiKey'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKey'] = 'Bearer'
# Enter a context with an instance of the API client
with launchdarkly_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = projects_api.ProjectsApi(api_client)
project_key = "projectKey_example" # str | The project key
# example passing only required values which don't have defaults set
try:
# Delete project
api_instance.delete_project(project_key)
except launchdarkly_api.ApiException as e:
print("Exception when calling ProjectsApi->delete_project: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
project_key | str | The project key |
void (empty response body)
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
204 | Action succeeded | - |
400 | Invalid request | - |
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]
FlagDefaultsRep get_flag_defaults_by_project(project_key)
Get flag defaults for project
Get the flag defaults for a specific project.
- Api Key Authentication (ApiKey):
import time
import launchdarkly_api
from launchdarkly_api.api import projects_api
from launchdarkly_api.model.forbidden_error_rep import ForbiddenErrorRep
from launchdarkly_api.model.flag_defaults_rep import FlagDefaultsRep
from launchdarkly_api.model.not_found_error_rep import NotFoundErrorRep
from launchdarkly_api.model.unauthorized_error_rep import UnauthorizedErrorRep
from pprint import pprint
# Defining the host is optional and defaults to https://app.launchdarkly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = launchdarkly_api.Configuration(
host = "https://app.launchdarkly.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: ApiKey
configuration.api_key['ApiKey'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKey'] = 'Bearer'
# Enter a context with an instance of the API client
with launchdarkly_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = projects_api.ProjectsApi(api_client)
project_key = "projectKey_example" # str | The project key
# example passing only required values which don't have defaults set
try:
# Get flag defaults for project
api_response = api_instance.get_flag_defaults_by_project(project_key)
pprint(api_response)
except launchdarkly_api.ApiException as e:
print("Exception when calling ProjectsApi->get_flag_defaults_by_project: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
project_key | str | The project key |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Flag defaults response | - |
401 | Invalid access token | - |
403 | Forbidden | - |
404 | Invalid resource identifier | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Project get_project(project_key)
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.
- Api Key Authentication (ApiKey):
import time
import launchdarkly_api
from launchdarkly_api.api import projects_api
from launchdarkly_api.model.invalid_request_error_rep import InvalidRequestErrorRep
from launchdarkly_api.model.forbidden_error_rep import ForbiddenErrorRep
from launchdarkly_api.model.not_found_error_rep import NotFoundErrorRep
from launchdarkly_api.model.rate_limited_error_rep import RateLimitedErrorRep
from launchdarkly_api.model.project import Project
from launchdarkly_api.model.unauthorized_error_rep import UnauthorizedErrorRep
from pprint import pprint
# Defining the host is optional and defaults to https://app.launchdarkly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = launchdarkly_api.Configuration(
host = "https://app.launchdarkly.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: ApiKey
configuration.api_key['ApiKey'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKey'] = 'Bearer'
# Enter a context with an instance of the API client
with launchdarkly_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = projects_api.ProjectsApi(api_client)
project_key = "projectKey_example" # str | The project key.
expand = "expand_example" # str | A comma-separated list of properties that can reveal additional information in the response. (optional)
# example passing only required values which don't have defaults set
try:
# Get project
api_response = api_instance.get_project(project_key)
pprint(api_response)
except launchdarkly_api.ApiException as e:
print("Exception when calling ProjectsApi->get_project: %s\n" % e)
# example passing only required values which don't have defaults set
# and optional values
try:
# Get project
api_response = api_instance.get_project(project_key, expand=expand)
pprint(api_response)
except launchdarkly_api.ApiException as e:
print("Exception when calling ProjectsApi->get_project: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
project_key | str | The project key. | |
expand | str | A comma-separated list of properties that can reveal additional information in the response. | [optional] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Project response | - |
400 | Invalid request | - |
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]
Projects get_projects()
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. * environments
includes a paginated list of the project environments. For example, expand=environments
includes the environments
field for each project in the response.
- Api Key Authentication (ApiKey):
import time
import launchdarkly_api
from launchdarkly_api.api import projects_api
from launchdarkly_api.model.invalid_request_error_rep import InvalidRequestErrorRep
from launchdarkly_api.model.forbidden_error_rep import ForbiddenErrorRep
from launchdarkly_api.model.rate_limited_error_rep import RateLimitedErrorRep
from launchdarkly_api.model.unauthorized_error_rep import UnauthorizedErrorRep
from launchdarkly_api.model.projects import Projects
from pprint import pprint
# Defining the host is optional and defaults to https://app.launchdarkly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = launchdarkly_api.Configuration(
host = "https://app.launchdarkly.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: ApiKey
configuration.api_key['ApiKey'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKey'] = 'Bearer'
# Enter a context with an instance of the API client
with launchdarkly_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = projects_api.ProjectsApi(api_client)
limit = 1 # int | The number of projects to return in the response. Defaults to 20. (optional)
offset = 1 # int | 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 = "filter_example" # str | A comma-separated list of filters. Each filter is constructed as `field:value`. (optional)
sort = "sort_example" # str | A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order. (optional)
expand = "expand_example" # str | A comma-separated list of properties that can reveal additional information in the response. (optional)
# example passing only required values which don't have defaults set
# and optional values
try:
# List projects
api_response = api_instance.get_projects(limit=limit, offset=offset, filter=filter, sort=sort, expand=expand)
pprint(api_response)
except launchdarkly_api.ApiException as e:
print("Exception when calling ProjectsApi->get_projects: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
limit | int | The number of projects to return in the response. Defaults to 20. | [optional] |
offset | int | 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 | str | A comma-separated list of filters. Each filter is constructed as `field:value`. | [optional] |
sort | str | A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order. | [optional] |
expand | str | A comma-separated list of properties that can reveal additional information in the response. | [optional] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Project collection response | - |
400 | Invalid request | - |
401 | Invalid access token | - |
403 | Forbidden | - |
429 | Rate limited | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UpsertPayloadRep patch_flag_defaults_by_project(project_key, json_patch)
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.
- Api Key Authentication (ApiKey):
import time
import launchdarkly_api
from launchdarkly_api.api import projects_api
from launchdarkly_api.model.json_patch import JSONPatch
from launchdarkly_api.model.invalid_request_error_rep import InvalidRequestErrorRep
from launchdarkly_api.model.forbidden_error_rep import ForbiddenErrorRep
from launchdarkly_api.model.not_found_error_rep import NotFoundErrorRep
from launchdarkly_api.model.rate_limited_error_rep import RateLimitedErrorRep
from launchdarkly_api.model.upsert_payload_rep import UpsertPayloadRep
from launchdarkly_api.model.unauthorized_error_rep import UnauthorizedErrorRep
from launchdarkly_api.model.status_conflict_error_rep import StatusConflictErrorRep
from pprint import pprint
# Defining the host is optional and defaults to https://app.launchdarkly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = launchdarkly_api.Configuration(
host = "https://app.launchdarkly.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: ApiKey
configuration.api_key['ApiKey'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKey'] = 'Bearer'
# Enter a context with an instance of the API client
with launchdarkly_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = projects_api.ProjectsApi(api_client)
project_key = "projectKey_example" # str | The project key
json_patch = JSONPatch([
PatchOperation(
op="replace",
path="/exampleField",
value=None,
),
]) # JSONPatch |
# example passing only required values which don't have defaults set
try:
# Update flag default for project
api_response = api_instance.patch_flag_defaults_by_project(project_key, json_patch)
pprint(api_response)
except launchdarkly_api.ApiException as e:
print("Exception when calling ProjectsApi->patch_flag_defaults_by_project: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
project_key | str | The project key | |
json_patch | JSONPatch |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Flag default response | - |
400 | Invalid request | - |
401 | Invalid access token | - |
403 | Forbidden | - |
404 | Invalid resource identifier | - |
409 | Status conflict | - |
429 | Rate limited | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ProjectRep patch_project(project_key, json_patch)
Update project
Update a project. Updating a project uses a JSON patch representation of the desired changes. To learn more, read Updates.
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.
- Api Key Authentication (ApiKey):
import time
import launchdarkly_api
from launchdarkly_api.api import projects_api
from launchdarkly_api.model.json_patch import JSONPatch
from launchdarkly_api.model.invalid_request_error_rep import InvalidRequestErrorRep
from launchdarkly_api.model.forbidden_error_rep import ForbiddenErrorRep
from launchdarkly_api.model.not_found_error_rep import NotFoundErrorRep
from launchdarkly_api.model.rate_limited_error_rep import RateLimitedErrorRep
from launchdarkly_api.model.unauthorized_error_rep import UnauthorizedErrorRep
from launchdarkly_api.model.project_rep import ProjectRep
from launchdarkly_api.model.status_conflict_error_rep import StatusConflictErrorRep
from pprint import pprint
# Defining the host is optional and defaults to https://app.launchdarkly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = launchdarkly_api.Configuration(
host = "https://app.launchdarkly.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: ApiKey
configuration.api_key['ApiKey'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKey'] = 'Bearer'
# Enter a context with an instance of the API client
with launchdarkly_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = projects_api.ProjectsApi(api_client)
project_key = "projectKey_example" # str | The project key
json_patch = JSONPatch([
PatchOperation(
op="replace",
path="/exampleField",
value=None,
),
]) # JSONPatch |
# example passing only required values which don't have defaults set
try:
# Update project
api_response = api_instance.patch_project(project_key, json_patch)
pprint(api_response)
except launchdarkly_api.ApiException as e:
print("Exception when calling ProjectsApi->patch_project: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
project_key | str | The project key | |
json_patch | JSONPatch |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Project response | - |
400 | Invalid request | - |
401 | Invalid access token | - |
403 | Forbidden | - |
404 | Invalid resource identifier | - |
409 | Status conflict | - |
429 | Rate limited | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ProjectRep post_project(project_post)
Create project
Create a new project with the given key and name. Project keys must be unique within an account.
- Api Key Authentication (ApiKey):
import time
import launchdarkly_api
from launchdarkly_api.api import projects_api
from launchdarkly_api.model.invalid_request_error_rep import InvalidRequestErrorRep
from launchdarkly_api.model.forbidden_error_rep import ForbiddenErrorRep
from launchdarkly_api.model.project_post import ProjectPost
from launchdarkly_api.model.rate_limited_error_rep import RateLimitedErrorRep
from launchdarkly_api.model.unauthorized_error_rep import UnauthorizedErrorRep
from launchdarkly_api.model.project_rep import ProjectRep
from launchdarkly_api.model.status_conflict_error_rep import StatusConflictErrorRep
from pprint import pprint
# Defining the host is optional and defaults to https://app.launchdarkly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = launchdarkly_api.Configuration(
host = "https://app.launchdarkly.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: ApiKey
configuration.api_key['ApiKey'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKey'] = 'Bearer'
# Enter a context with an instance of the API client
with launchdarkly_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = projects_api.ProjectsApi(api_client)
project_post = ProjectPost(
name="My Project",
key="project-key-123abc",
include_in_snippet_by_default=True,
default_client_side_availability=DefaultClientSideAvailabilityPost(
using_environment_id=True,
using_mobile_key=True,
),
tags=["ops"],
environments=[
EnvironmentPost(
name="My Environment",
key="environment-key-123abc",
color="F5A623",
default_ttl=5,
secure_mode=True,
default_track_events=False,
confirm_changes=False,
require_comments=False,
tags=["ops"],
source=SourceEnv(
key="key_example",
version=1,
),
critical=True,
),
],
naming_convention=NamingConvention(
case="kebabCase",
prefix="enable-",
),
) # ProjectPost |
# example passing only required values which don't have defaults set
try:
# Create project
api_response = api_instance.post_project(project_post)
pprint(api_response)
except launchdarkly_api.ApiException as e:
print("Exception when calling ProjectsApi->post_project: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
project_post | ProjectPost |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
201 | Project 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]
UpsertPayloadRep put_flag_defaults_by_project(project_key, upsert_flag_defaults_payload)
Create or update flag defaults for project
Create or update flag defaults for a project.
- Api Key Authentication (ApiKey):
import time
import launchdarkly_api
from launchdarkly_api.api import projects_api
from launchdarkly_api.model.invalid_request_error_rep import InvalidRequestErrorRep
from launchdarkly_api.model.forbidden_error_rep import ForbiddenErrorRep
from launchdarkly_api.model.not_found_error_rep import NotFoundErrorRep
from launchdarkly_api.model.rate_limited_error_rep import RateLimitedErrorRep
from launchdarkly_api.model.upsert_payload_rep import UpsertPayloadRep
from launchdarkly_api.model.upsert_flag_defaults_payload import UpsertFlagDefaultsPayload
from launchdarkly_api.model.unauthorized_error_rep import UnauthorizedErrorRep
from launchdarkly_api.model.status_conflict_error_rep import StatusConflictErrorRep
from pprint import pprint
# Defining the host is optional and defaults to https://app.launchdarkly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = launchdarkly_api.Configuration(
host = "https://app.launchdarkly.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: ApiKey
configuration.api_key['ApiKey'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKey'] = 'Bearer'
# Enter a context with an instance of the API client
with launchdarkly_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = projects_api.ProjectsApi(api_client)
project_key = "projectKey_example" # str | The project key
upsert_flag_defaults_payload = UpsertFlagDefaultsPayload(
tags=["tag-1","tag-2"],
temporary=True,
boolean_defaults=BooleanFlagDefaults(
true_display_name="True",
false_display_name="False",
true_description="serve true",
false_description="serve false",
on_variation=0,
off_variation=1,
),
default_client_side_availability=DefaultClientSideAvailability(
using_mobile_key=True,
using_environment_id=True,
),
) # UpsertFlagDefaultsPayload |
# example passing only required values which don't have defaults set
try:
# Create or update flag defaults for project
api_response = api_instance.put_flag_defaults_by_project(project_key, upsert_flag_defaults_payload)
pprint(api_response)
except launchdarkly_api.ApiException as e:
print("Exception when calling ProjectsApi->put_flag_defaults_by_project: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
project_key | str | The project key | |
upsert_flag_defaults_payload | UpsertFlagDefaultsPayload |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Flag default response | - |
400 | Invalid request | - |
401 | Invalid access token | - |
403 | Forbidden | - |
404 | Invalid resource identifier | - |
409 | Status conflict | - |
429 | Rate limited | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]