Inbox rules

Validate an inbox rule

Changed on

Runs every check that creating (mode: new) or updating (mode: edit) an inbox rule runs, limits included, and saves nothing.

Unlike dry_run=true on create and update, an invalid definition isn't an error: it answers 200 with valid: false and every problem found.

post/communications/inbox_rule/validate

Request

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

Request body

mode'new' | 'edit'

new checks the definition as a create, and edit as an update of the rule in type_id.

type_idstring

With mode: edit, the ID of the inbox rule you're updating. It must match definition.id.

Example request

{
  "definition": {
    "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"
    ]
  },
  "mode": "new",
  "type_id": "acme.security_finding"
}

Response

The verdict, for a valid or an invalid definition alike.

validboolean

Whether the definition would be accepted.

Example response

{
  "problems": [
    {
      "path": "/category/default_mode",
      "message": "must be equal to one of the allowed values"
    }
  ]
}

Changes