Notification service

The AFP notification service lets AFP Direct platforms receive notifications upon sub-account and site state changes. Platforms can use the Platform API to investigate changes.

To receive notifications, implement a server that accepts POST requests and parses the JSON payload outlined in the schema (see example setup). You then need to provide the endpoint URL to your Strategic Partner Manager to activate the service.


The notification payload must adhere to the following schema:

  "$schema": "",
  "title": "Notification",
  "type": "object",
  "properties": {
    "accountName": {
      "type": "string",
      "description": "The name of the modified sub-account."
    "domain": {
      "type": "string",
      "description": "The domain the notification refers to, if any. Optional (only populated for SITE_APPROVAL)"
    "notificationType": {
      "type": "string",
      "description": "Type of notification"
  "required": ["platformPublisherId", "publisherId", "notificationType"],
  "additionalProperties": false

More notificationTypes and other fields could be added later.


A publisher approval notification would look like:

  "accountName" : "platforms/pub-1234567890123456/accounts/pub-0987654321654321",
  "notificationType": "PUBLISHER_APPROVAL"

A site approval notification would look like:

  "accountName" : "platforms/pub-1234567890123456/accounts/pub-0987654321654321",
  "domain": "",
  "notificationType": "SITE_APPROVAL"

Example setup

The following is an example of a NodeJS server that logs the contents of a notification:

// Import express
const express = require('express');

// Create an express application
const app = express();

// Middleware to parse JSON bodies

// Define a route to receive POST requests'/notification', (req, res) => {
    console.log('Received account name:', req.body.accountName)
    console.log('Received Domain:', req.body.domain)
    console.log('Received notification type', req.body.notificationType)

    // Send a response back to the client
    res.status(200).send('Notification received');

// Start the server
const PORT = process.env.PORT || 8080;
app.listen(PORT, () => {
  console.log(`Server running on port ${PORT}`);

Example endpoint URL:

Verify your endpoint is working by sending a POST request using curl:

curl -X POST \
     -H "Content-Type: application/json" \
     -d '{"accountName": "platforms/pub-1234567890123456/accounts/pub-0987654321654321", \
        "notificationType": "PUBLISHER_APPROVAL"}'

Configure robots.txt

Ensure the notification service is allowed access to your endpoint. The notification service respects directives outlined in the robots.txt file of the root of your domain, if one exists:

User-agent: GoogleOther
Disallow: <ensure your endpoint is not disallowed>