Table of Contents
ToggleShort answer: An AppsFlyer S2S 400 means AppsFlyer rejected your in-app event request before recording it. AppsFlyer’s Send Event reference lists five messages for a 400: “appsflyer_id is a mandatory field”, “Bad request”, “Payload is missing or failed to parse”, “Failed to Authenticate” and “app_id”. Read the message in the response, fix that one thing, and send the event again.
This guide is for developers, marketers and agencies who send in-app events to AppsFlyer from a server with a POST request to https://api3.appsflyer.com/inappevent/{app_id} and get an AppsFlyer S2S 400 back. Below you will find how to read the response, a wrong and a fixed request, five causes with a fix and a check for each, how a 400 differs from a 401, a checklist and a short FAQ.
The button opens the Attribution Debugger with a sample request that AppsFlyer would reject with a 400. The check runs in your browser and nothing is uploaded.
An AppsFlyer S2S 400 is not one error. It is a status code shared by several different problems, and the message in the response body tells you which one you have. Log the full response, not only the status code, before you change any code. If your HTTP client or no-code tool shows only “400 Bad Request”, turn on response logging or run the same request with cURL so you can see the message.
Match the message to the cause:
Here is a request without appsflyer_id in the body. AppsFlyer rejects it with an AppsFlyer S2S 400:
curl --request POST \
--url https://api3.appsflyer.com/inappevent/id123456789 \
--header 'authentication: YOUR_S2S_KEY' \
--header 'content-type: application/json' \
--data '{
"eventName": "af_purchase",
"eventValue": {"af_revenue": "9.99", "af_currency": "USD"},
"eventTime": "2026-11-08 10:15:30.000"
}'And the fixed request, with the AppsFlyer ID that the AppsFlyer SDK generated for this install:
curl --request POST \
--url https://api3.appsflyer.com/inappevent/id123456789 \
--header 'authentication: YOUR_S2S_KEY' \
--header 'content-type: application/json' \
--data '{
"appsflyer_id": "1700000000000-1234567890123456789",
"eventName": "af_purchase",
"eventValue": {"af_revenue": "9.99", "af_currency": "USD"},
"eventTime": "2026-11-08 10:15:30.000"
}'The app ID, AppsFlyer ID and key above are placeholders. Never paste a real key into a post, a chat or a screenshot.

Each cause below comes from AppsFlyer’s Send Event reference or its S2S support article, and quotes AppsFlyer’s wording where it exists.
Support: the reference lists the 400 message “appsflyer_id is a mandatory field”, and asks you to pass the correct AppsFlyer ID in the JSON and make sure the JSON is valid and well formed. AppsFlyer’s S2S support article says: “appsflyer_id is a mandatory parameter in server-to-server event messages.”
Fix: read the AppsFlyer ID from the AppsFlyer SDK on the device, store it with the user on your server, and send it in every event as appsflyer_id, spelled exactly like that.
How to check: look at the body your server really sends, not the code that should build it. A null value, an empty string or a misspelled key such as appsflyerId all count as missing.
Support: the reference lists the 400 message “Bad request” for a request that failed at least one validation criterion. In the API overview, appsflyer_id, eventName and eventValue are marked as required.
Fix: send every required field, with the type and format the reference gives for it. For eventValue, AppsFlyer’s current API overview says: “Send as a JSON object. A stringified JSON string is also supported.” The older support article asks for stringified JSON, so both forms work on the current API. A JSON object in eventValue is not a cause of an AppsFlyer S2S failed validation error.
How to check: compare each field in your body with the reference, one by one: name, type and format. A number sent where a string is expected, or a date in the wrong format, is enough.
Support: the reference lists the 400 message “Payload is missing or failed to parse”, and asks you to make sure the JSON is valid. If you send eventValue as a string, the quotes inside it must be escaped.
Fix: send well-formed JSON. Common breakers are a trailing comma after the last field, single quotes instead of double quotes, unescaped quotes inside a stringified eventValue, and a body cut off by a template or a size limit in your own tool.
How to check: copy the exact body from your server log and run it through a JSON validator. Also check that the request sends the body at all, with content-type: application/json.
Support: the reference lists two 400 messages here. “Failed to Authenticate” means you should confirm the authentication key is correct. “app_id” means the app_id does not match the authentication token.
Fix: use the S2S key of the same app you send the event to, and check the app ID in the URL path, including the id prefix for an iOS app.
How to check: compare the app ID in the URL with the app the key belongs to. A key from your Android app with an iOS app ID in the path, or a staging key with a production app, fits this cause.
Support: AppsFlyer’s S2S support article says: “S2S events don’t support multi-events in one S2S request.” Each event must be sent as a separate request, and the reference repeats this under “Payload is missing or failed to parse”. The reference also states a limit: “JSON payload size: up to 1KB.”
Fix: send one event per request, and keep each body under 1KB. Move long values out of eventValue if a single event is close to the limit.
How to check: if your body is an array, or holds an events list, split it. Then check the byte size of the largest body your server sends.
Both codes can point at the key, so it helps to know which is which. AppsFlyer’s reference describes a 401 as “Unauthorized”, returned when the key in the authentication header is not the S2S key for this app. The AppsFlyer S2S 400 messages “Failed to Authenticate” and “app_id” also concern the key and the app ID. In both cases, start with the key and the app ID in the path. The full 401 checklist is in the AppsFlyer S2S 401 Unauthorized guide.
If you get a 200 OK instead, the request passed the first check, but that does not prove the event was recorded. The AppsFlyer S2S event not recorded guide covers that case.
appsflyer_id, eventName and eventValue, with the right names and types.eventValue is a string.If you still get an AppsFlyer S2S 400 after these fixes, paste the request, or the cURL command, into the Attribution Debugger. It flags a missing appsflyer_id, broken JSON and fields in the wrong format. It reads only what you paste and cannot see inside your AppsFlyer account, so remove the key before you paste. The check runs in your browser and nothing is uploaded.
If the findings are more than you want to fix yourself, use the buttons under the report to request a written fix plan. For more guides like this one, go back to the debug hub, or open the Mobile App Attribution Debugger. Sources: AppsFlyer, Server-to-server events API: Send Event, AppsFlyer, Server-to-server events API overview and AppsFlyer, Server-to-server events API for mobile.
AppsFlyer rejected the in-app event request before recording it. The message in the response names the reason, for example “appsflyer_id is a mandatory field” or “Payload is missing or failed to parse”.
Yes. AppsFlyer’s S2S support article says appsflyer_id is a mandatory parameter in server-to-server event messages, and a request without it returns 400.
No. AppsFlyer’s current API overview says to send eventValue as a JSON object and that a stringified JSON string is also supported. If you send it as a string, escape the quotes inside it.
No. AppsFlyer says S2S events don’t support multi-events in one request, so each event must be sent separately. The reference also limits the JSON payload to 1KB.
A 401 means the key in the authentication header is not the S2S key for this app. A 400 covers several problems, including a missing appsflyer_id, failed validation, a payload that cannot be parsed, failed authentication and an app_id that does not match the key.
Built by Al-Fahad Hridoy, an Attribution & Tracking Consultant who fixes Meta Conversions API, WhatsApp click-to-chat, AppsFlyer and Firebase tracking for apps and websites.