APIs
How to use Multitudes' API endpoints to track deployments and integrate with your CI/CD pipeline.
Last updated
Was this helpful?
How to use Multitudes' API endpoints to track deployments and integrate with your CI/CD pipeline.
Last updated
Was this helpful?
Use our APIs to get more flexibility and control over how you track your devOps activity. We’ll continue to build more endpoints as we go - we’re always open to feedback!
Send us information about your deployments from any CI/CD tool. We’ll use this to calculate metrics such as Change Lead Time
through to deployment and Deployment Frequency
(more info on Metrics & Definitions).
Our data pipeline runs every 6 hours so you may need to wait to see data after you start sending.
You can use either our Deployments API or our GitHub Actions integration to provide us with data about deployments. If you already have our GitHub Actions integration configured, generating a token to connect to our Deployments API will override the data from GitHub Actions.
In the Multitudes app, go to Settings > Integrations and click on the “Connect” button in the Deployments API card.
On the resulting modal, click “Generate Token”.
After the token has been generated, click "Copy Token" and use it in your API calls (see Step 2 below). You will only see this token once!
When you close out of the modal, the Deployments API card will now have a “Configure” button instead of “Connect” (see screenshot at left below). Clicking it will give you options to revoke your token or regenerate a new one, should you need it (see screenshot at right below).
To tell us about a deployment, make an HTTP POST request to our endpoint with the generated authentication token in the header and required parameters.
You should make one POST per repository being deployed and include the commit SHAs of the merge commit for each PR being deployed. This is particularly important if you are deploying multiple PRs at once or if your PRs are being merged via an intermediary branch.
Note that we include each deployment we receive a POST for in our metric calculations. You may want to only POST deployments to your production environment. See more details here.
commitSha
string or string[] Required
The SHA-1 value(s) of the commit(s) being deployed. Each value should have a minimum of 7 characters. While this is likely fine for most organizations, you may wish to send us a longer SHA if you’d like more assurance that they will be matched to the correct commit and PR data (see here for more information on the uniqueness of short SHA-1 values).
Commits should all be from the same repository. This will determine how the our repositories filter interacts with charts like Deployment Frequency. If there are commits from different repos in the commit_sha
field, we will assume the repository of the first commit in the list.
Commits that are authored by users who are not a Contributor in Multitudes will be filtered out of results. If a deployment has no commits authored by Multitudes contributors, the whole deployment will be filtered out of results as we won't be able to attribute it to a Multitudes contributor nor their team.
If a deployment only has commits authored by bots, these will be included in the grey Organization line only.
environmentName
string Required
The environment that this is deploying to. We recommend only sending us deployments to your main production environment for an accurate indicator of Deployment Frequency. We don't filter on environmentName
.
If you send us deployments to multiple environments for the same commits, we will take the time of the latest deploy to calculate the Deploy Time
(and therefore Change Lead Time
) of a matched PR. This is because we assume the PR hasn't been fully released until it has been deployed to all environments.
If you send us deployments with the same commits and environment name, we will dedupe by taking the latest received deployment.
deployedAt
UTC datetime in ISO8601 format
The time of the deployment. Default: the timestamp that the POST request was received by our API
title
string
A title to give your deployment for easy identification on our drilldown tables. Default: the commit message of the matched commit with the most recent commit timestamp
tags
string
A custom field for you to add labels (e.g., ["is_fix", "is_failure", "sev1", "product_launch"]). In the future, we plan to support filtering on these labels. Default: none
Below is formatted as code
, response text
, description
201
, Created successfully
, Deploy registered successfully.
400
, Invalid request - {reason}
, The data is not in the expected format, the reason will explain which field is the issue
401
, Unauthorized
, API key not valid
403
, Forbidden
, API key does not have the correct scopes or organisation for this request or has been revoked
500
, Internal server error
. Please contact support@multitudes.co for more information. An unknown error has occurred, please contact support with the returned request ID for us to investigate.
--fail-with-body
flag to ensure cURL will exit with code 22 on an HTTP failure status code (>=400). Otherwise, you can look for a non-20x status code to detect a failure.
With a list of commit SHAs:
With a list of all SHAs since the last commit to this branch:
This is especially useful if your feature branches are merged to a develop/staging/test branch and then that branch is eventually merged into a "production" branch for deployment.
Example with a single commit SHA:
Example collecting all SHAs since the last commit to this branch: