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 create, destroy, 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 two fields for filters:

  • query is a string that matches against the projects' names and keys. It is not case sensitive.
  • tags is a + separate list of project tags. It filters the list of projects that have all of the tags in the list.

For example, the 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.

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

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": "my-project",
  • "name": "My Project"
}
Response samples
application/json
{
  • "_links": {
    },
  • "_id": "57be1db38b75bf0772d11383",
  • "key": "my-project",
  • "includeInSnippetByDefault": true,
  • "defaultClientSideAvailability": {
    },
  • "name": "My Project",
  • "tags": [
    ],
  • "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": "my-project",
  • "includeInSnippetByDefault": true,
  • "defaultClientSideAvailability": {
    },
  • "name": "My Project",
  • "tags": [
    ],
  • "environments": {
    }
}

Update project

Update a project. Requires a JSON Patch representation of the desired changes to the project.

Request
path Parameters
projectKey
required
string <string>

The project key

Request Body schema: application/json
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
required
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": "my-project",
  • "includeInSnippetByDefault": true,
  • "defaultClientSideAvailability": {
    },
  • "name": "My Project",
  • "tags": [
    ],
  • "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": {
    },
  • "tags": [
    ],
  • "temporary": true,
  • "defaultClientSideAvailability": {
    },
  • "booleanDefaults": {
    }
}

Update flag default for project

Update a flag default. Requires a JSON Patch representation of the desired changes to the flag default.

Request
path Parameters
projectKey
required
string <string>

The project key

Request Body schema: application/json
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
required
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,
  • "defaultClientSideAvailability": {
    },
  • "booleanDefaults": {
    }
}

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
tags
required
Array of strings
temporary
required
boolean
required
object (DefaultClientSideAvailability)
required
object (BooleanFlagDefaults)
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,
  • "defaultClientSideAvailability": {
    },
  • "booleanDefaults": {
    }
}
Response samples
application/json
{
  • "_links": {
    },
  • "tags": [
    ],
  • "temporary": true,
  • "defaultClientSideAvailability": {
    },
  • "booleanDefaults": {
    }
}