This feature is in beta
To use this feature, pass in a header including the
LD-API-Version
key with value set tobeta
. 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
Created
Invalid request
Invalid access token
Forbidden
Invalid resource identifier
Rate limited
{- "projectKey": "default",
- "environmentKey": "production",
- "applicationKey": "billing-service",
- "applicationName": "Billing Service",
- "applicationKind": "server",
- "version": "a90a8a2",
- "versionName": "v1.0.0",
- "eventType": "started",
- "eventTime": 0,
- "eventMetadata": {
- "buildSystemVersion": "v1.2.3"
}, - "deploymentMetadata": {
- "buildNumber": "1234"
}
}
{- "code": "invalid_request",
- "message": "validation failed",
- "errors": [
- {
- "attribute": "projectKey",
- "reason": "must be present"
}
]
}
Get a list of deployments
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 deploymentflagReferences
includes details on all of the references to flags in each deploymentFor example, use ?expand=pullRequests
to include the pullRequests
field in the response. By default, this field is not included in the response.
Deployment collection response
Invalid request
Invalid access token
Forbidden
Invalid resource identifier
Rate limited
{- "totalCount": 25,
- "items": [
- {
- "id": "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11",
- "applicationKey": "billing-service",
- "applicationVersion": "a90a8a2",
- "startedAt": 0,
- "endedAt": 0,
- "durationMs": 10996000,
- "status": "string",
- "kind": "string",
- "active": true,
- "metadata": {
- "buildNumber": "1234"
}, - "archived": false,
- "environmentKey": "production",
- "numberOfContributors": 1,
- "numberOfPullRequests": 2,
- "linesAdded": 100,
- "linesDeleted": 50,
- "leadTime": 20237000,
- "pullRequests": {
- "totalCount": 25,
- "items": [
- {
- "id": "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11",
- "externalId": "1234",
- "title": "Enable new payment structure",
- "status": "merged",
- "author": "jane.doe",
- "createTime": 0,
- "mergeTime": 0,
- "mergeCommitKey": "a90a8a2",
- "baseCommitKey": "a90a8a2",
- "headCommitKey": "a90a8a2",
- "filesChanged": 2,
- "linesAdded": 100,
- "linesDeleted": 50,
- "deployments": { },
- "flagReferences": {
- "totalCount": 25,
- "items": [
- null
]
}, - "leadTime": {
- "codingDurationMs": 1000000,
- "reviewDurationMs": 500000,
- "maxWaitDurationMs": 100000,
- "avgWaitDurationMs": 100000,
- "maxDeployDurationMs": 100000,
- "avgDeployDurationMs": 100000,
- "maxTotalLeadTimeMs": 1600000,
- "avgTotalLeadTimeMs": 1600000
}
}
], - "_links": {
- "next": {
- "href": "/api/v2/engineering-insights/pull-requests?after=a4290006-1fd1-4ca5-acf7-9f31fac61cf5",
- "type": "application/json"
}, - "self": {
- "href": "/api/v2/engineering-insights/pull-requests",
- "type": "application/json"
}
}
}, - "flagReferences": {
- "totalCount": 25,
- "items": [
- {
- "projectKey": "default",
- "flagKey": "enable-new-payment-structure",
- "referencesAdded": 2,
- "referencesRemoved": 5
}
]
}, - "leadTimeStages": {
- "codingDurationMs": 1000000,
- "reviewDurationMs": 500000,
- "waitDurationMs": 100000,
- "deployDurationMs": 100000,
- "totalLeadTimeMs": 1600000
}
}
], - "_links": {
- "next": {
- "href": "/api/v2/engineering-insights/deployments?after=a4290006-1fd1-4ca5-acf7-9f31fac61cf5",
- "type": "application/json"
}, - "self": {
- "href": "/api/v2/engineering-insights/deployments",
- "type": "application/json"
}
}
}
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.
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 deploymentflagReferences
includes details on all of the references to flags in each deploymentFor example, use ?expand=pullRequests
to include the pullRequests
field in the response. By default, this field is not included in the response.
Deployment response
Invalid request
Invalid access token
Forbidden
Invalid resource identifier
Rate limited
{- "id": "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11",
- "applicationKey": "billing-service",
- "applicationVersion": "a90a8a2",
- "startedAt": 0,
- "endedAt": 0,
- "durationMs": 10996000,
- "status": "string",
- "kind": "string",
- "active": true,
- "metadata": {
- "buildNumber": "1234"
}, - "archived": false,
- "environmentKey": "production",
- "numberOfContributors": 1,
- "numberOfPullRequests": 2,
- "linesAdded": 100,
- "linesDeleted": 50,
- "leadTime": 20237000,
- "pullRequests": {
- "totalCount": 25,
- "items": [
- {
- "id": "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11",
- "externalId": "1234",
- "title": "Enable new payment structure",
- "status": "merged",
- "author": "jane.doe",
- "createTime": 0,
- "mergeTime": 0,
- "mergeCommitKey": "a90a8a2",
- "baseCommitKey": "a90a8a2",
- "headCommitKey": "a90a8a2",
- "filesChanged": 2,
- "linesAdded": 100,
- "linesDeleted": 50,
- "deployments": {
- "totalCount": 25,
- "items": [
- { }
], - "_links": {
- "next": {
- "href": "/api/v2/engineering-insights/deployments?after=a4290006-1fd1-4ca5-acf7-9f31fac61cf5",
- "type": "application/json"
}, - "self": {
- "href": "/api/v2/engineering-insights/deployments",
- "type": "application/json"
}
}
}, - "flagReferences": {
- "totalCount": 25,
- "items": [
- {
- "projectKey": "default",
- "flagKey": "enable-new-payment-structure",
- "referencesAdded": 2,
- "referencesRemoved": 5
}
]
}, - "leadTime": {
- "codingDurationMs": 1000000,
- "reviewDurationMs": 500000,
- "maxWaitDurationMs": 100000,
- "avgWaitDurationMs": 100000,
- "maxDeployDurationMs": 100000,
- "avgDeployDurationMs": 100000,
- "maxTotalLeadTimeMs": 1600000,
- "avgTotalLeadTimeMs": 1600000
}
}
], - "_links": {
- "next": {
- "href": "/api/v2/engineering-insights/pull-requests?after=a4290006-1fd1-4ca5-acf7-9f31fac61cf5",
- "type": "application/json"
}, - "self": {
- "href": "/api/v2/engineering-insights/pull-requests",
- "type": "application/json"
}
}
}, - "flagReferences": {
- "totalCount": 25,
- "items": [
- {
- "projectKey": "default",
- "flagKey": "enable-new-payment-structure",
- "referencesAdded": 2,
- "referencesRemoved": 5
}
]
}, - "leadTimeStages": {
- "codingDurationMs": 1000000,
- "reviewDurationMs": 500000,
- "waitDurationMs": 100000,
- "deployDurationMs": 100000,
- "totalLeadTimeMs": 1600000
}
}
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.
Deployment response
Invalid request
Invalid access token
Forbidden
Invalid resource identifier
Rate limited
[- {
- "op": "replace",
- "path": "/status",
- "value": "finished"
}
]
{- "id": "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11",
- "applicationKey": "billing-service",
- "applicationVersion": "a90a8a2",
- "startedAt": 0,
- "endedAt": 0,
- "durationMs": 10996000,
- "status": "string",
- "kind": "string",
- "active": true,
- "metadata": {
- "buildNumber": "1234"
}, - "archived": false,
- "environmentKey": "production",
- "numberOfContributors": 1,
- "numberOfPullRequests": 2,
- "linesAdded": 100,
- "linesDeleted": 50,
- "leadTime": 20237000,
- "pullRequests": {
- "totalCount": 25,
- "items": [
- {
- "id": "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11",
- "externalId": "1234",
- "title": "Enable new payment structure",
- "status": "merged",
- "author": "jane.doe",
- "createTime": 0,
- "mergeTime": 0,
- "mergeCommitKey": "a90a8a2",
- "baseCommitKey": "a90a8a2",
- "headCommitKey": "a90a8a2",
- "filesChanged": 2,
- "linesAdded": 100,
- "linesDeleted": 50,
- "deployments": {
- "totalCount": 25,
- "items": [
- { }
], - "_links": {
- "next": {
- "href": "/api/v2/engineering-insights/deployments?after=a4290006-1fd1-4ca5-acf7-9f31fac61cf5",
- "type": "application/json"
}, - "self": {
- "href": "/api/v2/engineering-insights/deployments",
- "type": "application/json"
}
}
}, - "flagReferences": {
- "totalCount": 25,
- "items": [
- {
- "projectKey": "default",
- "flagKey": "enable-new-payment-structure",
- "referencesAdded": 2,
- "referencesRemoved": 5
}
]
}, - "leadTime": {
- "codingDurationMs": 1000000,
- "reviewDurationMs": 500000,
- "maxWaitDurationMs": 100000,
- "avgWaitDurationMs": 100000,
- "maxDeployDurationMs": 100000,
- "avgDeployDurationMs": 100000,
- "maxTotalLeadTimeMs": 1600000,
- "avgTotalLeadTimeMs": 1600000
}
}
], - "_links": {
- "next": {
- "href": "/api/v2/engineering-insights/pull-requests?after=a4290006-1fd1-4ca5-acf7-9f31fac61cf5",
- "type": "application/json"
}, - "self": {
- "href": "/api/v2/engineering-insights/pull-requests",
- "type": "application/json"
}
}
}, - "flagReferences": {
- "totalCount": 25,
- "items": [
- {
- "projectKey": "default",
- "flagKey": "enable-new-payment-structure",
- "referencesAdded": 2,
- "referencesRemoved": 5
}
]
}, - "leadTimeStages": {
- "codingDurationMs": 1000000,
- "reviewDurationMs": 500000,
- "waitDurationMs": 100000,
- "deployDurationMs": 100000,
- "totalLeadTimeMs": 1600000
}
}