---
title: "Create"
method: POST
path: "/alerts_channels.json"
tags: ["Deprecation Notice - Alerts Channels"]
---

# Create

`POST /alerts_channels.json`

## Request

- Base URL: `https://api.newrelic.com/v2`
- URL: `https://api.newrelic.com/v2/alerts_channels.json`
- Auth: API key in header `Api-Key`
- TypeScript: <https://skmtc.dev/newrelic/apis/new-relic-rest-api-v2/docs/alerts_channels.json/post.ts> (a function with typed inputs; its response is checked against the schema)

<strong>🔥 This endpoint will be deprecated after 2024/01 🔥</strong> New users should use <a href="https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/advanced-alerts/alerts-nerdgraph/nerdgraph-api-examples/">these docs about managing alerts via NerdGraph.</a>

<p>This API endpoint works with new Alerts on alerts.newrelic.com.</p>

<p>It creates a channel associated with your New Relic account.</p>

<p>Note: <a href="https://docs.newrelic.com/docs/apis/rest-api-v2/requirements/rest-api-key">Admin User’s API Key</a> is required.</p>

<p>See our documentation for a discussion on <a href="https://docs.newrelic.com/docs/alerts/new-relic-alerts/rest-api-alerts/rest-api-calls-new-relic-alerts#channels-create">creating notification channels</a>.</p>

<p>Channel type configuration options:</p>

<ul>
  <li>
    <p>Email</p>

    <p>{</p>

    <pre><code>"recipients" : "test@google.com",
"include_json_attachment" : true
</code></pre>

    <p>}</p>
  </li>
  <li>
    <p>HipChat</p>

    <p>{</p>

    <pre><code>"auth_token": "abc123",
"room_id": "google.com"
</code></pre>

    <p>}</p>
  </li>
  <li>
    <p>OpsGenie</p>

    <p>{</p>

    <pre><code>"api_key": "abc123",
"teams": "team1",
"tags": "tag1",
"recipients": "me@me.com"
</code></pre>

    <p>}</p>
  </li>
  <li>
    <p>Slack</p>

    <p>{</p>

    <pre><code>"url": "http://test.com",
"channel": "channel1"
</code></pre>

    <p>}</p>
  </li>
  <li>
    <p>Campfire</p>

    <p>{</p>

    <pre><code>"subdomain": "mysubdomain",
"token": "123abc",
"room": "room1"
</code></pre>

    <p>}</p>
  </li>
  <li>
    <p>Victorops</p>

    <p>{</p>

    <pre><code>"key": "mykey",
"route_key": "theroute"
</code></pre>

    <p>}</p>
  </li>
  <li>
    <p>PagerDuty</p>

    <p>{</p>

    <pre><code>"service_key": "myservicekey"
</code></pre>

    <p>}</p>
  </li>
  <li>
    <p>Webhook (json)</p>

    <p>{</p>

    <pre><code>"base_url": "http://test.com",
"auth_username": "username",
"auth_password": "password",
"payload_type": "application/json",
"payload": {
  "account_id": "$ACCOUNT_ID",
  "account_name": "$ACCOUNT_NAME",
  "condition_id": "$CONDITION_ID",
  "condition_name": "$CONDITION_NAME",
  "current_state": "$EVENT_STATE",
  "details": "$EVENT_DETAILS",
  "event_type": "$EVENT_TYPE",
  "incident_acknowledge_url": "$INCIDENT_ACKNOWLEDGE_URL",
  "incident_id": "$INCIDENT_ID",
  "incident_url": "$INCIDENT_URL",
  "owner": "$EVENT_OWNER",
  "policy_name": "$POLICY_NAME",
  "policy_url": "$POLICY_URL",
  "runbook_url": "$RUNBOOK_URL",
  "severity": "$SEVERITY",
  "targets": "$TARGETS",
  "timestamp": "$TIMESTAMP",
  "violation_chart_url": "$VIOLATION_CHART_URL"
},
"headers": {"header1": "test", "header2": "test"}
</code></pre>

    <p>}</p>
  </li>
  <li>
    <p>Webhook (x-www-form-urlencoded)</p>

    <p>{</p>

    <pre><code>"base_url": "http://test.com",
"auth_username": "username",
"auth_password": "password",
"payload_type": "application/x-www-form-urlencoded",
"payload": {
  "account_id": "$ACCOUNT_ID",
  "account_name": "$ACCOUNT_NAME",
  "condition_id": "$CONDITION_ID",
  "condition_name": "$CONDITION_NAME",
  "current_state": "$EVENT_STATE",
  "details": "$EVENT_DETAILS",
  "event_type": "$EVENT_TYPE",
  "incident_acknowledge_url": "$INCIDENT_ACKNOWLEDGE_URL",
  "incident_id": "$INCIDENT_ID",
  "incident_url": "$INCIDENT_URL",
  "owner": "$EVENT_OWNER",
  "policy_name": "$POLICY_NAME",
  "policy_url": "$POLICY_URL",
  "runbook_url": "$RUNBOOK_URL",
  "severity": "$SEVERITY",
  "targets": "$TARGETS",
  "timestamp": "$TIMESTAMP",
  "violation_chart_url": "$VIOLATION_CHART_URL"
},
"headers": {"header1": "test", "header2": "test"}
</code></pre>

    <p>}</p>
  </li>
</ul>

## Query parameters

- `policy_ids` string[]

## Request body

- Channel
  - `channel` ChannelBody
    - `configuration` object
    - `name` string
    - `type` string

## Response `200`

No response was specified

- ChannelResponse
  - `channel` ChannelResponseType
    - `configuration` object
    - `id` integer
    - `links` ChannelLinksResponse
      - `policy_ids` integer[]
    - `name` string
    - `type` string

---

[API](https://skmtc.dev/newrelic/apis/new-relic-rest-api-v2.md) - [All operations](https://skmtc.dev/newrelic/apis/new-relic-rest-api-v2/llms.txt) - [OpenAPI document](https://skmtc.dev/newrelic/apis/new-relic-rest-api-v2/revisions/cf1843ad0a45?raw)
