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>"
        }
      ],
      "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_json_path": "<string>",
        "identifier_value_regex": "<string>",
        "conditions_attributes": [
          {
            "field": "<string>",
            "operator": "is",
            "value": "<string>"
          }
        ]
      }
    }
  }
}'
{
  "data": {
    "id": "96a9470e-394e-4c99-8af4-31991d55d506",
    "type": "alert_sources",
    "attributes": {
      "name": "Email Source 1",
      "source_type": "email",
      "status": "setup_incomplete",
      "secret": "65deee8e36c472b708ae876e87238fac52bd3b159a6856a68397fddfea2a6274",
      "alert_urgency_id": "1fa0ca80-6b51-4614-9439-13955cce57a0",
      "created_at": "2025-05-08T00:16:19.887-07:00",
      "updated_at": "2025-05-08T00:16:19.887-07:00",
      "webhook_endpoint": "http://localhost:3001/webhooks/incoming/generic_webhooks/notify/<TYPE>/<ID>",
      "owner_group_ids": [],
      "alert_source_urgency_rules_attributes": [],
      "sourceable_attributes": null,
      "alert_template_attributes": null,
      "resolution_rule_attributes": {
        "id": "30ea3f99-6cf2-49f4-987d-9d51b50f9614",
        "enabled": true,
        "condition_type": "all",
        "identifier_json_path": "$.email.subject",
        "identifier_value_regex": "",
        "conditions_attributes": [
          {
            "id": "dfb06f55-d4e3-4114-9e09-2b75801e1904",
            "field": "$.email.subject",
            "operator": "is",
            "value": "Resolved"
          }
        ]
      },
      "email": "email-source-7a24c81c2ecda29ef395635b8a72c4fc@test.email.rootly.com",
      "accept_threaded_emails": false
    },
    "relationships": {
      "alert_source_urgency_rules": {
        "data": []
      }
    }
  }
}

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.