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>",
"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": "a0ca94eb-d74f-451f-b4ab-2abe1d89c6ff",
"type": "alert_sources",
"attributes": {
"name": "Email Source 1",
"source_type": "email",
"status": "setup_incomplete",
"secret": "68fa0e2448c243d4489a5f491a680f28890ec2c987c4b10bab7f2c71725bf184",
"alert_urgency_id": "217acbda-17ba-42c6-ae9d-40dc90f7f1c4",
"created_at": "2025-08-28T04:32:19.138-07:00",
"updated_at": "2025-08-28T04:32:19.141-07: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-08-28T04:32:19.146-07:00",
"updated_at": "2025-08-28T04:32:19.146-07:00",
"alert_field_id": "81201730-bf15-4426-8958-57755cfb18c9",
"alert_field": {
"id": "81201730-bf15-4426-8958-57755cfb18c9",
"slug": "description-field",
"name": "Description Field",
"kind": "description",
"created_at": "2025-08-28T04:32:16.618-07:00",
"updated_at": "2025-08-28T04:32:16.618-07:00"
}
},
{
"template_body": null,
"created_at": "2025-08-28T04:32:19.151-07:00",
"updated_at": "2025-08-28T04:32:19.151-07:00",
"alert_field_id": "574a0a4e-2546-4a7f-9e70-f13362da2227",
"alert_field": {
"id": "574a0a4e-2546-4a7f-9e70-f13362da2227",
"slug": "title-field",
"name": "Title Field",
"kind": "title",
"created_at": "2025-08-28T04:32:16.614-07:00",
"updated_at": "2025-08-28T04:32:16.614-07:00"
}
}
],
"sourceable_attributes": null,
"alert_template_attributes": null,
"resolution_rule_attributes": {
"id": "1e09b2c6-83a3-4b10-8f29-9c890ab48bf6",
"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": "8a403a47-dd8c-4c3c-82b3-d31bdad0c7b5",
"field": "$.email.subject",
"operator": "is",
"value": "Resolved",
"conditionable_type": null,
"conditionable_id": null,
"kind": "payload"
}
]
},
"email": "email-source-62e7709fb24fba21eb9e7eda24245093@test.email.rootly.com",
"accept_threaded_emails": false
},
"relationships": {
"alert_source_urgency_rules": {
"data": []
},
"alert_source_fields": {
"data": [
{
"id": "976558c7-5eee-42b1-a4af-dbd958dae041",
"alert_field_id": "81201730-bf15-4426-8958-57755cfb18c9",
"alerts_source_id": "a0ca94eb-d74f-451f-b4ab-2abe1d89c6ff",
"created_at": "2025-08-28T04:32:19.146-07:00",
"deleted_at": null,
"position": 1,
"template_body": null,
"updated_at": "2025-08-28T04:32:19.146-07:00"
},
{
"id": "44ede63d-4759-40a6-8ef6-d5766e4f2550",
"alert_field_id": "574a0a4e-2546-4a7f-9e70-f13362da2227",
"alerts_source_id": "a0ca94eb-d74f-451f-b4ab-2abe1d89c6ff",
"created_at": "2025-08-28T04:32:19.151-07:00",
"deleted_at": null,
"position": 2,
"template_body": null,
"updated_at": "2025-08-28T04:32:19.151-07:00"
}
]
}
}
}
}
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
alert source created with resolution rule
The response is of type object
.
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>",
"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": "a0ca94eb-d74f-451f-b4ab-2abe1d89c6ff",
"type": "alert_sources",
"attributes": {
"name": "Email Source 1",
"source_type": "email",
"status": "setup_incomplete",
"secret": "68fa0e2448c243d4489a5f491a680f28890ec2c987c4b10bab7f2c71725bf184",
"alert_urgency_id": "217acbda-17ba-42c6-ae9d-40dc90f7f1c4",
"created_at": "2025-08-28T04:32:19.138-07:00",
"updated_at": "2025-08-28T04:32:19.141-07: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-08-28T04:32:19.146-07:00",
"updated_at": "2025-08-28T04:32:19.146-07:00",
"alert_field_id": "81201730-bf15-4426-8958-57755cfb18c9",
"alert_field": {
"id": "81201730-bf15-4426-8958-57755cfb18c9",
"slug": "description-field",
"name": "Description Field",
"kind": "description",
"created_at": "2025-08-28T04:32:16.618-07:00",
"updated_at": "2025-08-28T04:32:16.618-07:00"
}
},
{
"template_body": null,
"created_at": "2025-08-28T04:32:19.151-07:00",
"updated_at": "2025-08-28T04:32:19.151-07:00",
"alert_field_id": "574a0a4e-2546-4a7f-9e70-f13362da2227",
"alert_field": {
"id": "574a0a4e-2546-4a7f-9e70-f13362da2227",
"slug": "title-field",
"name": "Title Field",
"kind": "title",
"created_at": "2025-08-28T04:32:16.614-07:00",
"updated_at": "2025-08-28T04:32:16.614-07:00"
}
}
],
"sourceable_attributes": null,
"alert_template_attributes": null,
"resolution_rule_attributes": {
"id": "1e09b2c6-83a3-4b10-8f29-9c890ab48bf6",
"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": "8a403a47-dd8c-4c3c-82b3-d31bdad0c7b5",
"field": "$.email.subject",
"operator": "is",
"value": "Resolved",
"conditionable_type": null,
"conditionable_id": null,
"kind": "payload"
}
]
},
"email": "email-source-62e7709fb24fba21eb9e7eda24245093@test.email.rootly.com",
"accept_threaded_emails": false
},
"relationships": {
"alert_source_urgency_rules": {
"data": []
},
"alert_source_fields": {
"data": [
{
"id": "976558c7-5eee-42b1-a4af-dbd958dae041",
"alert_field_id": "81201730-bf15-4426-8958-57755cfb18c9",
"alerts_source_id": "a0ca94eb-d74f-451f-b4ab-2abe1d89c6ff",
"created_at": "2025-08-28T04:32:19.146-07:00",
"deleted_at": null,
"position": 1,
"template_body": null,
"updated_at": "2025-08-28T04:32:19.146-07:00"
},
{
"id": "44ede63d-4759-40a6-8ef6-d5766e4f2550",
"alert_field_id": "574a0a4e-2546-4a7f-9e70-f13362da2227",
"alerts_source_id": "a0ca94eb-d74f-451f-b4ab-2abe1d89c6ff",
"created_at": "2025-08-28T04:32:19.151-07:00",
"deleted_at": null,
"position": 2,
"template_body": null,
"updated_at": "2025-08-28T04:32:19.151-07:00"
}
]
}
}
}
}