contacts

Add Push Subscription

post/v1/contacts/{contact_id}/push-subscriptions

Request

  • Base URL: https://api.elaan.io (the document declares no server; this is the origin it was published from)
  • URL: https://api.elaan.io/v1/contacts/{contact_id}/push-subscriptions
  • Auth: none declared

Path parameters

contact_idstring required

Headers

authorizationstring nullable

Request body

valuestring required
provider'fcm' | 'apns' | 'expo' | 'onesignal' | 'webpush' required

The service a push subscription is delivered through — the routing key that ties a contact's PushSubscription to the tenant's configured PushTransportConfig and selects which sender adapter delivers it.

Cross-cutting vocabulary (like Channel): it lives in shared because both contact (the destination side) and push_transport / outbound_push (the sending side) reference the same members, and they must not drift apart.

Covers direct transports (FCM / APNs / Web Push) and aggregators that fan out to the native platforms themselves (Expo, OneSignal). Subclassing str keeps JSON and dict keys clean.

platform'ios' | 'android' | 'web'

The device platform a subscription targets. Optional metadata — used for payload shaping once the push channel lands (APNs, Android and Web bodies differ), never for routing (that is PushProvider's job).

authstring nullable
p256dhstring nullable

Example request

{
  "value": "fcm-token-abc",
  "auth": "kQm...==",
  "p256dh": "BN1...=="
}

Response

Successful Response

idstring required
external_idstring nullable required
languagestring nullable required

The contact's preferred language tag (e.g. "es"), or null for the language-less default. Set at create or via PUT /v1/contacts/{id}/language — deliberately NOT part of the whole-resource PUT, so a partial-shaped update can't silently clear it.

emailsstring[] required
phonesstring[] required
attributesobject required

Example response

{
  "push_subscriptions": [
    {
      "value": "fcm-token-abc",
      "auth": "kQm...==",
      "p256dh": "BN1...=="
    }
  ],
  "preferences": [
    {
      "notification_type_key": "order_shipped"
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.