Skip to content

Register Device

POST
/api/v1/notifications/register-device
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.

Media typeapplication/json
RegisterDeviceRequest

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
apns_sandbox
Apns Sandbox
boolean
platform
required
Platform

Device platform

string
/^(web|android|ios)$/
token
required
Token

FCM or APNs device token

string
>= 1 characters
token_type
Token Type
string
default: fcm
Allowed values: fcm apns

Successful Response

Media typeapplication/json
RegisterDeviceResponse

Response body for device token registration.

Attributes: registered: Whether the token was successfully registered. reason: Why registration failed, when it did.

object
reason
Any of:
string
registered
required
Registered
boolean
Examplegenerated
{
"reason": "example",
"registered": true
}

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
ctx
Context
object
input
Input
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Examplegenerated
{
"detail": [
{
"ctx": {},
"input": "example",
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
]
}