Skip to main content
POST
/
v1
/
alert_sources
Creates an alert source
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": "c166ca1d-95a7-40a5-84d8-4abc0b7b8574",
    "type": "alert_sources",
    "attributes": {
      "name": "Email Source 1",
      "source_type": "email",
      "status": "setup_incomplete",
      "secret": "7bbbbec2e6d3a9f9545b859e40924cf4b3b00f28162a342003ee2a6ba55a1a19",
      "alert_urgency_id": "4e2e1088-164d-4833-83e9-dfd2a41fd91f",
      "created_at": "2025-10-30T19:47:31.421-07:00",
      "updated_at": "2025-10-30T19:47:31.424-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-10-30T19:47:31.429-07:00",
          "updated_at": "2025-10-30T19:47:31.429-07:00",
          "alert_field_id": "6179d78e-5463-4969-8c58-e94d4df4e121",
          "alert_field": {
            "id": "6179d78e-5463-4969-8c58-e94d4df4e121",
            "slug": "description-field",
            "name": "Description Field",
            "kind": "description",
            "created_at": "2025-10-30T19:47:29.082-07:00",
            "updated_at": "2025-10-30T19:47:29.082-07:00"
          }
        },
        {
          "template_body": null,
          "created_at": "2025-10-30T19:47:31.432-07:00",
          "updated_at": "2025-10-30T19:47:31.432-07:00",
          "alert_field_id": "3b7a8543-2f1f-4061-a008-6645a08bf4e3",
          "alert_field": {
            "id": "3b7a8543-2f1f-4061-a008-6645a08bf4e3",
            "slug": "title-field",
            "name": "Title Field",
            "kind": "title",
            "created_at": "2025-10-30T19:47:29.076-07:00",
            "updated_at": "2025-10-30T19:47:29.076-07:00"
          }
        }
      ],
      "sourceable_attributes": null,
      "alert_template_attributes": null,
      "resolution_rule_attributes": {
        "id": "0dcd3862-1dc7-4d5e-8c54-5d88f8d7bce3",
        "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": "f68e4912-5684-4268-940f-ef1585e8505c",
            "field": "$.email.subject",
            "operator": "is",
            "value": "Resolved",
            "conditionable_type": null,
            "conditionable_id": null,
            "kind": "payload"
          }
        ]
      },
      "email": "email-source-2de38b3f17d44360725f83531b3d0c13@test.email.rootly.com",
      "accept_threaded_emails": false
    },
    "relationships": {
      "alert_source_urgency_rules": {
        "data": []
      },
      "alert_source_fields": {
        "data": [
          {
            "id": "c3dc1e76-d0ff-4231-9795-e564e6be7b09",
            "alert_field_id": "6179d78e-5463-4969-8c58-e94d4df4e121",
            "alerts_source_id": "c166ca1d-95a7-40a5-84d8-4abc0b7b8574",
            "created_at": "2025-10-30T19:47:31.429-07:00",
            "deleted_at": null,
            "position": 1,
            "template_body": null,
            "updated_at": "2025-10-30T19:47:31.429-07:00"
          },
          {
            "id": "3b158f04-3935-4174-a0d1-a065c84e3a90",
            "alert_field_id": "3b7a8543-2f1f-4061-a008-6645a08bf4e3",
            "alerts_source_id": "c166ca1d-95a7-40a5-84d8-4abc0b7b8574",
            "created_at": "2025-10-30T19:47:31.432-07:00",
            "deleted_at": null,
            "position": 2,
            "template_body": null,
            "updated_at": "2025-10-30T19:47:31.432-07:00"
          }
        ]
      }
    }
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/vnd.api+json
data
object
required

Response

alert source created with resolution rule

data
object
required