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": "2b550a91-06d9-4f76-9845-65a3bd1c9a7b",
    "type": "alert_sources",
    "attributes": {
      "name": "Email Source 1",
      "source_type": "email",
      "status": "setup_incomplete",
      "secret": "f62ad707fdb6993d89811d89089a8cefeb553ab415d63ee1ea4a678062cfdab3",
      "alert_urgency_id": "1dcaf876-61b3-441c-903e-7b6b7c325f18",
      "created_at": "2025-12-10T18:22:07.519-08:00",
      "updated_at": "2025-12-10T18:22:07.523-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-10T18:22:07.527-08:00",
          "updated_at": "2025-12-10T18:22:07.527-08:00",
          "alert_field_id": "afc44e1f-90c5-4a70-ac14-8177fe7a1364",
          "alert_field": {
            "id": "afc44e1f-90c5-4a70-ac14-8177fe7a1364",
            "slug": "description-field",
            "name": "Description Field",
            "kind": "description",
            "created_at": "2025-12-10T18:22:05.289-08:00",
            "updated_at": "2025-12-10T18:22:05.289-08:00"
          }
        },
        {
          "template_body": null,
          "created_at": "2025-12-10T18:22:07.533-08:00",
          "updated_at": "2025-12-10T18:22:07.533-08:00",
          "alert_field_id": "ef315b78-3cdb-4be9-81ae-e3db21814a0d",
          "alert_field": {
            "id": "ef315b78-3cdb-4be9-81ae-e3db21814a0d",
            "slug": "title-field",
            "name": "Title Field",
            "kind": "title",
            "created_at": "2025-12-10T18:22:05.281-08:00",
            "updated_at": "2025-12-10T18:22:05.281-08:00"
          }
        }
      ],
      "sourceable_attributes": null,
      "alert_template_attributes": null,
      "resolution_rule_attributes": {
        "id": "e6a96647-4630-4001-bf2b-d24cd3c01e86",
        "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": "4cfb2a5c-8c39-4db0-add8-68597e5b12fe",
            "field": "$.email.subject",
            "operator": "is",
            "value": "Resolved",
            "conditionable_type": null,
            "conditionable_id": null,
            "kind": "payload"
          }
        ]
      },
      "email": "email-source-4f0470dd45c788369ee0071ab986ecb3@test.email.rootly.com",
      "accept_threaded_emails": false
    },
    "relationships": {
      "alert_source_urgency_rules": {
        "data": []
      },
      "alert_source_fields": {
        "data": [
          {
            "id": "f1a6c65e-272e-4f70-92f9-f02d1130caf6",
            "alert_field_id": "afc44e1f-90c5-4a70-ac14-8177fe7a1364",
            "alerts_source_id": "2b550a91-06d9-4f76-9845-65a3bd1c9a7b",
            "created_at": "2025-12-10T18:22:07.527-08:00",
            "deleted_at": null,
            "position": 1,
            "template_body": null,
            "updated_at": "2025-12-10T18:22:07.527-08:00"
          },
          {
            "id": "17be764a-f21a-482e-a884-a1c43b4ea543",
            "alert_field_id": "ef315b78-3cdb-4be9-81ae-e3db21814a0d",
            "alerts_source_id": "2b550a91-06d9-4f76-9845-65a3bd1c9a7b",
            "created_at": "2025-12-10T18:22:07.533-08:00",
            "deleted_at": null,
            "position": 2,
            "template_body": null,
            "updated_at": "2025-12-10T18:22:07.533-08: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