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": "f44fccd6-5306-4831-bfc3-656e5379a581",
    "type": "alert_sources",
    "attributes": {
      "name": "Email Source 1",
      "source_type": "email",
      "status": "setup_incomplete",
      "secret": "8785422cfcc88e803a7de8ca9c618aeebc2401d5b28e0b8024539e61f9acba74",
      "alert_urgency_id": "905db275-d43e-493f-8f8a-29e3898d863b",
      "created_at": "2025-07-08T03:01:19.838-07:00",
      "updated_at": "2025-07-08T03:01:19.846-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-08T03:01:19.855-07:00",
          "updated_at": "2025-07-08T03:01:19.855-07:00",
          "alert_field_id": "a5237d6d-37b3-4423-b5ca-d4379d2588be",
          "alert_field": {
            "id": "a5237d6d-37b3-4423-b5ca-d4379d2588be",
            "slug": "description-field",
            "name": "Description Field",
            "kind": "description",
            "created_at": "2025-07-08T03:01:14.824-07:00",
            "updated_at": "2025-07-08T03:01:14.824-07:00"
          }
        },
        {
          "template_body": null,
          "created_at": "2025-07-08T03:01:19.863-07:00",
          "updated_at": "2025-07-08T03:01:19.863-07:00",
          "alert_field_id": "c3792665-5994-4178-b217-d4bc552b276e",
          "alert_field": {
            "id": "c3792665-5994-4178-b217-d4bc552b276e",
            "slug": "title-field",
            "name": "Title Field",
            "kind": "title",
            "created_at": "2025-07-08T03:01:14.818-07:00",
            "updated_at": "2025-07-08T03:01:14.818-07:00"
          }
        }
      ],
      "sourceable_attributes": null,
      "alert_template_attributes": null,
      "resolution_rule_attributes": {
        "id": "4b75224b-081c-443b-a6c8-c4fd3e8e9bab",
        "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": "9d1395ca-8085-464d-bc95-9afd8f034e62",
            "field": "$.email.subject",
            "operator": "is",
            "value": "Resolved",
            "conditionable_type": null,
            "conditionable_id": null,
            "kind": "payload"
          }
        ]
      },
      "email": "email-source-2c4d94375d487e5c805a450a25f789d3@test.email.rootly.com",
      "accept_threaded_emails": false
    },
    "relationships": {
      "alert_source_urgency_rules": {
        "data": []
      },
      "alert_source_fields": {
        "data": [
          {
            "id": "a7968cc2-ee1e-4132-9dde-500608637922",
            "template_body": null,
            "alerts_source_id": "f44fccd6-5306-4831-bfc3-656e5379a581",
            "alert_field_id": "a5237d6d-37b3-4423-b5ca-d4379d2588be",
            "deleted_at": null,
            "created_at": "2025-07-08T03:01:19.855-07:00",
            "updated_at": "2025-07-08T03:01:19.855-07:00",
            "position": 1
          },
          {
            "id": "5116f83d-68ea-4b3b-a7f4-1a3ceec94e5a",
            "template_body": null,
            "alerts_source_id": "f44fccd6-5306-4831-bfc3-656e5379a581",
            "alert_field_id": "c3792665-5994-4178-b217-d4bc552b276e",
            "deleted_at": null,
            "created_at": "2025-07-08T03:01:19.863-07:00",
            "updated_at": "2025-07-08T03:01:19.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.