Insights deployments (beta)

This feature is in beta

To use this feature, pass in a header including the LD-API-Version key with value set to beta. Use this header with each call. To learn more, read Beta resources.

Resources that are in beta are still undergoing testing and development. They may change without notice, including becoming backwards incompatible.

The deployments API provides access to deployment information in engineering insights. To learn more, read Deployments.

Create deployment event

Create deployment event

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

The project key

environmentKey
required
string

The environment key

applicationKey
required
string

The application key. This defines the granularity at which you want to view your insights metrics. Typically it is the name of one of the GitHub repositories that you use in this project.

LaunchDarkly automatically creates a new application each time you send a unique application key.

applicationName
string

The application name. This defines how the application is displayed

applicationKind
string

The kind of application. Default: server

Enum: "server" "browser" "mobile"
version
required
string

The application version. You can set the application version to any string that includes only letters, numbers, periods (.), hyphens (-), or underscores (_).

We recommend setting the application version to at least the first seven characters of the SHA or to the tag of the GitHub commit for this deployment.

versionName
string

The version name. This defines how the version is displayed

eventType
required
string

The event type

Enum: "started" "failed" "finished" "custom"
eventTime
integer <int64> (UnixMillis)
object

A JSON object containing metadata about the event

object

A JSON object containing metadata about the deployment

Responses
201

Created

400

Invalid request

401

Invalid access token

403

Forbidden

404

Invalid resource identifier

429

Rate limited

post/api/v2/engineering-insights/deployment-events
Request samples
application/json
{
  • "projectKey": "default",
  • "environmentKey": "production",
  • "applicationKey": "billing-service",
  • "applicationName": "Billing Service",
  • "applicationKind": "server",
  • "version": "a90a8a2",
  • "versionName": "v1.0.0",
  • "eventType": "started",
  • "eventTime": 0,
  • "eventMetadata": {
    },
  • "deploymentMetadata": {
    }
}
Response samples
application/json
{
  • "code": "invalid_request",
  • "message": "validation failed",
  • "errors": [
    ]
}

List deployments

Get a list of deployments

Expanding the deployment collection response

LaunchDarkly supports expanding the deployment collection response to include additional fields.

To expand the response, append the expand query parameter and include the following:

  • pullRequests includes details on all of the pull requests associated with each deployment
  • flagReferences includes details on all of the references to flags in each deployment

For example, use ?expand=pullRequests to include the pullRequests field in the response. By default, this field is not included in the response.

Request
query Parameters
projectKey
required
string <string>

The project key

environmentKey
required
string <string>

The environment key

applicationKey
string <string>

Comma separated list of application keys

limit
integer <int64>

The number of deployments to return. Default is 20. Maximum allowed is 100.

expand
string <string>

Expand properties in response. Options: pullRequests, flagReferences

from
integer <int64>

Unix timestamp in milliseconds. Default value is 7 days ago.

to
integer <int64>

Unix timestamp in milliseconds. Default value is now.

after
string <string>

Identifier used for pagination

before
string <string>

Identifier used for pagination

kind
string <string>

The deployment kind

status
string <string>

The deployment status

Responses
200

Deployment collection response

400

Invalid request

401

Invalid access token

403

Forbidden

404

Invalid resource identifier

429

Rate limited

get/api/v2/engineering-insights/deployments
Request samples
Response samples
application/json
{
  • "totalCount": 25,
  • "items": [
    ],
  • "_links": {
    }
}

Get deployment

Get a deployment by ID.

The deployment ID is returned as part of the List deployments response. It is the id field of each element in the items array.

Expanding the deployment response

LaunchDarkly supports expanding the deployment response to include additional fields.

To expand the response, append the expand query parameter and include the following:

  • pullRequests includes details on all of the pull requests associated with each deployment
  • flagReferences includes details on all of the references to flags in each deployment

For example, use ?expand=pullRequests to include the pullRequests field in the response. By default, this field is not included in the response.

Request
path Parameters
deploymentID
required
string <string>

The deployment ID

query Parameters
expand
string <string>

Expand properties in response. Options: pullRequests, flagReferences

Responses
200

Deployment response

400

Invalid request

401

Invalid access token

403

Forbidden

404

Invalid resource identifier

429

Rate limited

get/api/v2/engineering-insights/deployments/{deploymentID}
Request samples
Response samples
application/json
{
  • "id": "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11",
  • "applicationKey": "billing-service",
  • "applicationVersion": "a90a8a2",
  • "startedAt": 0,
  • "endedAt": 0,
  • "durationMs": 10996000,
  • "status": "string",
  • "kind": "string",
  • "active": true,
  • "metadata": {
    },
  • "archived": false,
  • "environmentKey": "production",
  • "numberOfContributors": 1,
  • "numberOfPullRequests": 2,
  • "linesAdded": 100,
  • "linesDeleted": 50,
  • "leadTime": 20237000,
  • "pullRequests": {
    },
  • "flagReferences": {
    },
  • "leadTimeStages": {
    }
}

Update deployment

Update a deployment by ID. Updating a deployment uses a JSON patch representation of the desired changes. To learn more, read Updates.

The deployment ID is returned as part of the List deployments response. It is the id field of each element in the items array.

Request
path Parameters
deploymentID
required
string <string>

The deployment ID

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

Deployment response

400

Invalid request

401

Invalid access token

403

Forbidden

404

Invalid resource identifier

429

Rate limited

patch/api/v2/engineering-insights/deployments/{deploymentID}
Request samples
application/json
[
  • {
    }
]
Response samples
application/json
{
  • "id": "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11",
  • "applicationKey": "billing-service",
  • "applicationVersion": "a90a8a2",
  • "startedAt": 0,
  • "endedAt": 0,
  • "durationMs": 10996000,
  • "status": "string",
  • "kind": "string",
  • "active": true,
  • "metadata": {
    },
  • "archived": false,
  • "environmentKey": "production",
  • "numberOfContributors": 1,
  • "numberOfPullRequests": 2,
  • "linesAdded": 100,
  • "linesDeleted": 50,
  • "leadTime": 20237000,
  • "pullRequests": {
    },
  • "flagReferences": {
    },
  • "leadTimeStages": {
    }
}