post/users/@me/mobile-devices

Register mobile push device

Registers a mobile push device token for APNs, Firebase Cloud Messaging, or UnifiedPush. UnifiedPush registrations include the endpoint URL plus Web Push encryption keys.

register_mobile_push_device

Request body

application/json

json
{
  "type": "object",
  "properties": {
    "platform": {
      "type": "string",
      "enum": [
        "android_fcm",
        "ios_apns",
        "android_unified_push"
      ],
      "description": "The mobile push notification platform"
    },
    "token": {
      "type": "string",
      "description": "The platform-specific push notification token or endpoint URL"
    },
    "user_agent": {
      "type": "string",
      "description": "The user agent string identifying the device"
    },
    "app_id": {
      "type": "string",
      "description": "Client app channel or bundle mapping identifier, such as stable, beta, or canary"
    },
    "provider_environment": {
      "type": "string",
      "enum": [
        "production",
        "development"
      ],
      "x-enumNames": [
        "PRODUCTION",
        "DEVELOPMENT"
      ],
      "x-enumDescriptions": [
        "Production push provider environment",
        "Development or sandbox push provider environment"
      ],
      "description": "Push provider environment. For APNs, production uses api.push.apple.com and development uses api.sandbox.push.apple.com."
    },
    "encryption_key": {
      "type": "string",
      "description": "The P-256 ECDH public key for UnifiedPush encryption (base64url)"
    },
    "auth_secret": {
      "type": "string",
      "description": "The authentication secret for UnifiedPush encryption (base64url)"
    }
  },
  "required": [
    "platform",
    "token"
  ]
}

Responses

200

Success

json
{
  "type": "object",
  "properties": {
    "device_id": {
      "type": "string",
      "pattern": "^[a-f0-9]{32}$",
      "description": "The unique identifier for the registered device"
    }
  },
  "required": [
    "device_id"
  ]
}
400

Bad Request - The request was malformed or contained invalid data

json
{
  "type": "object",
  "properties": {
    "code": {
      "$ref": "#/components/schemas/APIErrorCode"
    },
    "message": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "errors": {
      "type": "array",
      "description": "Field-specific validation errors",
      "items": {
        "$ref": "#/components/schemas/ValidationErrorItem"
      }
    }
  },
  "required": [
    "code",
    "message"
  ]
}
401

Unauthorized - Authentication is required or the token is invalid

json
{
  "type": "object",
  "properties": {
    "code": {
      "$ref": "#/components/schemas/APIErrorCode"
    },
    "message": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "errors": {
      "type": "array",
      "description": "Field-specific validation errors",
      "items": {
        "$ref": "#/components/schemas/ValidationErrorItem"
      }
    }
  },
  "required": [
    "code",
    "message"
  ]
}
403

Forbidden - You do not have permission to perform this action

json
{
  "type": "object",
  "properties": {
    "code": {
      "$ref": "#/components/schemas/APIErrorCode"
    },
    "message": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "errors": {
      "type": "array",
      "description": "Field-specific validation errors",
      "items": {
        "$ref": "#/components/schemas/ValidationErrorItem"
      }
    }
  },
  "required": [
    "code",
    "message"
  ]
}
429

Too Many Requests - You are being rate limited

json
{
  "type": "object",
  "properties": {
    "code": {
      "type": "string",
      "enum": [
        "RATE_LIMITED"
      ]
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "number",
      "description": "Seconds to wait before retrying"
    },
    "global": {
      "type": "boolean",
      "description": "Whether this is a global rate limit"
    }
  },
  "required": [
    "code",
    "message",
    "retry_after"
  ]
}
500

Internal Server Error - An unexpected error occurred

json
{
  "type": "object",
  "properties": {
    "code": {
      "$ref": "#/components/schemas/APIErrorCode"
    },
    "message": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "errors": {
      "type": "array",
      "description": "Field-specific validation errors",
      "items": {
        "$ref": "#/components/schemas/ValidationErrorItem"
      }
    }
  },
  "required": [
    "code",
    "message"
  ]
}