Developers

Signals

Report live disruptions and opportunities, such as a tram outage or a heatwave, so the venue's own rules can pause bookings, show a banner or tell guests.

A signal is something happening near a venue that may affect its bookings: a tram line that has stopped, a road that has closed, a severe weather warning, a sunny afternoon. Your app reports it. BookingNinja stores it and runs the rules the venue has set up for it.

Your app never sees a guest and never changes the venue's set-up. It says what is happening and when. The venue decides what to do about it.

What the venue sees

Signals appear in the venue's admin under Settings, then Operational Signals. Each shows its title, its summary, how severe it is, the window it covers and your app's name.

Nothing happens to a booking until the venue creates a rule. A rule matches signals from your app, of one type or of any type, at or above a severity. It can then:

  • stop online bookings during the signal's window, for the whole venue or for chosen sessions or areas;
  • show a banner on the venue's booking page;
  • email guests whose bookings fall in the window, straight away or after staff approve it (venues on a paid plan);
  • alert staff through the venue's notification triggers;
  • for a positive signal, start one of the venue's marketing automations.

A rule never cancels a booking. Staff can mute a signal with one click, so it stops triggering rules. Your app sees that as ignored.

When a signal is cleared or expires, its blocks and banners are lifted. Guests are not emailed again by themselves. When the venue disconnects your app, every signal it reported is cleared at once.

The manifest

Declare signals under extension_points, with the types of signal your app may report, and ask for the signals:write scope. A signal you send must name one of these types.

json
{
  "name": "Tram Watch",
  "description": "Tells the venue when the tram line near it is down.",
  "base_url": "https://tramwatch.example.com",
  "redirect_uri": "https://tramwatch.example.com/connected",
  "scopes": ["signals:write"],
  "extension_points": {
    "signals": {
      "types": [
        {
          "key": "tram_outage",
          "label": "Tram outage",
          "polarity": "negative",
          "category": "transport",
          "description": "Sent when trams stop running at the stops the venue chose."
        }
      ]
    }
  },
  "catalogue": { "sync": false }
}
  • key is the type's name. It is what you send as type.
  • label is what the venue sees when it sets up a rule.
  • polarity is negative for a disruption (the default), positive for an opportunity and neutral for information.
  • category groups types in the venue's rules: transport, weather, traffic, local_event, facility or other.
  • timed is true (the default) for a signal about a window of time, and false for one about the venue in general.

A manifest can declare up to 20 types. signals calls nothing on your app, so there is no endpoint to build. catalogue.sync is false here because this app has no items for BookingNinja to copy.

Reporting a signal

Send PUT /api/v1/apps/signals/{key} with your access token. {key} is your own name for this signal: 1 to 80 letters, digits, dots, hyphens or underscores. Use one key for each incident, for example the feed's own id for it.

sh
curl -X PUT https://app.bookingninja.io/api/v1/apps/signals/tram-outage-4471 \
  -H "Authorization: Bearer $BN_ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"type":"tram_outage","severity":"high","title":"No trams between Old Market Square and Station Street","summary":"Trams are not running because of a power fault.","starts_at":"2026-12-05T17:00:00Z","ends_at":"2026-12-05T20:00:00Z","expires_at":"2026-12-05T21:00:00Z"}'

The body, laid out:

json
{
  "type": "tram_outage",
  "severity": "high",
  "title": "No trams between Old Market Square and Station Street",
  "summary": "Trams are not running because of a power fault.",
  "starts_at": "2026-12-05T17:00:00Z",
  "ends_at": "2026-12-05T20:00:00Z",
  "expires_at": "2026-12-05T21:00:00Z"
}
  • type is one of the types in your manifest.
  • severity is low, medium, high or critical. A rule acts on signals at or above the severity the venue chose.
  • title is up to 120 characters and summary up to 500. Markup is removed. Both can appear on the venue's banner and in its emails to guests, so write them for guests.
  • starts_at and ends_at are the affected window, in UTC. ends_at must be after starts_at, and the window can be up to 168 hours long.
  • expires_at is when BookingNinja ends the signal if you have not sent it again. While the signal is active it must be in the future, and it can be up to 168 hours from now. It is a safety catch: if your app stops, a venue is never left blocked.
  • metadata is optional: a JSON object of your own, up to 4,096 bytes.
  • status is active (the default) or cleared.

The reply is the signal as BookingNinja stored it:

json
{
  "signal": {
    "key": "tram-outage-4471",
    "type": "tram_outage",
    "polarity": "negative",
    "category": "transport",
    "severity": "high",
    "status": "active",
    "title": "No trams between Old Market Square and Station Street",
    "summary": "Trams are not running because of a power fault.",
    "starts_at": "2026-12-05T17:00:00Z",
    "ends_at": "2026-12-05T20:00:00Z",
    "expires_at": "2026-12-05T21:00:00Z",
    "metadata": null,
    "ignored": false,
    "cleared_at": null,
    "updated_at": "2026-12-05T16:52:10Z"
  }
}

Updating, extending and clearing

A PUT to a key you have used before replaces that signal. It is not a partial update: send the whole body each time. A field you leave out, such as summary or metadata, is emptied.

  • Still happening? Send it again with a later expires_at, and a later ends_at if the window has grown. A guest who was already emailed about this signal is not emailed again.
  • Over? Send the whole body again with status set to cleared. Every required field is still needed. When status is cleared, expires_at may be in the past. Blocks and banners are lifted at once.
  • Back again? Send status as active with the same key, and the signal is active again.

Your app may hold up to 50 active signals for a venue. Past that, a new one is refused with 422 and the code limit_exceeded. Clear signals that are over, rather than waiting for them to expire.

Listing your signals

GET /api/v1/apps/signals lists the active signals your app has reported for the venue, in the same shape as the reply above, under signals. Add ?include_cleared=1 to include cleared and expired ones. It lists only your own app's signals. It needs signals:write too: there is no separate scope for reading.

Use it after a restart to see what you have already reported, so your app clears what is over and leaves the rest alone.

Errors

Every error body is {"error": {"code": "...", "message": "..."}}.

Status Code Meaning
401 invalid_token The token is missing, expired or revoked. Refresh it.
403 insufficient_scope The venue did not grant signals:write. It has to connect your app again after you add the scope.
403 not_available Your manifest does not declare signals, or Apps is not available for the venue
422 invalid_request The key, the body, the type or the window is wrong. The message says what to fix.
422 limit_exceeded Your app already holds the most active signals it may for this venue
429 rate_limited More than 300 calls a minute for this installation. Wait for the Retry-After seconds.

Good practice

  • Poll your source on a schedule, compare it with what you reported, and send only what changed, plus a fresh expires_at before the old one passes.
  • Keep expires_at close: a little after you next expect to check. A short expiry means a venue is not blocked for long if your app stops.
  • Make the title plain and specific. A guest may read it in an email.
  • Choose severity with care. Venues set their rules by it, and a signal marked critical can stop bookings.