Skip to main content

Set up approval notifications

To keep the right people informed about approval requests, set up notifications. Nullplatform supports Slack and HTTP notifications for approvals.

Configure a Slack channel

To receive notifications on Slack, follow these steps:

  1. Install nullplatform's Slack application.

    Go to https://<your-org-slug>.app.nullplatform.com/integration and click Connect Slack to authorize the application.

  2. Go to Slack and add the nullplatform application to the channels. You can use the /invite @nullplatform command.

  3. Send a POST request to create your notification channel.

tip

Set up a notification channel for the entire organization to ensure that notifications always reach a channel.

Example request:

curl -L 'https://api.nullplatform.com/notification/channel' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"nrn": "organization=1",
"source": ["approval"],
"type": "slack",
"configuration": {
"channels": ["my-organization-private-channel"]
},
"filters": {
"action": "service:action:create"
},
}

To notify specific teams, configure channels for namespaces, accounts, or other resources:

curl -L 'https://api.nullplatform.com/notification/channel' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"nrn": "organization=1:account=2:namespace=3",
"source": ["approval"],
"type": "slack",
"configuration": {
"channels": ["my-namespace-private-channel"]
},
"filters": {
"action": "service:action:create"
},
}
Request details
  • nrn: The NRN identifies the organization for which the notification channel is being created.
  • source: This specifies the source of the notifications. Here, the source is approval, meaning the channel will receive notifications related to approval requests.
  • type: This defines the type of notification channel. It can be either slack or http for approvals.
  • configuration: This field contains configuration details specific to the notification channel type.
  • filters: An optional field that allows notifications to be filtered based on custom criteria.

Once configured, you’ll receive Slack messages to approve or deny requests.

Here's an example:

Slack notification

Configure an HTTP notification channel

HTTP notifications allow systems to programmatically respond to approval requests. To set this up, send a POST request with the endpoint details.

Example request

curl -L 'https://api.nullplatform.com/notification/channel' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"nrn": "organization=1",
"source": ["approval"],
"type": "http",
"configuration": {
"url": "https://yourdomain.com/url-you-configured",
"headers": {
"Authorization": "Bearer the-token"
},
"filters": {
"action": "service:action:create"
},
}

Responding to HTTP notification

After evaluating an approval request, respond by approving or denying it. Use the provided approve_url or deny_url and include relevant details.

Here’s an example of how to deny an approval:

curl -L 'https://api.nullplatform.com/approval/:id/deny' \
-H 'Content-Type: application/json' \
--data-raw '{
"reviewer": {
"name": "Service Review Team",
"email": "reviewer@yourdomain.com",
"nullplatform_user_id": null
},
"message": "Service creation request denied due to policy conditions not being met.",
"details": {
"restriction_reason": "The service name must start with the application name as defined in the policy.",
"expected_pattern": "acme-app-[a-zA-Z0-9_-]+$",
"provided_service_name": "acme-service-123",
"application_name": "acme-app"
}
}'
Request details
  • reviewer: Information about the decision maker (name, email, and optional user ID).
  • message: A short explanation for the decision.
  • details: Additional context for the decision.

All fields are optional, but including them can help provide clarity to the requester in the platform.

info

For more details on notifications, refer to the Notifications docs.

What's next

Now that you've set up your notification channel, you can proceed to create a policy to define the rules for when the approval action should be triggered. Alternatively, if you haven't done so yet, you can create your approval actions.