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": "a875035f-e338-4289-9478-663448db0e3a",
"type": "alert_sources",
"attributes": {
"name": "Email Source 1",
"source_type": "email",
"status": "setup_incomplete",
"secret": "17f694d484af4647e59467293a7f99c3969ef544f5a32c68b15a7bd043c3a137",
"alert_urgency_id": "ddcd8523-5c87-445a-b108-07185e7175db",
"created_at": "2025-12-24T09:22:54.376-08:00",
"updated_at": "2025-12-24T09:22:54.378-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": "2025-12-24T09:22:54.381-08:00",
"updated_at": "2025-12-24T09:22:54.381-08:00",
"alert_field_id": "ec70f5c3-2767-4a9d-a9c1-10bebfd9a260",
"alert_field": {
"id": "ec70f5c3-2767-4a9d-a9c1-10bebfd9a260",
"slug": "description-field",
"name": "Description Field",
"kind": "description",
"created_at": "2025-12-24T09:22:52.923-08:00",
"updated_at": "2025-12-24T09:22:52.923-08:00"
}
},
{
"template_body": null,
"created_at": "2025-12-24T09:22:54.383-08:00",
"updated_at": "2025-12-24T09:22:54.383-08:00",
"alert_field_id": "87ffdecd-1063-4a62-a72e-34d56fd2fbb4",
"alert_field": {
"id": "87ffdecd-1063-4a62-a72e-34d56fd2fbb4",
"slug": "title-field",
"name": "Title Field",
"kind": "title",
"created_at": "2025-12-24T09:22:52.920-08:00",
"updated_at": "2025-12-24T09:22:52.920-08:00"
}
}
],
"sourceable_attributes": null,
"alert_template_attributes": null,
"resolution_rule_attributes": {
"id": "1b585e9e-8da0-4bc8-92a9-e4dece03bc48",
"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": "7543d360-92d4-4698-9295-24d755296c0b",
"field": "$.email.subject",
"operator": "is",
"value": "Resolved",
"conditionable_type": null,
"conditionable_id": null,
"kind": "payload"
}
]
},
"email": "email-source-d5a98489cdc213da6f54e7542a9308f6@test.email.rootly.com",
"accept_threaded_emails": false
},
"relationships": {
"alert_source_urgency_rules": {
"data": []
},
"alert_source_fields": {
"data": [
{
"id": "f5837066-af2f-4b90-b536-db83953a3ab7",
"alert_field_id": "ec70f5c3-2767-4a9d-a9c1-10bebfd9a260",
"alerts_source_id": "a875035f-e338-4289-9478-663448db0e3a",
"created_at": "2025-12-24T09:22:54.381-08:00",
"deleted_at": null,
"position": 1,
"template_body": null,
"updated_at": "2025-12-24T09:22:54.381-08:00"
},
{
"id": "e37035e6-9306-4de2-81c1-495ef4412f19",
"alert_field_id": "87ffdecd-1063-4a62-a72e-34d56fd2fbb4",
"alerts_source_id": "a875035f-e338-4289-9478-663448db0e3a",
"created_at": "2025-12-24T09:22:54.383-08:00",
"deleted_at": null,
"position": 2,
"template_body": null,
"updated_at": "2025-12-24T09:22:54.383-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": "a875035f-e338-4289-9478-663448db0e3a",
"type": "alert_sources",
"attributes": {
"name": "Email Source 1",
"source_type": "email",
"status": "setup_incomplete",
"secret": "17f694d484af4647e59467293a7f99c3969ef544f5a32c68b15a7bd043c3a137",
"alert_urgency_id": "ddcd8523-5c87-445a-b108-07185e7175db",
"created_at": "2025-12-24T09:22:54.376-08:00",
"updated_at": "2025-12-24T09:22:54.378-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": "2025-12-24T09:22:54.381-08:00",
"updated_at": "2025-12-24T09:22:54.381-08:00",
"alert_field_id": "ec70f5c3-2767-4a9d-a9c1-10bebfd9a260",
"alert_field": {
"id": "ec70f5c3-2767-4a9d-a9c1-10bebfd9a260",
"slug": "description-field",
"name": "Description Field",
"kind": "description",
"created_at": "2025-12-24T09:22:52.923-08:00",
"updated_at": "2025-12-24T09:22:52.923-08:00"
}
},
{
"template_body": null,
"created_at": "2025-12-24T09:22:54.383-08:00",
"updated_at": "2025-12-24T09:22:54.383-08:00",
"alert_field_id": "87ffdecd-1063-4a62-a72e-34d56fd2fbb4",
"alert_field": {
"id": "87ffdecd-1063-4a62-a72e-34d56fd2fbb4",
"slug": "title-field",
"name": "Title Field",
"kind": "title",
"created_at": "2025-12-24T09:22:52.920-08:00",
"updated_at": "2025-12-24T09:22:52.920-08:00"
}
}
],
"sourceable_attributes": null,
"alert_template_attributes": null,
"resolution_rule_attributes": {
"id": "1b585e9e-8da0-4bc8-92a9-e4dece03bc48",
"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": "7543d360-92d4-4698-9295-24d755296c0b",
"field": "$.email.subject",
"operator": "is",
"value": "Resolved",
"conditionable_type": null,
"conditionable_id": null,
"kind": "payload"
}
]
},
"email": "email-source-d5a98489cdc213da6f54e7542a9308f6@test.email.rootly.com",
"accept_threaded_emails": false
},
"relationships": {
"alert_source_urgency_rules": {
"data": []
},
"alert_source_fields": {
"data": [
{
"id": "f5837066-af2f-4b90-b536-db83953a3ab7",
"alert_field_id": "ec70f5c3-2767-4a9d-a9c1-10bebfd9a260",
"alerts_source_id": "a875035f-e338-4289-9478-663448db0e3a",
"created_at": "2025-12-24T09:22:54.381-08:00",
"deleted_at": null,
"position": 1,
"template_body": null,
"updated_at": "2025-12-24T09:22:54.381-08:00"
},
{
"id": "e37035e6-9306-4de2-81c1-495ef4412f19",
"alert_field_id": "87ffdecd-1063-4a62-a72e-34d56fd2fbb4",
"alerts_source_id": "a875035f-e338-4289-9478-663448db0e3a",
"created_at": "2025-12-24T09:22:54.383-08:00",
"deleted_at": null,
"position": 2,
"template_body": null,
"updated_at": "2025-12-24T09:22:54.383-08:00"
}
]
}
}
}
}