---
sidebar_label: Set up a notification channel
doc_id: 53ce95b8-0256-4c4d-ab01-e80b22a22782
description: >-
  Configure notification channels to send scope service actions from
  nullplatform to your runner.
keywords:
  - notification channel
  - nullplatform
  - runner
  - CLI
  - API
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# Set up a notification channel

Set up a notification channel so nullplatform can send scope service actions to your runner.

## Create an agent notification channel

To configure this, use our [CLI](/docs/cli/) or send a [POST request](/docs/api/notification-channel-create) with the endpoint details.

**Example request**

<Tabs
defaultValue="create-channel-agent-cli"
values={[
  { label: 'CLI', value: 'create-channel-agent-cli' },
  { label: 'cURL', value: 'create-channel-agent-curl' },
]}>
<TabItem value="create-channel-agent-cli">

```bash
np notification channel create \
  --body '{
    "nrn": "organization=1:account=2:namespace=3:application=4",
    "source": ["service"],
    "type": "agent",
    "configuration": {
      "api_key": "AAAA.1234567890abcdef1234567890abcdefPTs=",
      "command": {
        "data": {
          "cmdline": "path-to-entrypoint-file/entrypoint --service-path=\"$SERVICE_PATH\"",
          "environment": { "NP_ACTION_CONTEXT": "${NOTIFICATION_CONTEXT}" }
        },
        "type": "exec"
      },
      "selector": {}
    },
    "filters": {
      "service.specification.slug": "$service-spec-slug"
    }
  }'
```
  </TabItem>
  <TabItem value="create-channel-agent-curl">

```bash
curl -L -X POST 'https://api.nullplatform.com/notification/channel' \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -d '{
    "nrn": "organization=1:account=2:namespace=3:application=4",
    "source": ["service"],
    "type": "agent",
    "configuration": {
      "api_key": "AAAA.1234567890abcdef1234567890abcdefPTs=",
      "command": {
        "data": {
          "cmdline": "/root/.np/services/entrypoint --service-path=/root/.np/services/kubernetes",
          "environment": { "NP_ACTION_CONTEXT": "${NOTIFICATION_CONTEXT}" }
        },
        "type": "exec"
      },
      "selector": {}
    },
    "filters": {
      "service.specification.slug": "$service-spec-slug"
    }
  }'
```
  </TabItem>
</Tabs>


:::note Request details

  - `nrn`: The NRN of the resource (including child resources) where the action applies.
  - `source`: The system emitting the notification. For agent-backed scopes, set this to `service`.
  - `type`: The type of notification channel. For agent-backed scopes, use `agent`.
  - `configuration`: Configuration options for the agent.
    - `api_key`: The API key for the agent.
    - `command`: Describes the command the agent will execute.
  - `filters`: MongoDB-style query that filters which service notifications trigger the runner.


See the [API docs](/docs/api/notification-channel-create) for more information on this request.
:::

Once your channel is set up, nullplatform will start relaying events to your runner when relevant service actions are triggered.
