Ga naar inhoud

Prudai Developer API: pushtoestellen

The person’s own phones and browsers that receive push notifications (metadata only, never customer content). Personal credentials only; service keys never receive these scopes.

Basis-URL https://api.prudai.com/v1. Inloggen staat in Inloggen, scopes in Scopes en rechten, fouten in Fouten. Overzicht.

MethodePadWat het doetStand
GET/v1/push-devicesList my push devicesBinnenkort
POST/v1/push-devicesRegister this phone for push notificationsBinnenkort
POST/v1/push-devices/{id}/testSend a test notification to one of my devicesBinnenkort
POST/v1/push-devices/unregisterStop push notifications on this phoneBinnenkort

List my push devices

GET /v1/push-devices

Lists the devices of the signed-in person that can receive push notifications (iOS and browsers). Tokens and Web Push keys are never returned. Personal credentials only (personal token or Keycloak user token); a service key is refused. PUSH_NOTIFICATIONS_ENABLED=false returns 404.

  • Stand: binnenkort, nog niet op productie.
  • Scope: prudai:push_devices:read
  • Goedkeuring: none, geen extra stap.

Antwoorden

StatusBetekenis
200Task envelope with the result.
401Missing, malformed, unknown, expired or revoked key, or a key used against the wrong environment.
403Authenticated, but not allowed (missing scope, product not on the key or organisation, organisation suspended, Developer API switched off for the organisation, IP not on the allowlist, depth not permitted, licence does not permit redistribution).
404project_not_found (unknown project, or one you may not read: the same answer), document_not_found (not in this project), or original_unavailable (the original file is no longer stored).
422Well-formed request with invalid values (for example an unknown reasoning_effort, empty messages, or an Idempotency-Key reused with a different body).
429Rate limit, concurrency limit, Ultra daily quota or fair-use limit of the free sources operations exceeded.
503Temporarily unavailable (maintenance, overload, or the credit check could not be performed). Nothing ran, nothing is charged.
curl
curl -s "https://api.prudai.com/v1/push-devices" \
-H "Authorization: Bearer $PRUDAI_TOKEN"
CLI (binnenkort)
prudai leo push-devices list
Antwoord 200
[
{
"id": "00000000-0000-4000-8000-000000000000",
"platform": "ios",
"label": "string",
"apns_environment": "sandbox",
"app_version": "string",
"active": false,
"last_seen_at": "2026-11-05T09:30:00.000Z",
"last_sent_at": "2026-11-05T09:30:00.000Z",
"created_at": "2026-11-05T09:30:00.000Z"
}
]

Register this phone for push notifications

POST /v1/push-devices

Registers or refreshes the APNs device token of the signed-in person. A token is unique: when another person signs in on the same phone the device moves to that person. The response never contains the token. Notifications carry metadata only (kind and product), never customer content. Personal credentials only (personal token or Keycloak user token); a service key is refused. PUSH_NOTIFICATIONS_ENABLED=false returns 404.

  • Stand: binnenkort, nog niet op productie.
  • Scope: prudai:push_devices:write
  • Goedkeuring: none, geen extra stap.
  • Dry run: ?dryRun=true laat zien wat er zou gebeuren en slaat niets op.

Parameters

  • dryRun query · string
    Validate and preview the effect without changing anything. Een van: true, false

Body

JSON, verplicht.

  • token string verplicht
    APNs device token as hex. patroon ^[0-9a-fA-F]{64,200}$
  • environment string verplicht
    Een van: sandbox, production
  • bundle_id string
    max. lengte 155
  • app_version string
    max. lengte 32

Antwoorden

StatusBetekenis
201Task envelope with the result.
401Missing, malformed, unknown, expired or revoked key, or a key used against the wrong environment.
403Authenticated, but not allowed (missing scope, product not on the key or organisation, organisation suspended, Developer API switched off for the organisation, IP not on the allowlist, depth not permitted, licence does not permit redistribution).
404project_not_found (unknown project, or one you may not read: the same answer), document_not_found (not in this project), or original_unavailable (the original file is no longer stored).
422Well-formed request with invalid values (for example an unknown reasoning_effort, empty messages, or an Idempotency-Key reused with a different body).
429Rate limit, concurrency limit, Ultra daily quota or fair-use limit of the free sources operations exceeded.
503Temporarily unavailable (maintenance, overload, or the credit check could not be performed). Nothing ran, nothing is charged.

Velden in data (201)

  • id string (uuid)
  • platform string
    Een van: ios, web
  • label string
    kan null zijn
  • apns_environment string
    Een van: sandbox, production, null · kan null zijn
  • app_version string
    kan null zijn
  • active boolean
  • last_seen_at string (date-time)
  • last_sent_at string (date-time)
    kan null zijn
  • created_at string (date-time)
curl
curl -s -X POST "https://api.prudai.com/v1/push-devices" \
-H "Authorization: Bearer $PRUDAI_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"token": "string",
"environment": "sandbox",
"bundle_id": "string",
"app_version": "string"
}'
CLI (binnenkort)
prudai leo push-devices create
Antwoord 201
{
"id": "00000000-0000-4000-8000-000000000000",
"platform": "ios",
"label": "string",
"apns_environment": "sandbox",
"app_version": "string",
"active": false,
"last_seen_at": "2026-11-05T09:30:00.000Z",
"last_sent_at": "2026-11-05T09:30:00.000Z",
"created_at": "2026-11-05T09:30:00.000Z"
}

Send a test notification to one of my devices

POST /v1/push-devices/{id}/test

Sends a fixed test notification (“Pushmeldingen werken op dit apparaat.”) to one own active device. Personal credentials only (personal token or Keycloak user token); a service key is refused. PUSH_NOTIFICATIONS_ENABLED=false returns 404.

  • Stand: binnenkort, nog niet op productie.
  • Scope: prudai:push_devices:write
  • Goedkeuring: none, geen extra stap.
  • Dry run: ?dryRun=true laat zien wat er zou gebeuren en slaat niets op.

Parameters

  • id path · string (uuid) verplicht
  • dryRun query · string
    Validate and preview the effect without changing anything. Een van: true, false

Body

JSON, verplicht.

Antwoorden

StatusBetekenis
200Task envelope with the result.
401Missing, malformed, unknown, expired or revoked key, or a key used against the wrong environment.
403Authenticated, but not allowed (missing scope, product not on the key or organisation, organisation suspended, Developer API switched off for the organisation, IP not on the allowlist, depth not permitted, licence does not permit redistribution).
404project_not_found (unknown project, or one you may not read: the same answer), document_not_found (not in this project), or original_unavailable (the original file is no longer stored).
422Well-formed request with invalid values (for example an unknown reasoning_effort, empty messages, or an Idempotency-Key reused with a different body).
429Rate limit, concurrency limit, Ultra daily quota or fair-use limit of the free sources operations exceeded.
503Temporarily unavailable (maintenance, overload, or the credit check could not be performed). Nothing ran, nothing is charged.

Velden in data (200)

  • devices integer
    min. 0
  • sent integer
    min. 0
curl
curl -s -X POST "https://api.prudai.com/v1/push-devices/<id>/test" \
-H "Authorization: Bearer $PRUDAI_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'
CLI (binnenkort)
prudai leo push-devices test
Antwoord 200
{
"devices": 1,
"sent": 1
}

Stop push notifications on this phone

POST /v1/push-devices/unregister

Removes the given APNs token of the signed-in person (logout, permission withdrawn). Removing a token that is not yours removes nothing. Personal credentials only (personal token or Keycloak user token); a service key is refused. PUSH_NOTIFICATIONS_ENABLED=false returns 404.

  • Stand: binnenkort, nog niet op productie.
  • Scope: prudai:push_devices:write
  • Goedkeuring: none, geen extra stap.
  • Dry run: ?dryRun=true laat zien wat er zou gebeuren en slaat niets op.

Parameters

  • dryRun query · string
    Validate and preview the effect without changing anything. Een van: true, false

Body

JSON, verplicht.

  • token string verplicht
    patroon ^[0-9a-fA-F]{64,200}$

Antwoorden

StatusBetekenis
200Task envelope with the result.
401Missing, malformed, unknown, expired or revoked key, or a key used against the wrong environment.
403Authenticated, but not allowed (missing scope, product not on the key or organisation, organisation suspended, Developer API switched off for the organisation, IP not on the allowlist, depth not permitted, licence does not permit redistribution).
404project_not_found (unknown project, or one you may not read: the same answer), document_not_found (not in this project), or original_unavailable (the original file is no longer stored).
422Well-formed request with invalid values (for example an unknown reasoning_effort, empty messages, or an Idempotency-Key reused with a different body).
429Rate limit, concurrency limit, Ultra daily quota or fair-use limit of the free sources operations exceeded.
503Temporarily unavailable (maintenance, overload, or the credit check could not be performed). Nothing ran, nothing is charged.

Velden in data (200)

  • removed integer
    min. 0
curl
curl -s -X POST "https://api.prudai.com/v1/push-devices/unregister" \
-H "Authorization: Bearer $PRUDAI_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"token": "string"
}'
CLI (binnenkort)
prudai leo push-devices unregister
Antwoord 200
{
"removed": 1
}