Creating a Slack Subscription

Create a Slack subscription in Notifications.

Before You Begin

To create a Slack subscription, you must have a webhook token for the endpoint URL. See the Slack documentation.

  • These steps show how to open the Create Subscription panel from the details page for the topic that you want to add the subscription to. You can also open this panel from the Subscriptions page, specifying the topic in the panel: Click Create Subscription, and then select a Subscription Topic.

    1. Open the navigation menu and click Developer Services. Under Application Integration, click Notifications.
    2. On the Topics page, select the compartment that contains the topic that you want.
    3. Click the name of the topic that you want to add the subscription to.
    4. On the Topic Details page, click Create Subscription.
    5. In the Create Subscription panel, for Protocol, select Slack.
    6. Enter the Slack endpoint, including the webhook token, using the following format:<webhook-token>

      The <webhook-token> portion of the URL contains two slashes (/). Query parameters aren't allowed in URLs.

    7. Click Create.

    Notifications creates the Slack subscription and sends a confirmation URL to its endpoint. The subscription is pending until confirmation is received.

  • Use the oci ons subscription create command and required parameters to create a Slack subscription:

    oci ons subscription create [OPTIONS]


    oci ons subscription create --compartment-id "<compartment-ocid>" --topic-id "<topic-ocid>" --protocol "SLACK" --subscription-endpoint "<slack-endpoint>"

    For a complete list of flags and variable options for CLI commands, see the Command Line Reference for Notifications.

  • Run the CreateSubscription operation to create a Slack subscription.


    POST /20181201/subscriptions
    <authorization and other headers>
      "topicId": "<topic_OCID>",
      "compartmentId": "<compartment_OCID>",
      "protocol": "SLACK",
      "endpoint": "<slack-endpoint>"

What's Next

To activate the new subscription, navigate to the confirmation URL that was sent to Slack.

Although a new subscription must be in the same compartment as its parent topic, you can move it to another compartment after creation. See Moving a Subscription.