For the complete documentation index, see llms.txt. This page is also available as Markdown.

Deploy Registration

Use this endpoint with the POST method to register deploys.

Path

ENDPOINT

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

The endpoint path takes 2 slugs which direct the deploy 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/

Authentication

You can manage your org's tokens it in the Organization Settings -> Access Tokens page.

Parameters

Name
Type
Comments

sha*

string

The git SHA of the commit to be registered as a deploy.

Name
Type
Comments

environment

string

The environment to register the deploy against. If not provided Sleuth will use the default environment of the Project.

date

string

ISO 8601 deployment date and time string

branch

string

If your code deployment's target environment is mapped to a branch prefix (rather than a specific branch), you must include the deploy’s full branch name as the parameter branch.

tags

string

A single string or a comma-delimited list of tags. Defaults to tags calculated by matching paths defined in your .sleuth/TAGS file. ℹ️ Please note that tags must start with the # symbol, and can only contain:

  • lowercase letters,

  • numbers, and

  • symbols - and _ .

ignore_if_duplicate

string

If the value is provided and set to true Sleuth won't return a 400 error if we see a SHA that has already been registered.

email

string

Email address of author

links

string

A key/value pair consisting of the link name and the link itself in the following format:

mylink=http://my.link

If you need to send multiple then send a JSON body POST where the links are a dictionary of values.

commits

A list of commits to use instead of pulling the list of commits from the code repository. See the JSON schema for more details: https://app.sleuth.io/api/1/schema/register_deploy

files

A list of files included in the deploy, used instead of pulling the list of files from the commits. See the JSON schema for more details: https://app.sleuth.io/api/1/schema/register_deploy

pull_requests

A list of pull requests to use instead of pulling the list of pull requests from the code repository. See the JSON schema for more details: https://app.sleuth.io/api/1/schema/register_deploy

Code
Comments
Response Text

200

Deploy registered 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

Examples

cURL
cURL with optional Tags

ℹ️ Please note that tags must start with the # symbol, must be separated with commas, and cannot contain the . symbol.

PowerShell
cURL using Custom Git

{% code overflow="wrap" lineNumbers="true" %}

Last updated

Was this helpful?