Projects

Projects allow you to manage multiple different software projects under one LaunchDarkly account. Each project has its own unique set of environments and feature flags. To learn more, read Projects.

Using the projects API, you can list, create, and manage 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.

Request
query Parameters
limit
integer <int64>

The number of projects to return in the response. Defaults to 20.

offset
integer <int64>

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
string <string>

A comma-separated list of filters. Each filter is constructed as field:value.

sort
string <string>

A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order.

expand
string <string>

A comma-separated list of properties that can reveal additional information in the response.

Responses
200

Project collection response

400

Invalid request

401

Invalid access token

403

Forbidden

429

Rate limited

get/api/v2/projects
Request samples
Response samples
application/json
{
  • "_links": {
    },
  • "items": [
    ],
  • "totalCount": 0
}

Create project

Create a new project with the given key and name. Project keys must be unique within an account.

Request
Request Body schema: application/json
required
name
required
string

A human-friendly name for the project.

key
required
string

A unique key used to reference the project in your code.

includeInSnippetByDefault
boolean

Whether or not flags created in this project are made available to the client-side JavaScript SDK by default.

object (DefaultClientSideAvailabilityPost)
tags
Array of strings

Tags for the project

Array of objects (EnvironmentPost)

Creates the provided environments for this project. If omitted default environments will be created instead.

object (NamingConvention)
Responses
201

Project response

400

Invalid request

401

Invalid access token

403

Forbidden

409

Status conflict

429

Rate limited

post/api/v2/projects
Request samples
application/json
{
  • "key": "project-key-123abc",
  • "name": "My Project"
}
Response samples
application/json
{
  • "_links": {
    },
  • "_id": "57be1db38b75bf0772d11383",
  • "key": "project-key-123abc",
  • "includeInSnippetByDefault": true,
  • "defaultClientSideAvailability": {
    },
  • "name": "My Project",
  • "_access": {
    },
  • "tags": [
    ],
  • "defaultReleasePipelineKey": "string",
  • "environments": [
    ]
}

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.

Request
path Parameters
projectKey
required
string <string>

The project key.

query Parameters
expand
string <string>

A comma-separated list of properties that can reveal additional information in the response.

Responses
200

Project response

400

Invalid request

401

Invalid access token

403

Forbidden

404

Invalid resource identifier

429

Rate limited

get/api/v2/projects/{projectKey}
Request samples
Response samples
application/json
{
  • "_links": {
    },
  • "_id": "57be1db38b75bf0772d11383",
  • "key": "project-key-123abc",
  • "includeInSnippetByDefault": true,
  • "defaultClientSideAvailability": {
    },
  • "name": "My Project",
  • "_access": {
    },
  • "tags": [
    ],
  • "defaultReleasePipelineKey": "string",
  • "environments": {
    }
}

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.

Request
path Parameters
projectKey
required
string <string>

The project key

Request Body schema: application/json
required
Array
op
required
string

The type of operation to perform

path
required
string

A JSON Pointer string specifying the part of the document to operate on

value
any

A JSON value used in "add", "replace", and "test" operations

Responses
200

Project response

400

Invalid request

401

Invalid access token

403

Forbidden

404

Invalid resource identifier

409

Status conflict

429

Rate limited

patch/api/v2/projects/{projectKey}
Request samples
application/json
[
  • {
    }
]
Response samples
application/json
{
  • "_links": {
    },
  • "_id": "57be1db38b75bf0772d11383",
  • "key": "project-key-123abc",
  • "includeInSnippetByDefault": true,
  • "defaultClientSideAvailability": {
    },
  • "name": "My Project",
  • "_access": {
    },
  • "tags": [
    ],
  • "defaultReleasePipelineKey": "string",
  • "environments": [
    ]
}

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.

Request
path Parameters
projectKey
required
string <string>

The project key

Responses
204

Action succeeded

400

Invalid request

401

Invalid access token

403

Forbidden

404

Invalid resource identifier

429

Rate limited

delete/api/v2/projects/{projectKey}
Request samples
Response samples
application/json
{
  • "code": "invalid_request",
  • "message": "Invalid request body"
}

Get flag defaults for project

Get the flag defaults for a specific project.

Request
path Parameters
projectKey
required
string <string>

The project key

Responses
200

Flag defaults response

401

Invalid access token

403

Forbidden

404

Invalid resource identifier

get/api/v2/projects/{projectKey}/flag-defaults
Request samples
Response samples
application/json
{
  • "_links": {
    },
  • "key": "string",
  • "tags": [
    ],
  • "temporary": true,
  • "defaultClientSideAvailability": {
    },
  • "booleanDefaults": {
    }
}

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.

Request
path Parameters
projectKey
required
string <string>

The project key

Request Body schema: application/json
required
Array
op
required
string

The type of operation to perform

path
required
string

A JSON Pointer string specifying the part of the document to operate on

value
any

A JSON value used in "add", "replace", and "test" operations

Responses
200

Flag default response

400

Invalid request

401

Invalid access token

403

Forbidden

404

Invalid resource identifier

409

Status conflict

429

Rate limited

patch/api/v2/projects/{projectKey}/flag-defaults
Request samples
application/json
[
  • {
    }
]
Response samples
application/json
{
  • "_links": {
    },
  • "tags": [
    ],
  • "temporary": true,
  • "booleanDefaults": {
    },
  • "defaultClientSideAvailability": {
    }
}

Create or update flag defaults for project

Create or update flag defaults for a project.

Request
path Parameters
projectKey
required
string <string>

The project key

Request Body schema: application/json
required
tags
required
Array of strings

A list of default tags for each flag

temporary
required
boolean

Whether the flag should be temporary by default

required
object (BooleanFlagDefaults)
required
object (DefaultClientSideAvailability)
Responses
200

Flag default response

400

Invalid request

401

Invalid access token

403

Forbidden

404

Invalid resource identifier

409

Status conflict

429

Rate limited

put/api/v2/projects/{projectKey}/flag-defaults
Request samples
application/json
{
  • "tags": [
    ],
  • "temporary": true,
  • "booleanDefaults": {
    },
  • "defaultClientSideAvailability": {
    }
}
Response samples
application/json
{
  • "_links": {
    },
  • "tags": [
    ],
  • "temporary": true,
  • "booleanDefaults": {
    },
  • "defaultClientSideAvailability": {
    }
}