Register Device
const url = 'https://api.ultimateteam.ai/api/v1/notifications/register-device';const options = { method: 'POST', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json'}, body: '{"apns_sandbox":false,"platform":"example","token":"example","token_type":"fcm"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.ultimateteam.ai/api/v1/notifications/register-device \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <X-API-Key>' \ --data '{ "apns_sandbox": false, "platform": "example", "token": "example", "token_type": "fcm" }'Register a device token for push notifications.
Requires authentication. The tenant_id and user_id are extracted from the JWT token. Performs an upsert: if the token already exists, updates last_refreshed_at.
Args: body: The registration request with token and platform. user: The authenticated user context.
Returns: Confirmation that the token was registered.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Request body for device token registration.
Attributes:
token: The device token string (FCM registration token, or the raw
APNs device token when token_type is "apns").
platform: Device platform (web, android, ios).
token_type: "fcm" (default) or "apns" for iOS device tokens
that must be imported into Firebase before delivery.
apns_sandbox: Whether an APNs token was issued by the sandbox
environment (development-signed builds).
object
Device platform
FCM or APNs device token
Responses
Section titled “ Responses ”Successful Response
Response body for device token registration.
Attributes: registered: Whether the token was successfully registered. reason: Why registration failed, when it did.
Examplegenerated
{ "reason": "example", "registered": true}Validation Error
object
object
object
Examplegenerated
{ "detail": [ { "ctx": {}, "input": "example", "loc": [ "example" ], "msg": "example", "type": "example" } ]}