AppsFlyer S2S 400 Error: 5 Causes and a Quick Fix

Short 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.

Check this example in the debugger

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.

Read the response body first

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:

  • “appsflyer_id is a mandatory field”: cause 1.
  • “Bad request”: cause 2, failed validation.
  • “Payload is missing or failed to parse”: cause 3 or cause 5.
  • “Failed to Authenticate” or “app_id”: cause 4.

Wrong request vs fixed request

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.

AppsFlyer S2S 400 Bad Request response

5 causes of an AppsFlyer S2S 400 and how to fix them

Each cause below comes from AppsFlyer’s Send Event reference or its S2S support article, and quotes AppsFlyer’s wording where it exists.

1. appsflyer_id is missing

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.

Check a payload without appsflyer_id

2. The request failed validation

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.

3. The payload is missing or cannot be parsed

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.

4. Authentication failed or the app_id does not match the key

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.

5. Several events in one request, or a payload that is too large

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.

AppsFlyer S2S 400 vs 401

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.

Checklist after fixing an AppsFlyer S2S 400

  • You logged the full response and matched the message to a cause.
  • The body has appsflyer_id, eventName and eventValue, with the right names and types.
  • The body is valid JSON, with escaped quotes if eventValue is a string.
  • The S2S key and the app ID in the path belong to the same app.
  • Each request carries one event and stays under 1KB.
  • After the fix, the request returns 200 and the event shows in AppsFlyer.

Check your own AppsFlyer S2S request

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.

Check this example in the debugger

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.

Frequently asked questions

What does an AppsFlyer S2S 400 mean?

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”.

Is appsflyer_id required in every S2S event?

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.

Does sending eventValue as a JSON object cause a 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.

Can I send several events in one S2S request?

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.

What is the difference between an AppsFlyer S2S 400 and a 401?

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.