Skip to content
Navigation

Send a push notification

Send a push notification through Truememory's FCM credential.

Target with exactly one of user_ids (resolved through the device registry), tokens (raw registration tokens you manage yourself), or topic/condition (FCM-side fan-out).

Per-device failures are reported in results rather than failing the request; only an upstream FCM failure returns an error status. Tokens FCM reports as dead are dropped from the registry and flagged pruned.

POST
https://truememory-api.mvstg.com/notifications/push
View as Markdown

Authorization

  • HTTPBearerHTTPrequired

Header parameters

  • X-App-Idoptional

    One of the following:

    • string
    • null
  • X-On-Behalf-Ofoptional

    One of the following:

    • string
    • null
  • X-External-User-Idoptional

    One of the following:

    • string
    • null

Request bodyJSONrequired

  • user_idsoptional

    Truememory user ids; resolved to registered devices for the calling app.

    One of the following:

    • array<string>
    • null
  • tokensoptional

    Raw FCM registration tokens, for callers holding their own registry.

    One of the following:

    • array<string>
    • null
  • topicoptional

    One of the following:

    • string
    • null
  • conditionoptional

    FCM condition expression, e.g. "'a' in topics && 'b' in topics".

    One of the following:

    • string
    • null
  • titleoptional

    One of the following:

    • string
    • null
  • bodyoptional

    One of the following:

    • string
    • null
  • imageoptional

    Public image URL.

    One of the following:

    • string
    • null
  • dataoptional

    Arbitrary string key/value pairs delivered to the app.

    One of the following:

    • map<string>
    • null
  • priorityoptional

    One of the following:

    • string
    • null
  • ttl_secondsoptional

    One of the following:

    • integer
    • null
  • soundoptional

    One of the following:

    • string
    • null
  • badgeoptional

    One of the following:

    • integer
    • null
  • dry_runoptionalboolean

    Validate with FCM without delivering to devices.

    default: false

Returns

200

Successful Response

JSON
  • success_countintegerrequired
  • failure_countintegerrequired
  • resultsarray ofobjectrequired
    • targetstringrequired

      The registration token, topic, or condition sent to.

    • successbooleanrequired
    • user_idoptional

      Set when the target was resolved from the device registry.

      One of the following:

      • string
      • null
    • message_idoptional

      One of the following:

      • string
      • null
    • error_codeoptional

      FCM's error code, uppercased.

      One of the following:

      • string
      • null
    • erroroptional

      One of the following:

      • string
      • null
    • prunedoptionalboolean

      The token was dropped from the registry because FCM reports it dead.

      default: false
  • unreachable_user_idsoptionalarray ofstring

    Requested users with no device registered for this app.

  • pruned_token_countoptionalinteger
    default: 0

422

Validation Error
JSON
  • detailoptionalarray ofobject
    • locarray ofrequired

      One of the following:

      • string
      • integer
    • msgstringrequired
    • typestringrequired
    • inputoptionalunknown
    • ctxoptionalobject

Type to search…

↑↓ navigate↵ selectEsc close