POST
/
v1
/
alert_sources
curl --request POST \
  --url https://api.rootly.com/v1/alert_sources \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
  --header 'content-type: application/vnd.api+json'
{
  "data": {
    "id": "365e2c73-d1f5-4287-b916-1639c5a1a83e",
    "type": "alert_sources",
    "attributes": {
      "name": "GW 1",
      "source_type": "generic_webhook",
      "status": "setup_incomplete",
      "secret": "bac4bae56299a20d64a264383f68f7fcfb882a4d97697feb79fb8f8e5e5e4796",
      "alert_urgency_id": "03927998-30b3-498c-b209-563d9b1c5569",
      "created_at": "2025-03-13T11:58:46.764-07:00",
      "updated_at": "2025-03-13T11:58:46.764-07:00",
      "webhook_endpoint": "http://localhost:3001/webhooks/incoming/generic_webhooks/notify/<TYPE>/<ID>",
      "sourceable_attributes": {
        "id": "c6c486cc-f0c0-44a0-a6ec-9ddd0582ac6e",
        "auto_resolve": true,
        "resolve_state": "fixed",
        "created_at": "2025-03-13T11:58:46.742-07:00",
        "updated_at": "2025-03-13T11:58:46.757-07:00",
        "field_mappings_attributes": [
          {
            "id": "addec42e-6cae-4615-abd8-11f7fae29c95",
            "json_path": "$.alert_title",
            "field": "alert_title",
            "alerts_generic_webhook_source_id": "c6c486cc-f0c0-44a0-a6ec-9ddd0582ac6e",
            "deleted_at": null,
            "created_at": "2025-03-13T11:58:46.748-07:00",
            "updated_at": "2025-03-13T11:58:46.748-07:00"
          },
          {
            "id": "deed239c-f25e-46d1-8098-9a5668ad929a",
            "json_path": "$.target_id",
            "field": "notification_target_id",
            "alerts_generic_webhook_source_id": "c6c486cc-f0c0-44a0-a6ec-9ddd0582ac6e",
            "deleted_at": null,
            "created_at": "2025-03-13T11:58:46.753-07:00",
            "updated_at": "2025-03-13T11:58:46.753-07:00"
          },
          {
            "id": "f12e393c-5d2b-471c-bf98-842e68ebb742",
            "json_path": "$.target_type",
            "field": "notification_target_type",
            "alerts_generic_webhook_source_id": "c6c486cc-f0c0-44a0-a6ec-9ddd0582ac6e",
            "deleted_at": null,
            "created_at": "2025-03-13T11:58:46.755-07:00",
            "updated_at": "2025-03-13T11:58:46.755-07:00"
          },
          {
            "id": "09e20f6b-7118-4fb9-b1a2-33e267219755",
            "json_path": "$.status",
            "field": "state",
            "alerts_generic_webhook_source_id": "c6c486cc-f0c0-44a0-a6ec-9ddd0582ac6e",
            "deleted_at": null,
            "created_at": "2025-03-13T11:58:46.750-07:00",
            "updated_at": "2025-03-13T11:58:46.750-07:00"
          }
        ],
        "field_mappings": [
          {
            "id": "addec42e-6cae-4615-abd8-11f7fae29c95",
            "field": "alert_title",
            "json_path": "$.alert_title",
            "created_at": "2025-03-13T11:58:46.748-07:00",
            "updated_at": "2025-03-13T11:58:46.748-07:00"
          },
          {
            "id": "deed239c-f25e-46d1-8098-9a5668ad929a",
            "field": "notification_target_id",
            "json_path": "$.target_id",
            "created_at": "2025-03-13T11:58:46.753-07:00",
            "updated_at": "2025-03-13T11:58:46.753-07:00"
          },
          {
            "id": "f12e393c-5d2b-471c-bf98-842e68ebb742",
            "field": "notification_target_type",
            "json_path": "$.target_type",
            "created_at": "2025-03-13T11:58:46.755-07:00",
            "updated_at": "2025-03-13T11:58:46.755-07:00"
          },
          {
            "id": "09e20f6b-7118-4fb9-b1a2-33e267219755",
            "field": "state",
            "json_path": "$.status",
            "created_at": "2025-03-13T11:58:46.750-07:00",
            "updated_at": "2025-03-13T11:58:46.750-07:00"
          }
        ]
      },
      "alert_template_attributes": {}
    },
    "relationships": {
      "alert_source_urgency_rules": {
        "data": [
          {
            "id": "ba2d61ee-573d-456d-92ab-f209c0f0d2ca",
            "alerts_source_id": "365e2c73-d1f5-4287-b916-1639c5a1a83e",
            "alert_urgency_id": "d26921ee-3013-4887-8258-1abde501e7b3",
            "json_path": "$.alert.title",
            "operator": "is",
            "value": "Critical",
            "deleted_at": null,
            "created_at": "2025-03-13T11:58:46.772-07:00",
            "updated_at": "2025-03-13T11:58:46.772-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
data
object
required

Response

201
application/vnd.api+json
alert source created
data
object
required