Sleuth Documentation
HomeBlogSupportSign up
  • Getting started
  • Navigating Sleuth
  • DORA metrics
    • Deploy frequency
    • Change lead time
    • Change failure rate
    • MTTR
    • Interpreting Metrics in Sleuth
  • Deployment tracking
    • Organization
      • Labels
      • Trends
      • Compare
      • Search
      • Status
    • Projects
      • Issue trackers
    • Environments
    • Code deployments
      • Creating a deployment
      • How to register a deploy
      • Rollbacks
      • Automatic tagging
      • Deployment locking
      • Environment drift
      • Move code deployments
      • Search everything
    • Feature flags
    • Manual changes
    • Deploys
    • Teams
  • Work in Progress
  • Goals
  • Sleuth Automations
    • Automations Marketplace
      • Installing Automations
        • Installing PR "Update" Automations
      • Editing and uninstalling Automations
      • Smart suggestions
      • Understanding efficacy
    • Custom Automations
      • Automations Cookbook
      • Webhook Actions
      • Trigger Build Actions
        • Bitbucket Pipelines
        • CircleCI
        • Github Actions
        • Jenkins
  • Slack & Email Notifications
  • Auto-verify deploys
    • Anomaly detection
    • Error impact
    • Metric impact
  • Ignoring pull requests
  • Slack mission control
    • Approvals
    • Project notifications
    • Personal notifications
    • Search Sleuth in Slack
    • Project/Deployment history
    • Developer standup
  • Sleuth API
    • Deploy Registration
    • Deploy import
    • Manual Change
    • Custom Incident Impact Registration
    • Custom Metric Impact Registration
    • Deprecation information
    • GraphQL Queries
    • GraphQL Mutations
    • Query batching
  • Integrations
    • About Integrations...
    • Code integrations (read-only)
      • Azure DevOps
      • Bitbucket
      • GitHub
      • GitLab
      • Custom Git
      • Terraform Cloud
    • Code integrations (write)
    • Feature flag integrations
      • LaunchDarkly
    • Impact integrations
      • Error trackers
        • Bugsnag
        • Honeybadger
        • Rollbar
        • Sentry
      • Metric trackers
        • AppDynamics
        • AWS CloudWatch
        • Custom
        • Datadog
        • Jira metrics (Cloud / Data Center)
        • NewRelic
        • SignalFx
      • Incident tracker integrations
        • Blameless
        • PagerDuty
        • Datadog Monitors
        • Statuspage
        • Opsgenie
        • Jira (Cloud/Data Center)
        • FireHydrant
        • Rootly
        • ServiceNow
        • Custom
          • Grafana OnCall
      • CI/CD builds
        • Azure Pipelines
        • Bitbucket Pipelines
        • Buildkite
        • CircleCI
        • GitHub Actions
        • GitLab CI/CD Pipelines
        • Jenkins
    • Sleuth DORA App for Slack
    • Microsoft Teams integration
    • CI/CD integrations
      • Azure Pipelines
      • Bitbucket Pipelines
      • Buildkite
      • CircleCI
      • Github Actions
      • GitLab CI/CD Pipelines
      • Jenkins
    • Issue tracker integrations
      • Jira Cloud
      • Jira Data Center
      • Linear
      • Shortcut
    • Fixing broken integrations
  • Pulse
    • Welcome to Pulse docs
    • Quick Start setup guide
    • Beginner tutorials
      • 1. How to create a Teamspace
      • 2. How to create a Review
      • 3. How to create a Survey
  • Features
    • Reviews
      • Review workflow
      • Review templates
      • Widgets and Sections
        • Widget type
      • Review settings
    • Surveys
      • Survey Workflow
    • Teamspaces
    • Inbox
    • AI assistant
    • General settings
      • Users and Teams
      • Investment mix
  • Settings
    • Organization settings
      • Details
      • Authentication
        • SAML 2.0 Setup
          • Okta Configuration
          • Azure AD Configuration
          • PingIdentity Configuration
      • Access Tokens
      • Members
      • Team Settings
      • Billing
    • Project settings
      • Details
      • Slack settings
      • Environment settings
      • Code deployment settings
      • Feature flag settings
      • Impact settings
    • Account settings
      • Account settings
      • Notifications settings
      • Identities settings
    • Role Based Access Control
  • Resources
    • FAQ
    • Sleuth TV
    • Purchasing
    • About Sleuth...
Powered by GitBook
On this page
  • Path
  • Parameters
  • CSV File Structure
  • Examples

Was this helpful?

  1. Sleuth API

Deploy import

Use this endpoint to import deploys using a CSV file.

Delete all existing deploys in your Code Deployment and create a new history with only the deploys you specify via a CSV file. This might be useful if you wish to populate more than the default 28-days' worth of data when creating a new Code Deployment in Sleuth, or when you want to only import specific deploys, and don't want to register them individually.

Path

ENDPOINT

https://app.sleuth.io/api/1/deployments/ORG_SLUG/DEPLOYMENT_SLUG/import_deploys

The endpoint path takes 2 slugs which direct the deploys to the correct code deployment:

  • ORG_SLUG: found in the URL of your Sleuth org, immediately following https://app.sleuth.io/

  • DEPLOYMENT_SLUG: found in the URL, following the prefix https://app.sleuth.io/org_slug/deployments/

Parameters

Name
Type
Comments

api_key*

string

Can be found in the Organization Settings -> Details -> Api Key field in your Sleuth org.

csv_file*

file

The attached CSV file containing the list of deploys to import.

environment

string

The Sleuth environment slug. Defaults to the primary environment of the project.

Code
Comments
Response Text

200

Deploys imported successfully.

Success

400

Returned if any of the input parameters are invalid, e.g.: - sha isn't provided - branch doesn't match the configured branch - date format isn't valid - author is not a valid email - we're unable to validate if the sha exists in the remote system

The response text will indicate the nature of the error:

String of message problem

401

API key not valid or the deployment is not in the specified organization

String of message problem

Importing deploys into a pre-populated code deployment will delete all existing deploys in that code deployment and create a new history with only the deploys specified in the CSV file.

CSV File Structure

Example CSV file
sha,date 
3c02378,2002-04-03T08:34:02 
6f0d7cf,2002-04-01T15:03:55

Examples

Make sure you replace the values surrounded by< and >with your own values. Adjust the csv_file path accordingly or run the command from the directory that contains the csv_file.

When using the Organization API token found under Organization Settings > Details, the Authorization header needs to pass the API key via apikey e.g. Authorization: apikey <APIKEY>

When using API tokens created under Organization Settings > Access Tokens the Authorization header needs to pass the API token via Bearer e.g. Authorization: Bearer <API_TOKEN>

cURL with API key in Header
curl \
'https://app.sleuth.io/api/1/deployments/<ORG_SLUG>/<DEPLOYMENT_SLUG>/import_deploys' \
  -H 'Authorization: apikey <APIKEY>' \
  -F 'csv_file=@<FILENAME>.csv'
cURL with API key in Body
curl \
'https://app.sleuth.io/api/1/deployments/<ORG_SLUG>/<DEPLOYMENT_SLUG>/import_deploys' \
  -F 'api_key=<API_KEY>' \
  -F 'csv_file=@<FILENAME>.csv'
PreviousDeploy RegistrationNextManual Change

Last updated 8 months ago

Was this helpful?

The deploys should be imported using a CSV file that is uploaded as part of the request. The CSV file should contain the headers sha and date, the sha column should contain the full SHA of the commits at the point of release, and the date column should contain the date and time of the deploy in the format.

ISO 8601