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 what we measure and why). Note that our data pipeline runs every 6 hours so you may need to wait to see data after you start sending.
NOTE: 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. Note that we include all data POSTed in our metric calculations, so you may want to send us only deployments in your production environment, see more details here.
{% code-block language="shell" %}
https://api.developer.multitudes.co/deployments
{% end-code-block %}
commit_sha
field, we will assume the repository of the first commit in the list.environmentName
.Below is formatted as code, response text, description
--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 single commit SHA:
{% code-block language="shell" %}
curl --request POST \
--fail-with-body \
--url "https://api.developer.multitudes.co/deployments" \
--header "Content-Type: application/json" \
--header "Authorization: $MULTITUDES_ACCESS_TOKEN" \
--data '{"commitSha": "$COMMIT_SHA", "environmentName":"$ENVIRONMENT"}'
{% end-code-block %}
With a list of commit SHAs:
{% code-block language="shell" %}
curl --request POST \
--fail-with-body \
--url "https://api.developer.multitudes.co/deployments" \
--header "Content-Type: application/json" \
--header "Authorization: $MULTITUDES_ACCESS_TOKEN" \
--data '{
"commitSha": [
"8750d79cce5f2d137c3f4a34cdd4c9da76c26cfb",
"561b41361698b579e40f0f9a68491a0e64f48849"
],
"environmentName": "test"
}'
{% end-code-block %}
Example with a single commit SHA:
{% code-block language="shell" %}
jobs:
log-deployment:
runs-on: ubuntu-latest
needs: [ <DEPLOYMENT_JOB> ]
environment: ${{ inputs.environment }}
steps:
- run: |
curl --request POST \
--fail-with-body \
--url "https://api.developer.multitudes.co/deployments" \
--header "Content-Type: application/json" \
--header "Authorization: ${{ secrets.MULTITUDES_ACCESS_TOKEN }}" \
--data '{"commitSha": "${{github.sha}}","environmentName": "${{inputs.environment}}"}'
{% end-code-block %}