Overview
The Rootly API allows you to create incidents automatically from monitoring tools, CI/CD pipelines, internal services, or any external automation system. This is the preferred method when you need:- Deterministic and repeatable incident creation
- Automated declarations from alerting or detection systems
- Consistent metadata applied across incidents
- The ability to create sub-incidents within orchestrated workflows
- Fully headless incident creation with no human intervention
Before You Begin
Before creating incidents via API, ensure you have:- A Rootly API token with permissions to create incidents
- Knowledge of any required fields (severity, type, environments, etc.)
-
IDs for any contextual fields you intend to populate:
- Services
- Functionalities
- Environments
- Groups
- Incident types
- Custom form fields
-
The Create Incident endpoint reference:
POST /api/v1/incidents
Creating an Incident via API
1
Send a POST request to the Create Incident endpoint
Requests must include:Any HTTP client or automation system (Python, curl, Terraform, GitHub Actions, etc.) will work.
2
Include the required and optional fields
Below are the commonly used fields.Core fields
titlesummaryseverity_idincident_type_idsprivate(boolean)notify_emails(array — used by workflows, not auto-emailed by default)
service_idsfunctionality_idsenvironment_idsgroup_ids
form_field_selections_attributes to populate custom data.Supports all field types: text, dropdowns, multi-select, relations, user selectors, catalog entities, etc.Optional advanced fieldsparent_incident_id— creates a sub-incidentcreate_test_incident— only works if the Test Incidents feature is enabledmitigation_message,resolution_message,cancellation_message- Lifecycle timestamps (advanced):
in_triage_at,started_at,mitigated_at,resolved_at,closed_at
To create sub-incidents programmatically, provide
parent_incident_id. Rootly automatically links the child to the parent.3
Review the API response
A successful response includes:
- The incident ID
- Lifecycle status
- Timestamps
- A URL to open the incident in the web app
- Slack channel details (if Slack is integrated + auto-create enabled)
- Posting timeline entries
- Updating lifecycle status
- Attaching alerts
- Triggering or monitoring workflows
Example Request Payloads
Basic exampleValidation & Error Handling
Rootly returns standard error responses for debugging and automation safety. 401 UnauthorizedTroubleshooting
“Missing required fields”
“Missing required fields”
Ensure required fields in Forms or Required Fields are included.
“Workflows didn’t run”
“Workflows didn’t run”
Check that workflow conditions (severity, type, service, etc.) match the payload.
“Slack channel not created”
“Slack channel not created”
Verify:
- Slack is connected
- Auto-create channels is enabled
- Incident is not private (depending on settings)
“Sub-incident didn’t link”
“Sub-incident didn’t link”
Make sure
parent_incident_id is passed correctly.Best Practices
- Pre-fill key metadata to streamline response
- Use structured fields (services, environments, types) for better analytics
- Use private incidents for security-sensitive or customer-specific events
- Follow consistent naming conventions across automated incidents
- Use idempotency keys to prevent duplication
- Automate creation of sub-incidents for multi-team or multi-domain issues
- Avoid manually setting lifecycle timestamps unless necessary

