Register a device
PUT/v1/members/me/devices/{device_id}
Creates or updates the device for the signed-in member. Call it on every app start, and whenever the push token, the notification permission or the signed-in member changes. Sending the same body again changes nothing. A member can have many devices. If another member registered this device_id before, the device moves to the member in the token.
Permissions: Member token.
Path parameters#
device_idstringRequiredYour stable id for this install.
Request body#
platformstringRequirediosorandroid.One ofios,androidpush_tokenstringNullableCurrent push token. Sendnullif the app hasn't got one yet.token_typestringfcmorapns. Required withpush_token.One offcm,apnsapp_idstringRequiredBundle id or package name.push_enabledbooleanRequiredThe OS notification permission right now.app_versionstringYour app's version.os_versionstringOS version.localestringDevice language.time_zonestringDevice time zone.
Response fields#
Returns 200 with Device
device_idstringYour id for this install, up to 128 characters. Use a UUID you generate once and keep in app storage.member_idstring (uuid)The member signed in on the device.platformstringiosorandroid.One ofios,androidpush_tokenstringNullableThe push token from Firebase or APNs.nullif the app has none yet.token_typestringfcm(from the Firebase SDK) orapns(a raw APNs token, iOS only).One offcm,apnsapp_idstringiOS bundle id or Android package name. Must be an app support set up for your brand.push_enabledbooleanThe OS notification permission. Marketing consent is separate:communication_preferences.push_marketingon the member.app_versionstringYour app's version, for example4.2.0.os_versionstringFor example18.1.localestringBCP 47 tag, for exampleen-US.time_zonestringIANA name, for exampleAmerica/Chicago. unPLUG uses it for quiet hours.created_atstring (date-time)First registration.updated_atstring (date-time)Last change.
Error descriptions#
400Bad request
missing_param
: platform, app_id or push_enabled is missing, or token_type is missing with a push_token.
400Bad request
invalid_param
: token_type isn't fcm or apns, apns was sent for Android, or app_id isn't an app set up for your brand.
401Unauthorized
token_expired
Get a new member token and retry.
Any endpoint can also return the common errors.