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": "eafd803e-49c4-4565-888b-7114f8f1dd18",
    "type": "alert_sources",
    "attributes": {
      "name": "Email Source 1",
      "source_type": "email",
      "status": "setup_incomplete",
      "secret": "46ffa15107bf52f96a84ac8e8941304a78196648d5901b132cff88e045aa44fa",
      "alert_urgency_id": "8f0fbde9-1952-46a4-b9b2-c7aa40c54393",
      "created_at": "2025-05-29T17:40:20.851-07:00",
      "updated_at": "2025-05-29T17:40:20.851-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": "aaa5da68-9c49-4a67-9cb4-f827bbe3ca9a",
        "enabled": true,
        "condition_type": "all",
        "identifier_json_path": "$.email.subject",
        "identifier_value_regex": "",
        "conditions_attributes": [
          {
            "id": "e8201ba0-c4dd-431b-9795-e1a9192078cb",
            "field": "$.email.subject",
            "operator": "is",
            "value": "Resolved"
          }
        ]
      },
      "email": "email-source-d1f35dda0a3a32275f7f226e1bd0b020@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.