Creating a Subscription (Any Type)

Create any valid type of subscription in Notifications to receive notifications.

  • 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 list page, specifying the topic in the panel: Select Create Subscription, and then select a Subscription Topic.
    1. On the Topics list page, select the topic that you want to work with. If you need help finding the list page or the topic, see Listing Topics.
    2. On the topic's details page, select Create Subscription.
    3. In the Create Subscription panel, select the type of subscription that you want to create, then enter values in the associated fields.
      • Email: Enter an email address.
      • Function: Select the compartment and application that contain the function that you want, and then select the function.

      • HTTPS (Custom URL): Enter the URL that you want to use as the endpoint. Endpoint format:

        https://<anyvalidURL>

        For prerequisites, see Before You Begin. Query parameters aren't permitted in URLs.

      • PagerDuty: Enter the integration key portion ( PagerDuty endpoint). The other portions of the URL are hard-coded. Full endpoint format:

        https://events.pagerduty.com/integration/<integrationkey>/enqueue

        Query parameters aren't permitted in URLs.

      • Slack: Enter the Slack endpoint, including the webhook token. Endpoint format:

        https://hooks.slack.com/services/<webhook-token>

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

      • SMS: Select the country for the phone number, and then enter the phone number, using E.164 format. Example: +14255550100

      For more information about each subscription type, see "subscription" under Notifications Concepts.

    4. (Optional) Under Show advanced options, enter one or more tags for the subscription.
      If you have permissions to create a resource, then you also have permissions to apply free-form tags to that resource. To apply a defined tag, you must have permissions to use the tag namespace. For more information about tagging, see Resource Tags. If you're not sure whether to apply tags, skip this option or ask an administrator. You can apply tags later. For more information, see Tagging a Subscription at Creation.
    5. Select Create.
    Notifications creates the subscription. If the subscription type requires a confirmation, then Notifications sends a confirmation URL to its endpoint and the subscription is pending until confirmation is received.
  • Use the oci ons subscription create command and required parameters to create a subscription:

    oci ons subscription create --compartment-id <compartment_OCID> --protocol <subscription_type> --subscription-endpoint <endpoint> --topic-id <topic_OCID>

    For a complete list of parameters and values for CLI commands, see the Command Line Reference for Notifications.

  • Run the CreateSubscription operation to create a subscription.

What's Next

Confirmation is required for some protocols, such as email. In this case, the new subscription remains in Pending (PENDING) status until confirmation is received. Notifications sends a confirmation URL to the subscription endpoint, such as an email address for an email subscription. To confirm a new subscription, or to review subscription protocols that require confirmation, see Confirming a Subscription.

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.