Deployment events API
Read time: 1 minute
Last edited: Mar 16, 2023
Accelerate is only available to members of LaunchDarkly's Early Access Program (EAP). If you want access to this feature, join the EAP.
Overview
This topic describes the deployment events REST API.
Accelerate defines a deployment as a new code change your team has introduced to an environment. Each time a deployment starts, finishes, or fails, your deployment pipeline should send a deployment event to Accelerate. Accelerate combines these events with data from your feature management to provide release and deployment metrics.
If you are unable to send separate start and finish events, you can send a single finished
event. In this case, Accelerate will set the deployment start and finish times to the same time, and will not have accurate deployment duration data.
If you prefer not to instrument your deployment pipeline, you can send deployment information in your LaunchDarkly SDK configuration instead. To learn more, read Configuring your application to send deployment information.
Making a deployment event request
Here's how to structure a deployment event request using the Accelerate REST API:
Request element | Description |
---|---|
Required headers |
|
REST method | POST |
Resource | /api/v2/accelerate/deployment-events |
Here are the request body parameters for the deployment events API:
Request body parameter | Description |
---|---|
projectKey | The project key |
environmentKey | The environment key |
applicationKey | The application key. This defines the granularity at which you want to view your Accelerate metrics. Typically it is the name of one of the GitHub repositories that you use in this project. Accelerate automatically creates a new application each time you send a unique application key. |
version | 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 the full SHA or the tag of the GitHub commit for this deployment. |
eventType | One of started , finished , failed |
eventTime | The time, in Unix milliseconds, when the event occurred |
eventMetadata | A JSON object containing metadata about the event |
deploymentMetadata | A JSON object containing metadata about the deployment |
Here's an example deployment event request:
curl -i -X POST \'https://app.launchdarkly.com/api/v2/accelerate/deployment-events' \-H 'Authorization: EXAMPLE-API-ACCESS-TOKEN' \-H 'Content-Type: application/json' \-d '{"projectKey": "{{yourProjectKey}}","environmentKey": "test","applicationKey": "application-key-123abc","version": "a12bcde3f45ab6c789123456d78efabcde91234f","eventType": "started","eventTime": {{epochMilliseconds}},"eventMetadata": {"approver": "test-user"},"deploymentMetadata": {"deploymentInfo": "example-deployment-info"}}'