📣Custom Notifiers

Integrate P0 with any internal notification system you own, or with systems that do not have a built-in notification service yet.

Implement your own API endpoints that P0 can send notifications to.

Set up Custom Notifier Integration

Configuration Parameters

These parameters are configured by you during setup.

The examples use a custom notifier that sends notifications to an internal application for custom processing. Each custom notifier integration supports different trigger types. To reduce notification noise, you can choose only the specific triggers you want to be notified about.

Parameter
Description
Example Value

Notifier ID

The identifier of the system you are integrating*

my-notifier-service

Notifier Name

The name of the custom notifier integration

Internal Customer Admin App

Webhook URL

Your https URL that P0 uses to call your endpoints.

https://p0-api.example.com/notifications

* Identifiers in P0 do not allow whitespace and by convention use CamelCasing. Not visible to users.

OpenAPI Specification

This specification describes the API endpoint you must implement to create a custom notifier integration in P0.

Receive notifications about requests and preapprovals

post

This endpoint receives access-related notifications from P0, including user access requests and preapproval notifications. Implement this endpoint to handle custom notifiers that are not natively supported by P0. Once implemented, register the endpoint using a custom notifier in the P0 console to start receiving events.

Authorizations
AuthorizationstringRequired

P0 generates a keypair during integration setup. Each http request sent by P0 to your endpoints contains a JWT signed with the private key in the Authorization header. Your endpoints must use the public key retrieved during integration setup, to decode the JWT and verify its claims. The claims are: sub (Subject) iss (Issuer), aud (Audience), iat (Issued At), exp (Expiry)

Body
one ofOptional
or
Responses
post
/
POST / HTTP/1.1
Host: 
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 509

{
  "id": "my-notifier-service",
  "name": "My Notifier Service",
  "eventType": "preapproval-created",
  "data": {
    "id": "07ZmVeUxSc4LyhrGhlzK",
    "type": "ssh",
    "access": "session",
    "permission": {
      "name": "demo-node-1",
      "description": "sudo SSH access to demo-node-1 in AWS account Dev Stack"
    },
    "startsAt": 782735400000,
    "endsAt": 782735400000,
    "createdAt": 782735400000,
    "principal": "[email protected]",
    "approver": {
      "id": "[email protected]",
      "name": "John Smith",
      "email": "[email protected]"
    },
    "reason": "Need to give a big customer a fancy demo"
  }
}

No content

Last updated