---
id: notification-channel-create
title: "Create a channel"
description: "Create a new notification channel."
sidebar_label: "Create a channel"
hide_title: true
hide_table_of_contents: true
api: eJztW21vG7kR/isEcUCTQJKdxOndCXABRfE1bnO2ESvXFLbhULsjiWcuuSG5tnWC/nsxJFdarjaWlDpp0cofjJX4MjPPzJDzop3RFEyieW65krRL+xqYBcKIhDsileUjnjAcI8mESQmiQ1tU5aDdl8cp7dLqrOswq5u4fWiLWjY2tHtB+36AXrWogaTQ3E5p92JGh8A06F5hJ7R7cTW/alENnwsw9rVKp7Q7o4mSFqTFR5bnIhDa+90gvzNqkglkDJ/sNAfapWr4OySW+n24hhSpSy2RF5zRwh1HfFx4EZChXKNEloPBfXDucjtjNZdj2qrhNJgAOXl/QtSI2AkQDUYVOgHyhMtEFCmXY5JMuEg1yMWgeUruJqDBrWCJQ/WOC0FQrikCC/csy4WTQo+Z5H84Fg+fd1mSqELawxddyTIwOUvg8GW3gsfhAZ3XeFwnQk8S5Z6ZIJURMlLacfgl7S+Z/HVKzgVLbspRt5TluVa3TETrDXLnUagwxrRm01W+iODGIrIBNmInzH6RJQ8hLgFJrOqQI5ZMwlKiIddgQFpDGDE5JLicIHncv7pdJNkFLaVA8+AWMtOEJ8giiyajbetbnqCVsSLlaIZMgLZuskWbb1ELAjKwGp9zplkGFrShV/MWtdw6YANS82CyG1ljk1DNajOoswr75eeJtTlt0TG3k2LoHwTDB/ZHoZ1IY3TEqyWfjqt53aO6swb2oinEO+laU6u7tJJwOnLHRn0kduGwhWmwtS8os+486B1uCUIaGbmpWYoshMgFsyOls3ZpCajOeWValaULmk3bVf9u55rfMgvtpDwjq6bglDNvrRO50GIzO/nw/l3lGIqc1LvSEAh6TGwzaBumu7eXTdupyhiXnURl+CnaoI1czFt0AixFm244lVcZCpOJVSVpcsftJJyr7i6IeJlRvC2UDujRLn3t7hBc0LbqBiSd18B34CxkmKpCV4QotGhPVdEuLRRSGkmwAbWlupwPrdcWl8YyIfydydPNNPdXbt8WQ1JdS47fxHr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vX1oUAxHXHwZt/Lznnf3OPl3GG9Uwx2X7ytiMObYQpOo7iEsTqDWsFofkZu8rBjgs3Nu9XIQ8OZTDve1dRGEQQrZ8XXGCRtq9oLPZkBn4oMV8jl+7+A/fWWzRMgtxbzCWlWFnrr4R3ffstge+cxl656vnOybroXWdJJDbB+deVfzo7PR8gEYbXpnM3BlKNbvDe4Hd0S51b216o8EyFH43o4LJceEOCOr3dClO7CE1j6i2VpicVjiczfyMAVa853PaCqKECjimKv8CkStfxQ==
sidebar_class_name: "post api-method"
info_path: docs/api/notification
custom_edit_url: null
---

import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint";
import ParamsDetails from "@theme/ParamsDetails";
import RequestSchema from "@theme/RequestSchema";
import StatusCodes from "@theme/StatusCodes";
import OperationTabs from "@theme/OperationTabs";
import TabItem from "@theme/TabItem";
import Heading from "@theme/Heading";

<Heading
  as={"h1"}
  className={"openapi__heading"}
  children={"Create a channel"}
>
</Heading>

<MethodEndpoint
  method={"post"}
  path={"/notification/channel"}
  context={"endpoint"}
>
  
</MethodEndpoint>



Create a new notification channel.

<Heading
  id={"request"}
  as={"h2"}
  className={"openapi-tabs__heading"}
  children={"Request"}
>
</Heading>

<ParamsDetails
  parameters={undefined}
>
  
</ParamsDetails>

<RequestSchema
  title={"Body"}
  body={{"content":{"application/json":{"schema":{"type":"object","required":["nrn","type","configuration"],"properties":{"nrn":{"type":"string","description":"The NRN of the resource (including children resources) where the action will apply.","example":"organization=1:account=2:namespace=3:application=4"},"description":{"type":"string","description":"An optional description for the notification channel.","example":"My Slack channel for approval notifications"},"source":{"type":"array","description":"A list of sources that the notification channel will listen to. Each source represents a specific type of notification.","example":["approval"],"items":{"type":"string","enum":["approval","service","audit","alert","entity","telemetry","parameters"]},"title":"source"},"type":{"type":"string","description":"The type of notification channel.","example":"slack","enum":["slack","http","github","gitlab","azure","agent"],"title":"type"},"configuration":{"description":"The configuration object for the notification channel.","type":"object","oneOf":[{"type":"object","properties":{"channels":{"type":"array","items":{"type":"string"},"description":"An array of Slack channels.","example":["nullplatform-approvals"]}},"example":{"channels":["my-organization-private-channel"]},"title":"slack"},{"type":"object","properties":{"url":{"type":"string","description":"The URL where the notifications will be sent.","example":"https://my-domain.com/my-notifications-url"},"headers":{"type":"object","description":"The headers to be sent with the request.","example":{"Authorization":"Bearer the-token"}}},"example":{"url":"https://yourdomain.com/url-you-configured","headers":{"Authorization":"Bearer the-token"}},"title":"http"},{"type":"object","properties":{"installation_id":{"type":"string","description":"The GitHub installation ID.","example":"my-installation-id"},"account":{"type":"string","description":"The GitHub account or organization.","example":"my-github-org"},"repository":{"type":"string","description":"The GitHub repository.","example":"services-opentofu"},"reference":{"type":"string","description":"The reference to the GitHub repository.","example":"main"},"workflow_id":{"type":"string","description":"The ID of the GitHub workflow.","example":"provisioning.yml"}},"example":{"installation_id":"my-installation-id","account":"my-github-org","repository":"services-opentofu","reference":"main","workflow_id":"provisioning.yml"},"title":"github"},{"type":"object","properties":{"reference":{"type":"string","description":"The reference to the GitLab project. This can be the project name or ID.","example":"main"},"project_id":{"type":"string","description":"The ID of the GitLab project.","example":"1234"}},"example":{"reference":"main","project_id":"1234"},"title":"gitlab"},{"type":"object","properties":{"organization":{"type":"string","description":"The Azure DevOps organization.","example":"my-azure-org"},"project":{"type":"string","description":"The Azure DevOps project.","example":"my-azure-project"},"pipeline_id":{"type":"integer","description":"The ID of the Azure DevOps pipeline.","example":1234},"reference":{"type":"string","description":"The reference to the Azure DevOps pipeline.","example":"main"}},"example":{"organization":"my-azure-org","project":"my-azure-project","pipeline_id":1234,"reference":"main"},"title":"azure"},{"type":"object","properties":{"api_key":{"type":"string","description":"The API key for the agent.","example":"AAAA.1234567890abcdef1234567890abcdefPTs="},"command":{"type":"object","description":"Describes the command the agent will execute.","properties":{"data":{"type":"object","description":"The command line and environment variables.","properties":{"cmdline":{"type":"string","description":"The command line to be executed.\n> **Note**: The path to the command line should point to the folder where the agent is installed.\n","example":"path-to-entrypoint-file/entrypoint --service-path=\"$SERVICE_PATH\""},"environment":{"type":"object","description":"The environment variables for the command.\n> **Note**: The environment variables should be in the format `KEY: VALUE`.\n","example":{"NP_ACTION_CONTEXT":"'${NOTIFICATION_CONTEXT}"}},"arguments":{"type":"array","items":{"type":"string"},"description":"The arguments to be passed to the command line.\n","example":["arg1","arg2"]}}},"type":{"type":"string","enum":["exec"],"description":"The command type of the agent.\n> **Note**: Currently, the only supported type is `exec`.\n","example":"exec"}}},"selector":{"type":"object","description":"The selector for the agent.\n","example":{"environment":"local"}}},"title":"agent"}],"example":{"channels":["nullplatform-approvals"]}},"filters":{"type":"object","description":"A flexible object that uses MongoDB query syntax to define criteria for filtering notifications.\n\n> **Note**: See [Notification filters](/docs/notifications/filters) for more info.","example":{"action":"deployment:create"}}},"title":"notificationChannelCreate"},"examples":{"slack":{"value":{"nrn":"organization=1:account=2:namespace=3:application=4","source":["approval"],"description":"My Slack channel for approval notifications","type":"slack","configuration":{"channels":["my-organization-private-channel"]},"filters":{"action":"deployment:create"}}},"http":{"value":{"nrn":"organization=1:account=2:namespace=3:application=4","description":"My HTTP channel for approval notifications","source":["approval"],"type":"http","configuration":{"url":"https://yourdomain.com/url-you-configured","headers":{"Authorization":"Bearer the-token"}},"filters":{"action":"deployment:create"}}},"github":{"value":{"nrn":"organization=1:account=2:namespace=3:application=4","source":["service"],"description":"My GitHub channel","type":"github","configuration":{"installation_id":"my-installation-id","account":"my-github-org","repository":"services-opentofu","reference":"main","workflow_id":"provisioning.yml"},"filters":{"action":"deployment:create"}}},"gitlab":{"value":{"nrn":"organization=1:account=2:namespace=3:application=4","source":["service"],"description":"My GitLab channel","type":"gitlab","configuration":{"reference":"main","project_id":"1234"},"filters":{"action":"deployment:create"}}},"azure":{"value":{"nrn":"organization=1:account=2:namespace=3:application=4","source":["service"],"description":"My Azure channel","type":"azure","configuration":{"organization":"my-azure-org","project":"my-azure-project","pipeline_id":1234,"reference":"main"},"filters":{"action":"deployment:create"}}},"agent":{"value":{"nrn":"organization=1:account=2:namespace=3:application=4","source":["service"],"description":"My Agent channel","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":{"environment":"local"}},"filters":{"service.specification.slug":"$service-spec-slug"}}}}}}}}
>
  
</RequestSchema>

<StatusCodes
  id={undefined}
  label={undefined}
  responses={{"200":{"description":"The operation was successful.","content":{"application/json":{"schema":{"type":"object","required":["id","nrn","type","configuration"],"properties":{"id":{"type":"integer","description":"The unique ID for the notification channel.","example":789},"nrn":{"type":"string","description":"The NRN of the resource (including children resources) where the action will apply.","example":"organization=1:account=2:namespace=3:application=4"},"description":{"type":"string","description":"An optional description for the notification channel.","example":"My channel for approval notifications"},"source":{"type":"array","description":"A list of sources that the notification channel will listen to. Each source represents a specific type of notification.","example":["approval"],"items":{"type":"string","enum":["approval","service","audit","alert","entity","telemetry","parameters"]},"title":"source"},"type":{"type":"string","description":"The type of notification channel.","example":"slack","enum":["slack","http","github","gitlab","azure","agent"],"title":"type"},"configuration":{"type":"object","description":"The configuration object for the notification channel.","oneOf":[{"type":"object","properties":{"channels":{"type":"array","items":{"type":"string"},"description":"An array of Slack channels.","example":["nullplatform-approvals"]}},"example":{"channels":["my-organization-private-channel"]},"title":"slack"},{"type":"object","properties":{"url":{"type":"string","description":"The URL where the notifications will be sent.","example":"https://my-domain.com/my-notifications-url"},"headers":{"type":"object","description":"The headers to be sent with the request.","example":{"Authorization":"Bearer the-token"}}},"example":{"url":"https://yourdomain.com/url-you-configured","headers":{"Authorization":"Bearer the-token"}},"title":"http"},{"type":"object","properties":{"installation_id":{"type":"string","description":"The GitHub installation ID.","example":"my-installation-id"},"account":{"type":"string","description":"The GitHub account or organization.","example":"my-github-org"},"repository":{"type":"string","description":"The GitHub repository.","example":"services-opentofu"},"reference":{"type":"string","description":"The reference to the GitHub repository.","example":"main"},"workflow_id":{"type":"string","description":"The ID of the GitHub workflow.","example":"provisioning.yml"}},"example":{"installation_id":"my-installation-id","account":"my-github-org","repository":"services-opentofu","reference":"main","workflow_id":"provisioning.yml"},"title":"github"},{"type":"object","properties":{"reference":{"type":"string","description":"The reference to the GitLab project. This can be the project name or ID.","example":"main"},"project_id":{"type":"string","description":"The ID of the GitLab project.","example":"1234"}},"example":{"reference":"main","project_id":"1234"},"title":"gitlab"},{"type":"object","properties":{"organization":{"type":"string","description":"The Azure DevOps organization.","example":"my-azure-org"},"project":{"type":"string","description":"The Azure DevOps project.","example":"my-azure-project"},"pipeline_id":{"type":"integer","description":"The ID of the Azure DevOps pipeline.","example":1234},"reference":{"type":"string","description":"The reference to the Azure DevOps pipeline.","example":"main"}},"example":{"organization":"my-azure-org","project":"my-azure-project","pipeline_id":1234,"reference":"main"},"title":"azure"},{"type":"object","properties":{"api_key":{"type":"string","description":"The API key for the agent.","example":"AAAA.1234567890abcdef1234567890abcdefPTs="},"command":{"type":"object","description":"Describes the command the agent will execute.","properties":{"data":{"type":"object","description":"The command line and environment variables.","properties":{"cmdline":{"type":"string","description":"The command line to be executed.\n> **Note**: The path to the command line should point to the folder where the agent is installed.\n","example":"path-to-entrypoint-file/entrypoint --service-path=\"$SERVICE_PATH\""},"environment":{"type":"object","description":"The environment variables for the command.\n> **Note**: The environment variables should be in the format `KEY: VALUE`.\n","example":{"NP_ACTION_CONTEXT":"'${NOTIFICATION_CONTEXT}"}},"arguments":{"type":"array","items":{"type":"string"},"description":"The arguments to be passed to the command line.\n","example":["arg1","arg2"]}}},"type":{"type":"string","enum":["exec"],"description":"The command type of the agent.\n> **Note**: Currently, the only supported type is `exec`.\n","example":"exec"}}},"selector":{"type":"object","description":"The selector for the agent.\n","example":{"environment":"local"}}},"title":"agent"}]},"filters":{"type":"object","description":"A flexible object that uses MongoDB query syntax to define criteria for filtering notifications.\n\n> **Note**: See [Notification filters](/docs/notifications/filters) for more info.","example":{"action":"deployment:create"}}},"title":"notificationChannel"}}}},"4XX":{"description":"Client error responses due to invalid input or missing parameters.","content":{"application/json":{"schema":{"type":"object","required":["statusCode","error","message"],"properties":{"statusCode":{"type":"integer","description":"HTTP status code representing the specific client error (e.g., 400, 401, 403, 404).","example":400},"code":{"type":"string","description":"A machine-readable error code that categorizes the server failure.","example":"bad_request"},"error":{"type":"string","description":"A brief, human-readable description of the error type (e.g., \"Bad Request\", \"Unauthorized\").","example":"Bad Request"},"message":{"type":"string","description":"Additional details about the error.","example":"The request was malformed or contained invalid parameters."}}}}}},"5XX":{"description":"Server error responses indicating an issue on the API side.","content":{"application/json":{"schema":{"type":"object","required":["statusCode","error","message"],"properties":{"statusCode":{"type":"integer","description":"HTTP status code representing the specific server error (e.g., 500, 502, 503).","example":500},"code":{"type":"string","description":"A machine-readable error code that categorizes the server failure.","example":"internal_server_error"},"error":{"type":"string","description":"A brief, human-readable description of the error type (e.g., \"Internal Server Error\", \"Service Unavailable\").","example":"Internal Server Error"},"message":{"type":"string","description":"Additional details about the error.","example":"An unexpected error occurred. Please try again later."}}}}}}}}
>
  
</StatusCodes>


      