Creates a new alert source from provided data
curl --request POST \
--url https://api.rootly.com/v1/alert_sources \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/vnd.api+json' \
--data '
{
"data": {
"type": "alert_sources",
"attributes": {
"name": "<string>",
"source_type": "email",
"alert_urgency_id": "<string>",
"deduplicate_alerts_by_key": true,
"deduplication_key_kind": "payload",
"deduplication_key_path": "<string>",
"deduplication_key_regexp": "<string>",
"owner_group_ids": [
"<string>"
],
"alert_template_attributes": {
"title": "<string>",
"description": "<string>",
"external_url": "<string>"
},
"alert_source_urgency_rules_attributes": [
{
"json_path": "<string>",
"operator": "is",
"value": "<string>",
"conditionable_type": "AlertField",
"conditionable_id": "<string>",
"kind": "payload",
"alert_urgency_id": "<string>"
}
],
"sourceable_attributes": {
"auto_resolve": true,
"resolve_state": "<string>",
"accept_threaded_emails": true,
"field_mappings_attributes": [
{
"field": "external_id",
"json_path": "<string>"
}
]
},
"resolution_rule_attributes": {
"enabled": true,
"condition_type": "all",
"identifier_matchable_type": "AlertField",
"identifier_matchable_id": "<string>",
"identifier_reference_kind": "payload",
"identifier_json_path": "<string>",
"identifier_value_regex": "<string>",
"conditions_attributes": [
{
"field": "<string>",
"operator": "is",
"value": "<string>",
"conditionable_type": "AlertField",
"conditionable_id": "<string>",
"kind": "payload"
}
]
},
"alert_source_fields_attributes": [
{
"alert_field_id": "<string>",
"template_body": "<string>"
}
]
}
}
}
'{
"data": {
"id": "90a5cf02-f79f-4803-a825-4871f7549a36",
"type": "alert_sources",
"attributes": {
"name": "Email Source 1",
"source_type": "email",
"status": "setup_incomplete",
"secret": "ae010a5f42506d88c42b5a258ccad73fb0185c16022c8490442e97666563f576",
"alert_urgency_id": "81381c0d-b58d-4e16-8bc5-d16db2f14b9c",
"created_at": "2026-01-20T05:22:59.724-08:00",
"updated_at": "2026-01-20T05:22:59.728-08:00",
"webhook_endpoint": "http://localhost:3001/webhooks/incoming/generic_webhooks/notify/<TYPE>/<ID>",
"owner_group_ids": [],
"alert_source_urgency_rules_attributes": [],
"alert_source_fields_attributes": [
{
"template_body": null,
"created_at": "2026-01-20T05:22:59.732-08:00",
"updated_at": "2026-01-20T05:22:59.732-08:00",
"alert_field_id": "256ecf1c-6665-453d-94fe-c5b129528021",
"alert_field": {
"id": "256ecf1c-6665-453d-94fe-c5b129528021",
"slug": "description-field",
"name": "Description Field",
"kind": "description",
"created_at": "2026-01-20T05:22:58.250-08:00",
"updated_at": "2026-01-20T05:22:58.250-08:00"
}
},
{
"template_body": null,
"created_at": "2026-01-20T05:22:59.735-08:00",
"updated_at": "2026-01-20T05:22:59.735-08:00",
"alert_field_id": "4e5fa7d4-9529-4f2c-8fc7-5f9a418732ba",
"alert_field": {
"id": "4e5fa7d4-9529-4f2c-8fc7-5f9a418732ba",
"slug": "title-field",
"name": "Title Field",
"kind": "title",
"created_at": "2026-01-20T05:22:58.247-08:00",
"updated_at": "2026-01-20T05:22:58.247-08:00"
}
}
],
"sourceable_attributes": null,
"alert_template_attributes": null,
"resolution_rule_attributes": {
"id": "3225a04d-e2e3-4f2b-b173-3a6f87600b8e",
"enabled": true,
"condition_type": "all",
"identifier_json_path": "$.email.subject",
"identifier_value_regex": "",
"identifier_matchable_type": null,
"identifier_matchable_id": null,
"identifier_reference_kind": "payload",
"conditions_attributes": [
{
"id": "46373bce-815b-4c19-bd7e-5954df734602",
"field": "$.email.subject",
"operator": "is",
"value": "Resolved",
"conditionable_type": null,
"conditionable_id": null,
"kind": "payload"
}
]
},
"email": "email-source-7be7513580167004f240d87cdd09e9e4@test.email.rootly.com",
"accept_threaded_emails": false
},
"relationships": {
"alert_source_urgency_rules": {
"data": []
},
"alert_source_fields": {
"data": [
{
"id": "91fcbdd1-0a21-4c48-943a-479d59481e67",
"alert_field_id": "256ecf1c-6665-453d-94fe-c5b129528021",
"alerts_source_id": "90a5cf02-f79f-4803-a825-4871f7549a36",
"created_at": "2026-01-20T05:22:59.732-08:00",
"deleted_at": null,
"position": 1,
"template_body": null,
"updated_at": "2026-01-20T05:22:59.732-08:00"
},
{
"id": "75cc314c-65a0-4f11-87fa-ea9ca5145291",
"alert_field_id": "4e5fa7d4-9529-4f2c-8fc7-5f9a418732ba",
"alerts_source_id": "90a5cf02-f79f-4803-a825-4871f7549a36",
"created_at": "2026-01-20T05:22:59.735-08:00",
"deleted_at": null,
"position": 2,
"template_body": null,
"updated_at": "2026-01-20T05:22:59.735-08:00"
}
]
}
}
}
}Was this page helpful?
curl --request POST \
--url https://api.rootly.com/v1/alert_sources \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/vnd.api+json' \
--data '
{
"data": {
"type": "alert_sources",
"attributes": {
"name": "<string>",
"source_type": "email",
"alert_urgency_id": "<string>",
"deduplicate_alerts_by_key": true,
"deduplication_key_kind": "payload",
"deduplication_key_path": "<string>",
"deduplication_key_regexp": "<string>",
"owner_group_ids": [
"<string>"
],
"alert_template_attributes": {
"title": "<string>",
"description": "<string>",
"external_url": "<string>"
},
"alert_source_urgency_rules_attributes": [
{
"json_path": "<string>",
"operator": "is",
"value": "<string>",
"conditionable_type": "AlertField",
"conditionable_id": "<string>",
"kind": "payload",
"alert_urgency_id": "<string>"
}
],
"sourceable_attributes": {
"auto_resolve": true,
"resolve_state": "<string>",
"accept_threaded_emails": true,
"field_mappings_attributes": [
{
"field": "external_id",
"json_path": "<string>"
}
]
},
"resolution_rule_attributes": {
"enabled": true,
"condition_type": "all",
"identifier_matchable_type": "AlertField",
"identifier_matchable_id": "<string>",
"identifier_reference_kind": "payload",
"identifier_json_path": "<string>",
"identifier_value_regex": "<string>",
"conditions_attributes": [
{
"field": "<string>",
"operator": "is",
"value": "<string>",
"conditionable_type": "AlertField",
"conditionable_id": "<string>",
"kind": "payload"
}
]
},
"alert_source_fields_attributes": [
{
"alert_field_id": "<string>",
"template_body": "<string>"
}
]
}
}
}
'{
"data": {
"id": "90a5cf02-f79f-4803-a825-4871f7549a36",
"type": "alert_sources",
"attributes": {
"name": "Email Source 1",
"source_type": "email",
"status": "setup_incomplete",
"secret": "ae010a5f42506d88c42b5a258ccad73fb0185c16022c8490442e97666563f576",
"alert_urgency_id": "81381c0d-b58d-4e16-8bc5-d16db2f14b9c",
"created_at": "2026-01-20T05:22:59.724-08:00",
"updated_at": "2026-01-20T05:22:59.728-08:00",
"webhook_endpoint": "http://localhost:3001/webhooks/incoming/generic_webhooks/notify/<TYPE>/<ID>",
"owner_group_ids": [],
"alert_source_urgency_rules_attributes": [],
"alert_source_fields_attributes": [
{
"template_body": null,
"created_at": "2026-01-20T05:22:59.732-08:00",
"updated_at": "2026-01-20T05:22:59.732-08:00",
"alert_field_id": "256ecf1c-6665-453d-94fe-c5b129528021",
"alert_field": {
"id": "256ecf1c-6665-453d-94fe-c5b129528021",
"slug": "description-field",
"name": "Description Field",
"kind": "description",
"created_at": "2026-01-20T05:22:58.250-08:00",
"updated_at": "2026-01-20T05:22:58.250-08:00"
}
},
{
"template_body": null,
"created_at": "2026-01-20T05:22:59.735-08:00",
"updated_at": "2026-01-20T05:22:59.735-08:00",
"alert_field_id": "4e5fa7d4-9529-4f2c-8fc7-5f9a418732ba",
"alert_field": {
"id": "4e5fa7d4-9529-4f2c-8fc7-5f9a418732ba",
"slug": "title-field",
"name": "Title Field",
"kind": "title",
"created_at": "2026-01-20T05:22:58.247-08:00",
"updated_at": "2026-01-20T05:22:58.247-08:00"
}
}
],
"sourceable_attributes": null,
"alert_template_attributes": null,
"resolution_rule_attributes": {
"id": "3225a04d-e2e3-4f2b-b173-3a6f87600b8e",
"enabled": true,
"condition_type": "all",
"identifier_json_path": "$.email.subject",
"identifier_value_regex": "",
"identifier_matchable_type": null,
"identifier_matchable_id": null,
"identifier_reference_kind": "payload",
"conditions_attributes": [
{
"id": "46373bce-815b-4c19-bd7e-5954df734602",
"field": "$.email.subject",
"operator": "is",
"value": "Resolved",
"conditionable_type": null,
"conditionable_id": null,
"kind": "payload"
}
]
},
"email": "email-source-7be7513580167004f240d87cdd09e9e4@test.email.rootly.com",
"accept_threaded_emails": false
},
"relationships": {
"alert_source_urgency_rules": {
"data": []
},
"alert_source_fields": {
"data": [
{
"id": "91fcbdd1-0a21-4c48-943a-479d59481e67",
"alert_field_id": "256ecf1c-6665-453d-94fe-c5b129528021",
"alerts_source_id": "90a5cf02-f79f-4803-a825-4871f7549a36",
"created_at": "2026-01-20T05:22:59.732-08:00",
"deleted_at": null,
"position": 1,
"template_body": null,
"updated_at": "2026-01-20T05:22:59.732-08:00"
},
{
"id": "75cc314c-65a0-4f11-87fa-ea9ca5145291",
"alert_field_id": "4e5fa7d4-9529-4f2c-8fc7-5f9a418732ba",
"alerts_source_id": "90a5cf02-f79f-4803-a825-4871f7549a36",
"created_at": "2026-01-20T05:22:59.735-08:00",
"deleted_at": null,
"position": 2,
"template_body": null,
"updated_at": "2026-01-20T05:22:59.735-08:00"
}
]
}
}
}
}