Inbox rules

Create an inbox rule

Changed on

Creates an inbox rule for your organization from its definition.

Sending the ID of a built-in rule edits that rule for your organization instead of creating a new one. To start over, reset it to default from the UI.

An organization can have up to 50 active inbox rules of its own, edited built-in rules included, and up to 10 active rules on the same entity.

post/communications/inbox_rule

Request

  • Base URL
    https://api.nullplatform.com
  • URL
    https://api.nullplatform.com/communications/inbox_rule
  • Auth
    HTTP bearer

Query parameters

dry_run'true' | 'false'

Set to true to run every check, limits included, without saving anything.

Request body

idstring required

Lowercase words with exactly one dot. It also identifies the rule in inbox settings, and it can't change later.

ℹ️ Note: It can't start with platform.. Using a built-in rule's ID edits that rule for your organization.

status'active' | 'deprecated'

Whether the rule is active. Defaults to active. deprecated means deactivated.

context_schemaobject

A JSON Schema for the data each send carries. An invoked rule must require id, because sends are idempotent by it.

severity'informational' | 'maintenance' | 'degraded' | 'outage' required

Sets the icon and the color of the notification.

visible_tostring[]

The one NRN the rule applies under. Defaults to your organization. Sends for resources outside it are refused.

Example request

{
  "id": "acme.security_finding",
  "status": "active",
  "context_schema": {
    "type": "object",
    "required": [
      "id",
      "service",
      "owner_id"
    ],
    "properties": {
      "id": {
        "type": "string"
      },
      "service": {
        "type": "string"
      },
      "summary": {
        "type": "string"
      },
      "owner_id": {
        "type": "integer"
      }
    }
  },
  "category": {
    "group": "security",
    "label": "Security findings",
    "description": "Vulnerabilities your CI scanners report.",
    "configurable": true,
    "allows_all": true,
    "default_mode": "involved"
  },
  "severity": "degraded",
  "audience": [
    {
      "as": "owner",
      "who": {
        "user": "${{ context.owner_id }}"
      },
      "action": "acme.security_finding",
      "content": {
        "title": "Security finding on ${{ context.service }}",
        "body": "${{ context.summary }}"
      }
    }
  ],
  "visible_to": [
    "organization=1:account=2"
  ]
}

Response

With dry_run=true: the definition is valid, and nothing was saved.

validboolean

Always true: an invalid definition answers 400.

Example response

{
  "valid": true
}

Changes