# Troubleshooting: guides by symptom

> Step by step per symptom: 401, 402, 422, 429, stuck or red render, webhooks, uploads, browser, MCP.

Source: https://flow-marketing.org/en/help/api-troubleshooting · Question: My API request does not work – how do I find the error?

Every error comes as JSON with a fixed code, a sentence in detail and a request_id. detail always says whether anything was charged and what you can do. Start there.

Below you find guides per symptom. If none helps, send us the request_id through the contact form with the category “API”.

## Read first, then search {#grundregeln}

- Errors come as application/problem+json with type, title, status, code, detail, request_id and doc_url. In your code, always check code, never the text.
- With Accept-Language: de, title and detail come in German, otherwise in English.
- The request_id is also in the Request-Id header. Store it with every error.
- In your account under “API” the log shows every request with time, method, path, status, code and request_id – without body and without key.
- If suddenly all requests fail, check the status page first.

## 401 invalid_api_key although the key is there {#fehler-401}

1. Check the header: exactly Authorization: Bearer fm_test_… or fm_live_… – the word Bearer, a space, then the key.
2. Check the key: fm_test_ or fm_live_ plus exactly 32 letters and digits. Often a line break, a space or a quote from the environment variable sticks to it.
3. Is the key revoked (locked)? A rotation with a grace period does not exist yet. The API deliberately does not say which case applies.
4. Check in your account under “API” whether the key is active. Otherwise create a new one.

> **Note:** 403 account_locked means the account is locked – write to us. If every request answers 404, even correct paths, the API is not publicly reachable right now; the status page shows the state.

## 403 missing_scope {#fehler-403}

1. detail names the missing scope, for example videos:write.
2. Scopes are fixed on the key. Create a new key and tick the scope.
3. You tick speech:write and voices:read in addition when you create the key; a key from the account does not have them by default. The same applies to voices:write and avatars:write.

## 402: balance, limit or price ceiling {#fehler-402}

With every 402, nothing was started and nothing was charged.

| Code | Cause | What you do |
| --- | --- | --- |
| `insufficient_balance` | balance too low; `missing_cents` names the minimum amount | top up in your account, then start again |
| `spending_limit_reached` | monthly limit of the account or key reached – `detail` says which | raise the limit or wait for the next month |
| `price_above_max` | price is above `max_price_cents` | estimate again (`POST /estimates`), adjust the ceiling or shorten the video |
| `insufficient_credits` | the connection pays with the account’s credits, which are not enough | buy credits on the website |

## Reading 422 validation_failed {#fehler-422}

errors[] lists up to 50 errors. path is a JSON pointer into your request body: /fields/headline means the field headline inside fields, /fields/neu/2 the third element of the list neu. code says what is wrong; message explains it and names the limit for lengths. The fields limit and actual are planned but not sent today.

1. Get the template’s field schema: GET /templates/{id}.
2. Fix every entry in errors[].
3. Send again. Repeating it unchanged never helps.

| `errors[].code` | Meaning |
| --- | --- |
| `required` | required field missing |
| `too_long` / `too_short` | text too long or too short (`limit`, `actual`) |
| `wrong_type` | wrong type, such as text instead of a number |
| `unknown_field` | the field does not exist – typo? |
| `invalid_value` | value not allowed |
| `not_allowed` | not allowed in this place |

**Response 422**

```json
{
  "type": "https://flow-marketing.org/entwickler/doku/fehler#validation_failed",
  "title": "…",
  "status": 422,
  "code": "validation_failed",
  "detail": "… Nothing was charged.",
  "request_id": "req_Lm4nB7vC1xZ9aS2d",
  "doc_url": "https://flow-marketing.org/entwickler/doku/fehler#validation_failed",
  "errors": [
    { "path": "/brief", "code": "too_long", "message": "At most 2,000 characters." },
    { "path": "/render", "code": "wrong_type", "message": "true or false." }
  ]
}
```

## 429: too many requests or daily limit {#fehler-429}

1. Look at code. rate_limited: per-minute limit – wait for Retry-After, then continue.
2. daily_preview_limit, daily_ai_limit, daily_test_limit, daily_upload_limit: daily limit – do not retry in a loop. With daily_ai_limit, fields still work.
3. Getting 429 regularly? Read RateLimit-Remaining and slow down early; limit=100 and webhooks instead of polling save requests.

## Render stuck or slow {#render-dauert}

1. ready_in_s in the estimate shows the expected duration: [typical, slow], currently 70 and 180 seconds.
2. Status order: queued → rendering → checking → succeeded (or failed/canceled). We sync the state about every minute; short pauses between two states are normal.
3. Instead of polling in quick succession: GET /renders/{id}?wait=30 (long poll up to 30 seconds, at most 10 at a time per account) or use the webhook video.ready.
4. Canceling only works while the video is still being built. If it is already being checked, you get 409 video_busy – then wait for the result.
5. If it takes much longer than the slow value, check the status page and send us the rnd_ id and the request_id.

## Render red: before the start or after {#render-rot}

Check quality.overall on the video before every render. If it says red, do not render – change the fields first.

| When | Answer | Charged? | What you do |
| --- | --- | --- | --- |
| before the start | `422 pre_render_check_red` with `failed_checks` | no | change the flagged fields with `PATCH`, render again |
| after render and automatic fix | render `failed`, video `failed`, `free_rebuild_available: true` | yes | read the report (`GET /videos/{id}/report`), adjust fields, render once with `free_rebuild: true` |
| free rebuild red as well | render `failed`, `is_free_rebuild: true` | amount credited back to the balance | change the fields substantially or write to us |

## Webhook not arriving or signature wrong {#webhook}

1. Check the URL: https:// only, publicly reachable, no private networks, no redirects.
2. Your server must answer 2xx within 10 seconds. Do slow work afterwards.
3. Check the mode: a webhook created in test mode only receives test events, one created in live mode only live events. And: did you subscribe to the event in events?
4. GET /webhooks/{id}/deliveries shows status, attempts, last HTTP code and an excerpt of your answer per delivery. We retry failed deliveries 8 times over about 24 hours, and you can send them again.
5. POST /webhooks/{id}/test sends test.ping – that checks receipt right away.
6. Signature: verify over the raw body, not over re-serialised JSON. Signed is “webhook-id.webhook-timestamp.body” with HMAC-SHA256; the key is the base64 part of the secret after whsec_.
7. After rotating, webhook-signature can contain two signatures for 24 hours, separated by a space. One match is enough.
8. Timestamps older than 5 minutes are rejected – keep your server clock in sync with NTP.

**Verify the signature (Node.js)**

```js
import { createHmac, timingSafeEqual } from 'node:crypto'

// rawBody: the request body exactly as received (string), never re-serialised JSON
export function verifyFlowWebhook(rawBody, headers, secret) {
  const id = headers['webhook-id']
  const ts = headers['webhook-timestamp']
  const signatures = (headers['webhook-signature'] ?? '').split(' ').filter(Boolean)
  const t = Number(ts)
  if (!id || !Number.isInteger(t) || Math.abs(Date.now() / 1000 - t) > 300) return false
  const key = Buffer.from(secret.replace(/^whsec_/, ''), 'base64')
  const expected = 'v1,' + createHmac('sha256', key).update(`${id}.${ts}.${rawBody}`).digest('base64')
  return signatures.some((s) => s.length === expected.length && timingSafeEqual(Buffer.from(s), Buffer.from(expected)))
}
```

## Upload rejected {#upload}

1. Follow the flow: POST /uploads with kind (image, logo or document), filename and size_bytes → PUT the file to the link within 15 minutes → POST /uploads/{id}/complete.
2. Size and type must match what you declared. Images and logos: PNG, JPEG or WebP up to 15 MB and 50 megapixels, no SVG. Documents up to 50 MB.
3. The upl_ id is usable only after complete. Before that you get upload_state or upload_missing.

| Code | What you do |
| --- | --- |
| `upload_type`, `upload_size`, `upload_image_too_large`, `upload_image_invalid` | another file or correct details |
| `upload_virus` | the file was deleted – upload a clean file |
| `image_not_allowed` | the image breaks our content rules – use another image |
| `upload_busy` (409), `upload_concurrency` (429) | complete again after 5 seconds |
| `upload_scan_unavailable`, `upload_image_check_unavailable`, `image_check_unavailable` (503) | complete again after 60 seconds; the file stays in quarantine |
| `daily_upload_limit` (429) | continue tomorrow (UTC) |

## Call from the browser fails (CORS) {#cors}

The API is built for server-to-server calls and sends no CORS headers. The browser therefore blocks calls made directly from a web page. That is on purpose: a key in the browser would be visible to everyone.

Call the API from your server or a server function and pass only the results to your frontend. Preview links (preview_url) and download links can be opened directly in the browser.

## MCP does not connect {#mcp}

- Developer endpoint https://flow-marketing.org/api/turbo/mcp: POST only, with Authorization: Bearer fm_…; a GET gets 405 (there is no event stream). At most 120 messages per minute and IP, batches up to 20.
- AI-app endpoint https://flow-marketing.org/mcp: sign-in via OAuth. Only the account owner may approve.
- If sign-in gets stuck with the mcp-remote bridge, delete the folder ~/.mcp-auth and restart the app.
- Suddenly disconnected? Access tokens last 1 hour, refresh 30 days with rotation. If an old token is reused, we disconnect the app for security. We also disconnect a person’s apps when they are removed from the team or get another role. Just connect again.
- Tool missing or answering insufficient_scope? The permission was not granted when connecting – reconnect and allow it. Avatar tools only appear when the feature is switched on.

## What to send to support {#support}

Contact: flow-marketing.org/en/contact?kategorie=api

- request_id (from the error body or the Request-Id header)
- time in UTC, method and path
- HTTP status and code
- affected ids (vid_…, rnd_…, wh_…) and the mode (test or live)
- never the API key and never the webhook secret

## See also

- [Error codes](https://flow-marketing.org/en/help/api-error-codes)
- [Status page](https://flow-marketing.org/en/status)
- [Contact](https://flow-marketing.org/en/contact)
- [Logs in your account](https://flow-marketing.org/konto/api)
