# Firebase Cloud Messaging: messaging/invalid-argument — Invalid registration token / payload

**Code:** `messaging/invalid-argument` · **Category:** API · **Seen on:** Firebase

FCM rejected the message because the token or payload is malformed.

## Meaning

Data payload values must be strings, topics need the right format, and tokens must be real FCM registration tokens (not APNs tokens).

## Common causes

- APNs token used instead of FCM token
- Data payload contains non-string values
- Payload over 4 KB
- Wrong topic name

## Quick fix

1. Use the FCM registration token
2. Convert every `data` value to a string
3. Trim the payload

## Detailed fix by platform

### Node.js

1. `data: Object.fromEntries(Object.entries(obj).map(([k, v]) => [k, String(v)]))`

## How to diagnose

1. **Token** — FCM token?
2. **Data** — All strings?
3. **Size** — Under 4 KB?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/api/fcm-invalid-argument)
