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>",
      "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": "9f65d07f-5d16-4e49-a303-7c6f8882f8b9",
    "type": "alert_sources",
    "attributes": {
      "name": "Email Source 1",
      "source_type": "email",
      "status": "setup_incomplete",
      "secret": "c6a12c92d7cc8d49d6e0e3df932a95874960b16e96338b64df9a52a1c14b599c",
      "alert_urgency_id": "78bd3bdf-4e87-46eb-b0d5-0f3c5f4fccef",
      "created_at": "2025-08-07T22:33:45.579-07:00",
      "updated_at": "2025-08-07T22:33:45.589-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-07T22:33:45.600-07:00",
          "updated_at": "2025-08-07T22:33:45.600-07:00",
          "alert_field_id": "2d573233-e286-49a6-be88-d8fbc227cc0b",
          "alert_field": {
            "id": "2d573233-e286-49a6-be88-d8fbc227cc0b",
            "slug": "description-field",
            "name": "Description Field",
            "kind": "description",
            "created_at": "2025-08-07T22:33:42.330-07:00",
            "updated_at": "2025-08-07T22:33:42.330-07:00"
          }
        },
        {
          "template_body": null,
          "created_at": "2025-08-07T22:33:45.613-07:00",
          "updated_at": "2025-08-07T22:33:45.613-07:00",
          "alert_field_id": "4b374f0e-3f6e-4c71-af01-0896cd2aa7cb",
          "alert_field": {
            "id": "4b374f0e-3f6e-4c71-af01-0896cd2aa7cb",
            "slug": "title-field",
            "name": "Title Field",
            "kind": "title",
            "created_at": "2025-08-07T22:33:42.322-07:00",
            "updated_at": "2025-08-07T22:33:42.322-07:00"
          }
        }
      ],
      "sourceable_attributes": null,
      "alert_template_attributes": null,
      "resolution_rule_attributes": {
        "id": "9a600b01-87a2-43d0-98d9-01cfd38b220b",
        "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": "15579203-d433-4154-b93f-7d05b25a50a5",
            "field": "$.email.subject",
            "operator": "is",
            "value": "Resolved",
            "conditionable_type": null,
            "conditionable_id": null,
            "kind": "payload"
          }
        ]
      },
      "email": "email-source-815cb1259ac564512282f4003a55b44a@test.email.rootly.com",
      "accept_threaded_emails": false
    },
    "relationships": {
      "alert_source_urgency_rules": {
        "data": []
      },
      "alert_source_fields": {
        "data": [
          {
            "id": "3e28ba68-ea79-49b3-a097-2b6243dc6f44",
            "alert_field_id": "2d573233-e286-49a6-be88-d8fbc227cc0b",
            "alerts_source_id": "9f65d07f-5d16-4e49-a303-7c6f8882f8b9",
            "created_at": "2025-08-07T22:33:45.600-07:00",
            "deleted_at": null,
            "position": 1,
            "template_body": null,
            "updated_at": "2025-08-07T22:33:45.600-07:00"
          },
          {
            "id": "aad49edf-c8de-493f-8d2a-66f77d8e4b24",
            "alert_field_id": "4b374f0e-3f6e-4c71-af01-0896cd2aa7cb",
            "alerts_source_id": "9f65d07f-5d16-4e49-a303-7c6f8882f8b9",
            "created_at": "2025-08-07T22:33:45.613-07:00",
            "deleted_at": null,
            "position": 2,
            "template_body": null,
            "updated_at": "2025-08-07T22:33:45.613-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

Response

201
application/vnd.api+json

alert source created with resolution rule

The response is of type object.