Create Incident API

Overview

The Hivel Incident API enables submitting incident data to Hivel, allowing for precise calculation of metrics such as CFR (Change Failure Rate) and MTTR (Mean Time to Recovery).


🔗 Base URL

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

🔑 Authentication

All requests require an organization API token. Pass this in the request header:

Authorization: YOUR_ORGANIZATION_API_TOKEN

Retrieving Your API Key

  1. Open Hivel and navigate to Integrations under the Settings.

  2. Click on Connect on Hivel API Authorization card

  3. Follow the given steps to start your integration

  4. By clicking on Generate your API Key will be generated.


Incident Events API

Endpoint

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

Request Parameters

Field Name
Type
Description
Example

description

string

A detailed description of the incident (max 255 chars).

Database connection timeout error

severity

Required

string

The severity level of the incident (e.g., low, medium, high, critical) (max 255 chars).

high

affected_systems

array

A list of systems affected by the incident.

["database", "backend"]

reported_time

Required

string

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

2024-08-01T12:34:56Z

reported_by

string

The username or identifier of the person who reported the incident (max 255 chars).

jdoe

resolution_time

Required

string

The date and time when the incident was resolved (ISO 8601 format).

2024-08-01T13:34:56Z

provider_id

string

The unique identifier of the incident in your incident management provider (max 255 chars).

incident-123456

repo_url

Required

string

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

pr_number

Required

string

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

44

Request Example

curl -X POST "https://app.hivel.ai/hivelapi/v1/incident" \
     -H "Authorization: Bearer YOUR_API_TOKEN" \
     -H "Content-Type: application/json" \
     -d '{
           "description": "Database connection timeout error",
           "severity": "high",
           "affected_systems": ["database", "backend"],
           "reported_time": "2024-08-01T12:34:56Z",
           "reported_by": "jdoe",
           "resolution_time": "2024-08-01T13:34:56Z",
           "provider_id": "incident-123456",
           "pr_number": “44”	
           "repo_url": "https://github.com/your-repo/project.git",
         }'

Response

{
  "message": "Success",
  "incident_id": "incident-2024-08-01-12345",
}
  • 400 - Bad Request

  • 401 - Unauthorized

  • 500 - Internal Server Error

Last updated

Was this helpful?