Deployment API

Create a new deployment record in Hivel

Overview

The Hivel Deployment API enables the submission of deployment data to Hivel, allowing for precise calculation of metrics such as deployment frequency.

Endpoint

POST https://app.hivel.ai/hivelapi/v1/deployment

Request Parameters

Field Name
Type
Description
Example

repo_url

Required

string

The URL of the repository related to the deployment (max 255 chars).

commit_hash

Required

string

Git ref (i.e. commit short or long sha) associated with the deployment (max 255 chars).

d30b9416

timestamp

Required

string

The date and time when the deployment or incident occurred (ISO 8601 format).

2024-08-01T12:34:56Z

environment

Required

string

The target environment for the deployment (e.g., development, staging, production) (max 255 chars).

staging

build_number

string

An identifier for the build being deployed, useful for tracking and debugging.

build-2024-08-01-001

pr_number

string

The Pull Request (PR) identifier associated with the deployment.

44

Request Example

curl -X POST "https://app.hivel.ai/hivelapi/v1/deployment" \
     -H "Authorization: Bearer YOUR_API_TOKEN" \
     -H "Content-Type: application/json" \
     -d '{
           "repo_url": "https://github.com/your-repo/project.git",
           "commit_hash": "d30b9416",
           "timestamp": "2024-08-01T12:34:56Z",
           "environment": "staging",
           "build_number": "build-2024-08-01-001",
           "pr_number": "44"
         }'

Response

{
  "message": "Success",
  "deployment_id": 1245,
}
  • 400 - Bad Request

  • 401 - Unauthorized

  • 500 - Internal Server Error

Last updated

Was this helpful?