POST
/
v1
/
alert_sources
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": "ddfa7c91-b70b-4f26-b4dd-5187ff64b7a4",
    "type": "alert_sources",
    "attributes": {
      "name": "Email Source 1",
      "source_type": "email",
      "status": "setup_incomplete",
      "secret": "4ea5588c3fcb8b87e917fcabb1a776927c44b05ad9d8869d0a0cc26f063dec72",
      "alert_urgency_id": "e244cf1d-22a8-4efe-b6cf-67f219247926",
      "created_at": "2025-07-06T14:05:37.845-07:00",
      "updated_at": "2025-07-06T14:05:37.851-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-07-06T14:05:37.858-07:00",
          "updated_at": "2025-07-06T14:05:37.858-07:00",
          "alert_field_id": "6fbd9ca4-52bc-4f04-8383-267117b77416",
          "alert_field": {
            "id": "6fbd9ca4-52bc-4f04-8383-267117b77416",
            "slug": "description-field",
            "name": "Description Field",
            "kind": "description",
            "created_at": "2025-07-06T14:05:34.301-07:00",
            "updated_at": "2025-07-06T14:05:34.301-07:00"
          }
        },
        {
          "template_body": null,
          "created_at": "2025-07-06T14:05:37.863-07:00",
          "updated_at": "2025-07-06T14:05:37.863-07:00",
          "alert_field_id": "e8583ef3-3b3d-464b-8a9b-be025c517fc5",
          "alert_field": {
            "id": "e8583ef3-3b3d-464b-8a9b-be025c517fc5",
            "slug": "title-field",
            "name": "Title Field",
            "kind": "title",
            "created_at": "2025-07-06T14:05:34.294-07:00",
            "updated_at": "2025-07-06T14:05:34.294-07:00"
          }
        }
      ],
      "sourceable_attributes": null,
      "alert_template_attributes": null,
      "resolution_rule_attributes": {
        "id": "dfd00568-4f58-4686-b591-f943d333601b",
        "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": "a55a7e87-69bf-448d-8958-5aa7574fcfe5",
            "field": "$.email.subject",
            "operator": "is",
            "value": "Resolved",
            "conditionable_type": null,
            "conditionable_id": null,
            "kind": "payload"
          }
        ]
      },
      "email": "email-source-9dbb027ba8e32a6a2b7117b0f618986a@test.email.rootly.com",
      "accept_threaded_emails": false
    },
    "relationships": {
      "alert_source_urgency_rules": {
        "data": []
      },
      "alert_source_fields": {
        "data": [
          {
            "id": "1aae53a7-b931-4388-8aeb-cebb49a82cb9",
            "template_body": null,
            "alerts_source_id": "ddfa7c91-b70b-4f26-b4dd-5187ff64b7a4",
            "alert_field_id": "6fbd9ca4-52bc-4f04-8383-267117b77416",
            "deleted_at": null,
            "created_at": "2025-07-06T14:05:37.858-07:00",
            "updated_at": "2025-07-06T14:05:37.858-07:00",
            "position": 1
          },
          {
            "id": "45251719-9c8e-4998-947a-6992da8d3885",
            "template_body": null,
            "alerts_source_id": "ddfa7c91-b70b-4f26-b4dd-5187ff64b7a4",
            "alert_field_id": "e8583ef3-3b3d-464b-8a9b-be025c517fc5",
            "deleted_at": null,
            "created_at": "2025-07-06T14:05:37.863-07:00",
            "updated_at": "2025-07-06T14:05:37.863-07:00",
            "position": 2
          }
        ]
      }
    }
  }
}

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.