post
/users/@me/mobile-devicesRegister mobile push device
Registers a mobile push device for APNs, Firebase Cloud Messaging, or UnifiedPush. A Web Push registration sends the endpoint URL with encryption_key and auth_secret. A raw registration sends the platform push token with no keys.
register_mobile_push_device
Request body
application/json
json
{
"type": "object",
"properties": {
"platform": {
"description": "The mobile push notification platform",
"x-enumNames": [
"ANDROID_FCM",
"IOS_APNS",
"IOS_APNS_VOIP",
"ANDROID_UNIFIED_PUSH"
],
"x-enumDescriptions": [
"Firebase Cloud Messaging (Android)",
"Apple Push Notification Service (iOS)",
"Apple PushKit VoIP push, used only to ring an incoming call (iOS)",
"UnifiedPush (Android without Google services)"
],
"enum": [
"android_fcm",
"ios_apns",
"ios_apns_voip",
"android_unified_push"
],
"type": "string"
},
"token": {
"description": "The Web Push endpoint URL when encryption keys are supplied, otherwise the raw platform push token",
"type": "string"
},
"user_agent": {
"description": "The user agent string identifying the device",
"type": "string"
},
"app_id": {
"description": "Client app channel or bundle mapping identifier, such as stable, beta, or canary",
"type": "string"
},
"provider_environment": {
"description": "Push provider environment. For APNs, production uses api.push.apple.com and development uses api.sandbox.push.apple.com.",
"x-enumNames": [
"PRODUCTION",
"DEVELOPMENT"
],
"x-enumDescriptions": [
"Production push provider environment",
"Development or sandbox push provider environment"
],
"enum": [
"production",
"development"
],
"type": "string"
},
"encryption_key": {
"description": "The P-256 ECDH public key for Web Push encryption (base64url)",
"type": "string"
},
"auth_secret": {
"description": "The authentication secret for Web Push encryption (base64url)",
"type": "string"
}
},
"required": [
"platform",
"token"
]
}Responses
200
Success
json
{
"type": "object",
"properties": {
"device_id": {
"description": "The unique identifier for the registered device",
"$ref": "#/components/schemas/HexString32Type"
}
},
"required": [
"device_id"
],
"additionalProperties": false
}400
Bad Request - The request was malformed or contained invalid data
json
{
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "Machine-readable error code"
},
"message": {
"type": "string",
"description": "Human-readable error message"
},
"errors": {
"description": "Field-specific validation errors",
"type": "array",
"items": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "Field path that failed validation"
},
"code": {
"description": "Machine-readable validation error code",
"type": "string"
},
"message": {
"type": "string",
"description": "Human-readable validation error message"
}
},
"required": [
"path",
"message"
],
"additionalProperties": false
}
}
},
"required": [
"code",
"message"
],
"additionalProperties": {}
}401
Unauthorized - Authentication is required or the token is invalid
json
{
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "Machine-readable error code"
},
"message": {
"type": "string",
"description": "Human-readable error message"
},
"errors": {
"description": "Field-specific validation errors",
"type": "array",
"items": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "Field path that failed validation"
},
"code": {
"description": "Machine-readable validation error code",
"type": "string"
},
"message": {
"type": "string",
"description": "Human-readable validation error message"
}
},
"required": [
"path",
"message"
],
"additionalProperties": false
}
}
},
"required": [
"code",
"message"
],
"additionalProperties": {}
}403
Forbidden - You do not have permission to perform this action
json
{
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "Machine-readable error code"
},
"message": {
"type": "string",
"description": "Human-readable error message"
},
"errors": {
"description": "Field-specific validation errors",
"type": "array",
"items": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "Field path that failed validation"
},
"code": {
"description": "Machine-readable validation error code",
"type": "string"
},
"message": {
"type": "string",
"description": "Human-readable validation error message"
}
},
"required": [
"path",
"message"
],
"additionalProperties": false
}
}
},
"required": [
"code",
"message"
],
"additionalProperties": {}
}429
Too Many Requests - You are being rate limited
json
{
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "Machine-readable error code"
},
"message": {
"type": "string",
"description": "Human-readable error message"
},
"errors": {
"description": "Field-specific validation errors",
"type": "array",
"items": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "Field path that failed validation"
},
"code": {
"description": "Machine-readable validation error code",
"type": "string"
},
"message": {
"type": "string",
"description": "Human-readable validation error message"
}
},
"required": [
"path",
"message"
],
"additionalProperties": false
}
},
"retry_after": {
"type": "number",
"description": "Seconds to wait before retrying"
},
"global": {
"type": "boolean",
"description": "Whether this is a global rate limit"
}
},
"required": [
"code",
"message"
],
"additionalProperties": {}
}500
Internal Server Error - An unexpected error occurred
json
{
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "Machine-readable error code"
},
"message": {
"type": "string",
"description": "Human-readable error message"
},
"errors": {
"description": "Field-specific validation errors",
"type": "array",
"items": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "Field path that failed validation"
},
"code": {
"description": "Machine-readable validation error code",
"type": "string"
},
"message": {
"type": "string",
"description": "Human-readable validation error message"
}
},
"required": [
"path",
"message"
],
"additionalProperties": false
}
}
},
"required": [
"code",
"message"
],
"additionalProperties": {}
}