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": "927770c8-0ed6-4f2b-b143-137da72b0b7f",
    "type": "alert_sources",
    "attributes": {
      "name": "Email Source 1",
      "source_type": "email",
      "status": "setup_incomplete",
      "secret": "eb42f8685e6ad3b13a4fa1daf09998de077db21bd16220026b83ae4466b9ce75",
      "alert_urgency_id": "eae7a8a9-b9b8-4b9d-8f72-51873e355020",
      "created_at": "2026-02-09T13:08:09.606-08:00",
      "updated_at": "2026-02-09T13:08:09.609-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-02-09T13:08:09.613-08:00",
          "updated_at": "2026-02-09T13:08:09.613-08:00",
          "alert_field_id": "988bf3e6-51b3-4693-9f23-b426467bfaa8",
          "alert_field": {
            "id": "988bf3e6-51b3-4693-9f23-b426467bfaa8",
            "slug": "description-field",
            "name": "Description Field",
            "kind": "description",
            "created_at": "2026-02-09T13:08:07.637-08:00",
            "updated_at": "2026-02-09T13:08:07.637-08:00"
          }
        },
        {
          "template_body": null,
          "created_at": "2026-02-09T13:08:09.616-08:00",
          "updated_at": "2026-02-09T13:08:09.616-08:00",
          "alert_field_id": "113d92f6-990c-458a-9dc1-94212c7e247e",
          "alert_field": {
            "id": "113d92f6-990c-458a-9dc1-94212c7e247e",
            "slug": "external-url-field",
            "name": "External URL Field",
            "kind": "external_url",
            "created_at": "2026-02-09T13:08:07.643-08:00",
            "updated_at": "2026-02-09T13:08:07.643-08:00"
          }
        },
        {
          "template_body": null,
          "created_at": "2026-02-09T13:08:09.619-08:00",
          "updated_at": "2026-02-09T13:08:09.619-08:00",
          "alert_field_id": "12b56b2a-dc24-4af4-a8fa-0f108ac09327",
          "alert_field": {
            "id": "12b56b2a-dc24-4af4-a8fa-0f108ac09327",
            "slug": "title-field",
            "name": "Title Field",
            "kind": "title",
            "created_at": "2026-02-09T13:08:07.633-08:00",
            "updated_at": "2026-02-09T13:08:07.633-08:00"
          }
        }
      ],
      "sourceable_attributes": null,
      "alert_template_attributes": null,
      "resolution_rule_attributes": {
        "id": "866e2248-55d6-4097-8c0c-f8b07d2128d0",
        "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": "717dd904-28fc-4667-a9c0-d7808feb5aa5",
            "field": "$.email.subject",
            "operator": "is",
            "value": "Resolved",
            "conditionable_type": null,
            "conditionable_id": null,
            "kind": "payload"
          }
        ]
      },
      "email": "email-source-a0eb6245e0de74848d276348eaa6512e@test.email.rootly.com",
      "accept_threaded_emails": false
    },
    "relationships": {
      "alert_source_urgency_rules": {
        "data": []
      },
      "alert_source_fields": {
        "data": [
          {
            "id": "9e66dbcd-0c42-466e-940c-94e07be6def1",
            "alert_field_id": "988bf3e6-51b3-4693-9f23-b426467bfaa8",
            "alerts_source_id": "927770c8-0ed6-4f2b-b143-137da72b0b7f",
            "created_at": "2026-02-09T13:08:09.613-08:00",
            "deleted_at": null,
            "position": 1,
            "template_body": null,
            "updated_at": "2026-02-09T13:08:09.613-08:00"
          },
          {
            "id": "f5f9a8c7-4eb9-42de-b928-166b9a744d45",
            "alert_field_id": "113d92f6-990c-458a-9dc1-94212c7e247e",
            "alerts_source_id": "927770c8-0ed6-4f2b-b143-137da72b0b7f",
            "created_at": "2026-02-09T13:08:09.616-08:00",
            "deleted_at": null,
            "position": 2,
            "template_body": null,
            "updated_at": "2026-02-09T13:08:09.616-08:00"
          },
          {
            "id": "13a69c0e-c08b-4261-8663-ad9b453a5a3a",
            "alert_field_id": "12b56b2a-dc24-4af4-a8fa-0f108ac09327",
            "alerts_source_id": "927770c8-0ed6-4f2b-b143-137da72b0b7f",
            "created_at": "2026-02-09T13:08:09.619-08:00",
            "deleted_at": null,
            "position": 3,
            "template_body": null,
            "updated_at": "2026-02-09T13:08:09.619-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