Skip to content

Development environment: content is being written, nothing points to production.

Documentation contents

notifications

Version 0.1.08 operations

Which push providers are configured, and the Web Push public key

GET/me/push/configAPI key

Parameters

No parameters.

Responses

  • 200

    • webPushWebPushConfigDtorequired
      • enabledbooleanrequired
      • publicKeystring | nullrequired

        VAPID public key (base64url) for PushManager.subscribe

    • fcmProviderStateDtorequired
      • enabledbooleanrequired

Code samples

curl -X GET "$KONNECT_API_URL/me/push/config" \
  -H "Authorization: Bearer $KONNECT_API_KEY"

Example: 200

{
  "webPush": {
    "enabled": true,
    "publicKey": "publicKey"
  },
  "fcm": {
    "enabled": true
  }
}

Active devices of the signed-in user

GET/me/push/devicesAPI key

Parameters

  • endpointstringquery

    Endpoint or token of this browser or app, to mark it current

Responses

  • 200

    • idstring (uuid)required
    • platformstringrequired
      • enum: "web", "android", "ios"
    • labelstringrequired
    • localestringrequired
      • enum: "fr", "en"
    • organisationIdstring (uuid) | nullrequired
    • createdAtstringrequired
    • lastSeenAtstringrequired
    • currentbooleanrequired

      The device of the registration or of the endpoint query

Code samples

curl -X GET "$KONNECT_API_URL/me/push/devices" \
  -H "Authorization: Bearer $KONNECT_API_KEY"

Example: 200

[
  {
    "id": "id",
    "platform": "web",
    "label": "Chrome, macOS",
    "locale": "fr",
    "organisationId": "org_01J9Z3K4EXAMPLE0000000000",
    "createdAt": "createdAt",
    "lastSeenAt": "lastSeenAt",
    "current": true
  }
]

Register or refresh this browser or app

POST/me/push/devicesAPI key

A web device sends its PushSubscription, an app its FCM token. Registering a token again refreshes it; a token registered by another user moves to this one.

Parameters

No parameters.

Request body application/json

  • platformstringrequired
    • enum: "web", "android", "ios"
  • tokenstring

    FCM registration token (android, ios)

  • subscriptionany

    Web Push subscription (web)

  • organisationIdstring (uuid)

    Only this organisation; every organisation of the user when absent

  • localestring
    • enum: "fr", "en"
    • default: "fr"

Responses

  • 201

    • idstring (uuid)required
    • platformstringrequired
      • enum: "web", "android", "ios"
    • labelstringrequired
    • localestringrequired
      • enum: "fr", "en"
    • organisationIdstring (uuid) | nullrequired
    • createdAtstringrequired
    • lastSeenAtstringrequired
    • currentbooleanrequired

      The device of the registration or of the endpoint query

  • 400validation_failed, push_provider_disabled, push_subscription_required, push_token_required

  • 404organisation_not_found

Code samples

curl -X POST "$KONNECT_API_URL/me/push/devices" \
  -H "Authorization: Bearer $KONNECT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "platform": "web",
  "token": "token",
  "subscription": {
    "endpoint": "endpoint",
    "keys": {
      "p256dh": "p256dh",
      "auth": "auth"
    }
  },
  "organisationId": "org_01J9Z3K4EXAMPLE0000000000",
  "locale": "fr"
}'

Example: request body

{
  "platform": "web",
  "token": "token",
  "subscription": {
    "endpoint": "endpoint",
    "keys": {
      "p256dh": "p256dh",
      "auth": "auth"
    }
  },
  "organisationId": "org_01J9Z3K4EXAMPLE0000000000",
  "locale": "fr"
}

Example: 201

{
  "id": "id",
  "platform": "web",
  "label": "Chrome, macOS",
  "locale": "fr",
  "organisationId": "org_01J9Z3K4EXAMPLE0000000000",
  "createdAt": "createdAt",
  "lastSeenAt": "lastSeenAt",
  "current": true
}

Stop notifications on a device

DELETE/me/push/devices/{deviceId}API key

Parameters

  • deviceIdstringpathrequired

Responses

  • 204

  • 404push_device_not_found

Code samples

curl -X DELETE "$KONNECT_API_URL/me/push/devices/deviceId" \
  -H "Authorization: Bearer $KONNECT_API_KEY"

Send a test notification to one device or to every active device

POST/me/push/testAPI key

Parameters

No parameters.

Request body application/json

  • deviceIdstring (uuid)

    One device; every active device when absent

Responses

  • 200

    • itemsPushDeliveryDto[]required
      • idstring (uuid)required
      • deviceIdstring (uuid)required
      • deviceLabelstringrequired
      • typestringrequired
        • enum: "payment_received", "payment_failed", "webhook_not_confirmed", "daily_summary", "test", "onboarding_reminder", "document_reviewed"
      • organisationIdstring (uuid) | nullrequired
      • statusstringrequired
        • enum: "pending", "sent", "retrying", "failed", "invalid_token", "skipped"
      • skipReasonstring | nullrequired
        • enum: "allowlist", "rate_limited", "quiet_hours", "provider_disabled", "imported_account_protected"
      • responseClassstring | nullrequired
        • enum: "delivered", "invalid_token", "rate_limited", "payload_rejected", "auth_error", "server_error", "network_error"
      • titlestringrequired
      • bodystringrequired
      • urlstringrequired

        Relative deep link of the dashboard

      • createdAtstringrequired
      • sentAtstring | nullrequired
  • 404push_device_not_found

Code samples

curl -X POST "$KONNECT_API_URL/me/push/test" \
  -H "Authorization: Bearer $KONNECT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "deviceId": "deviceId"
}'

Example: request body

{
  "deviceId": "deviceId"
}

Example: 200

{
  "items": [
    {
      "id": "id",
      "deviceId": "deviceId",
      "deviceLabel": "deviceLabel",
      "type": "payment_received",
      "organisationId": "org_01J9Z3K4EXAMPLE0000000000",
      "status": "pending",
      "skipReason": "allowlist",
      "responseClass": "delivered",
      "title": "title",
      "body": "body",
      "url": "url",
      "createdAt": "createdAt",
      "sentAt": "sentAt"
    }
  ]
}

Last notifications of the signed-in user, newest first

GET/me/push/deliveriesAPI key

Parameters

  • cursoranyquery
  • limitintegerquery
    • max: 100
    • default: 20

Responses

  • 200

    • itemsPushDeliveryDto[]required
      • idstring (uuid)required
      • deviceIdstring (uuid)required
      • deviceLabelstringrequired
      • typestringrequired
        • enum: "payment_received", "payment_failed", "webhook_not_confirmed", "daily_summary", "test", "onboarding_reminder", "document_reviewed"
      • organisationIdstring (uuid) | nullrequired
      • statusstringrequired
        • enum: "pending", "sent", "retrying", "failed", "invalid_token", "skipped"
      • skipReasonstring | nullrequired
        • enum: "allowlist", "rate_limited", "quiet_hours", "provider_disabled", "imported_account_protected"
      • responseClassstring | nullrequired
        • enum: "delivered", "invalid_token", "rate_limited", "payload_rejected", "auth_error", "server_error", "network_error"
      • titlestringrequired
      • bodystringrequired
      • urlstringrequired

        Relative deep link of the dashboard

      • createdAtstringrequired
      • sentAtstring | nullrequired
    • nextCursorstring | nullrequired

Code samples

curl -X GET "$KONNECT_API_URL/me/push/deliveries" \
  -H "Authorization: Bearer $KONNECT_API_KEY"

Example: 200

{
  "items": [
    {
      "id": "id",
      "deviceId": "deviceId",
      "deviceLabel": "deviceLabel",
      "type": "payment_received",
      "organisationId": "org_01J9Z3K4EXAMPLE0000000000",
      "status": "pending",
      "skipReason": "allowlist",
      "responseClass": "delivered",
      "title": "title",
      "body": "body",
      "url": "url",
      "createdAt": "createdAt",
      "sentAt": "sentAt"
    }
  ],
  "nextCursor": "nextCursor"
}

Notification preferences of the signed-in member

GET/organisations/{id}/push/preferencesAPI key

Parameters

  • idstringpathrequired

Responses

  • 200

    • organisationIdstring (uuid)required
    • typesstring[]required
    • accountsPreferenceAccountDto[]required

      Accounts of the member scope

      • idstring (uuid)required
      • namestringrequired
    • itemsPreferenceCellDto[]required
      • typestringrequired
        • enum: "payment_received", "payment_failed", "webhook_not_confirmed", "daily_summary"
      • paymentAccountIdstring (uuid) | nullrequired
      • enabledbooleanrequired

        Effective value

      • explicitbooleanrequired

        False when the value comes from the level above or the default

    • optionsPushOptionsDtorequired
      • dailySummaryTimestringrequired

        Local time of the daily summary

      • quietHoursany | nullrequired
      • timeZonestringrequired

        IANA time zone

  • 403permission_denied

Code samples

curl -X GET "$KONNECT_API_URL/organisations/id/push/preferences" \
  -H "Authorization: Bearer $KONNECT_API_KEY"

Example: 200

{
  "organisationId": "org_01J9Z3K4EXAMPLE0000000000",
  "types": [
    "payment_received"
  ],
  "accounts": [
    {
      "id": "id",
      "name": "name"
    }
  ],
  "items": [
    {
      "type": "payment_received",
      "paymentAccountId": "paymentAccountId",
      "enabled": true,
      "explicit": true
    }
  ],
  "options": {
    "dailySummaryTime": "19:00",
    "quietHours": {
      "start": "22:00",
      "end": "07:00"
    },
    "timeZone": "Africa/Tunis"
  }
}

Replace the notification preferences of the signed-in member

PUT/organisations/{id}/push/preferencesAPI key

Every stored switch is replaced by items; a type without a row follows the level above, then the default (on, except the daily summary).

Parameters

  • idstringpathrequired

Request body application/json

  • itemsPreferenceSwitchDto[]required

    Replaces every stored switch

    • typestringrequired
      • enum: "payment_received", "payment_failed", "webhook_not_confirmed", "daily_summary"
    • paymentAccountIdstring (uuid) | nullrequired

      Null: the organisation level row

    • enabledbooleanrequired
  • optionsPushOptionsDtorequired
    • dailySummaryTimestringrequired

      Local time of the daily summary

    • quietHoursany | nullrequired
    • timeZonestringrequired

      IANA time zone

Responses

  • 200

    • organisationIdstring (uuid)required
    • typesstring[]required
    • accountsPreferenceAccountDto[]required

      Accounts of the member scope

      • idstring (uuid)required
      • namestringrequired
    • itemsPreferenceCellDto[]required
      • typestringrequired
        • enum: "payment_received", "payment_failed", "webhook_not_confirmed", "daily_summary"
      • paymentAccountIdstring (uuid) | nullrequired
      • enabledbooleanrequired

        Effective value

      • explicitbooleanrequired

        False when the value comes from the level above or the default

    • optionsPushOptionsDtorequired
      • dailySummaryTimestringrequired

        Local time of the daily summary

      • quietHoursany | nullrequired
      • timeZonestringrequired

        IANA time zone

  • 400validation_failed

  • 403permission_denied or account_out_of_scope

Code samples

curl -X PUT "$KONNECT_API_URL/organisations/id/push/preferences" \
  -H "Authorization: Bearer $KONNECT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "items": [
    {
      "type": "payment_received",
      "paymentAccountId": "paymentAccountId",
      "enabled": true
    }
  ],
  "options": {
    "dailySummaryTime": "19:00",
    "quietHours": {
      "start": "22:00",
      "end": "07:00"
    },
    "timeZone": "Africa/Tunis"
  }
}'

Example: request body

{
  "items": [
    {
      "type": "payment_received",
      "paymentAccountId": "paymentAccountId",
      "enabled": true
    }
  ],
  "options": {
    "dailySummaryTime": "19:00",
    "quietHours": {
      "start": "22:00",
      "end": "07:00"
    },
    "timeZone": "Africa/Tunis"
  }
}

Example: 200

{
  "organisationId": "org_01J9Z3K4EXAMPLE0000000000",
  "types": [
    "payment_received"
  ],
  "accounts": [
    {
      "id": "id",
      "name": "name"
    }
  ],
  "items": [
    {
      "type": "payment_received",
      "paymentAccountId": "paymentAccountId",
      "enabled": true,
      "explicit": true
    }
  ],
  "options": {
    "dailySummaryTime": "19:00",
    "quietHours": {
      "start": "22:00",
      "end": "07:00"
    },
    "timeZone": "Africa/Tunis"
  }
}