Skip to content

Register this device

PUT
/v1/devices
curl --request PUT \
--url https://api.pocketbell.dev/v1/devices \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "apns_token": "bab976c0e4f96f54421bd416d8bf7e2e77811aa40b40c81023d8ab1c9638afac", "apns_environment": "sandbox", "platform": "ios", "name": "iPhone", "install_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "live_activity_start_token": "example" }'

Registers the device’s APNs token for the signed-in account, or updates it. The apps call this on every launch, since APNs can change a token.

Media typeapplication/json
object
apns_token
required
string
/^[0-9a-f]{64,200}$/
Example
bab976c0e4f96f54421bd416d8bf7e2e77811aa40b40c81023d8ab1c9638afac
apns_environment
required

Sandbox for builds run from Xcode, production for TestFlight and the App Store.

string
Allowed values: sandbox production
platform
required
string
Allowed values: ios ipados macos
name
required
string
>= 1 characters <= 100 characters
Example
iPhone
install_id

A random ID the app keeps on this device, the same across reinstalls, builds and sign-ins, so each device is listed once.

string format: uuid
live_activity_start_token

IPhone: ActivityKit’s push-to-start token, so a Live Activity can be started on this device.

string
/^[0-9a-f]{32,400}$/

Registered.

Media typeapplication/json
object
id
required
string
name
required
string
platform
required
string
Allowed values: ios ipados macos
apns_environment
required
string
Allowed values: sandbox production
Example
{
"id": "dev_01jz9k6q8r3tfv0x2m4n5p7s8a",
"platform": "ios",
"apns_environment": "sandbox"
}

The request was invalid.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details

Which fields were wrong, for invalid_request.

Array<object>
object
field
required
string
message
required
string
Example
{
"error": {
"code": "invalid_request"
}
}

Missing or ended session.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details

Which fields were wrong, for invalid_request.

Array<object>
object
field
required
string
message
required
string
Example
{
"error": {
"code": "invalid_request"
}
}