# Klik Flow API error codes

Source: https://klikflow.id/docs/en/api/errors

| Code | HTTP | Type | Meaning | Fix |
|---|---|---|---|---|
| `missing_key` | 401 | authentication_error | API key not sent | Send the key in the header `Authorization: Bearer kf_live_…` or `kf_test_…`. |
| `key_invalid` | 401 | authentication_error | Unknown API key | The key has a typo or is not an API key. Create a key in Settings › API & Webhook (Pengaturan › API & Webhook). |
| `key_revoked` | 401 | authentication_error | API key revoked | The key was revoked, or the grace period after it was replaced has ended. Use the new key. |
| `key_expired` | 401 | authentication_error | API key expired | The key's lifetime has ended. Create a new key. |
| `member_inactive` | 401 | authentication_error | Key creator is no longer a member | The key's creator is no longer a member of this business. The owner needs to create a new key. |
| `ip_not_allowed` | 403 | permission_error | Server IP not in the key's list | Add your server's IP to the key's IP list, or clear the list. |
| `plan_no_api` | 403 | permission_error | Plan does not include the API for live keys | Live keys need a plan with the API feature. Test keys work on every plan. |
| `tenant_blocked` | 403 | permission_error | Business access suspended | This business's access is suspended. Contact Klik Flow support. |
| `rate_limited` | 429 | rate_limit_error | Too many requests per minute | Wait for the time in the `Retry-After` header (seconds), then retry. |
| `internal_error` | 500 | api_error | Problem at Klik Flow | Something went wrong at Klik Flow. Retry with the same Idempotency-Key; mention the `request_id` if it happens again. |
| `scope_missing` | 403 | permission_error | Key lacks this permission | This key does not have the permission for this action. Create a key with the permission listed in the reference. |
| `permission_missing` | 403 | permission_error | Key creator's role lacks this permission | The key creator's role does not have this permission. The owner can add it in Settings › Roles & access (Pengaturan › Role & hak akses). |
| `invalid_json` | 400 | invalid_request_error | Body is not valid JSON | Send a JSON body with the header `Content-Type: application/json`. |
| `idempotency_key_invalid` | 400 | invalid_request_error | Invalid Idempotency-Key | An Idempotency-Key is 1–255 characters without spaces, for example a UUID. |
| `idempotency_conflict` | 409 | conflict_error | Idempotency-Key used for different content | This Idempotency-Key was already used for another request. Use a new key for a new request. |
| `request_in_progress` | 409 | conflict_error | The same request is still being processed | A request with the same Idempotency-Key is still being processed. Try again in a few seconds. |
| `invalid_request` | 422 | invalid_request_error | Invalid field | The field in `param` is invalid. Check its type and value in the reference. |
| `invalid_phone` | 422 | invalid_request_error | Invalid destination number | Use 8–15 digits with the country code, for example `6281234567890`. |
| `message_too_long` | 422 | invalid_request_error | Message too long | At most 4,000 characters for text and captions. |
| `media_too_large` | 413 | invalid_request_error | File too large | Make the file smaller, within the limit for its type. |
| `test_number_required` | 403 | permission_error | Test keys send only to test numbers | Test keys send only to test numbers. Add the number in Settings › API & Webhook › Test numbers (Pengaturan › API & Webhook › Nomor uji). |
| `channel_not_allowed` | 403 | permission_error | Channel not allowed for this key | This key is limited to other channels, or its creator's role may not use this channel. |
| `channel_unavailable` | 409 | channel_error | No usable WhatsApp number | No connected WhatsApp number may be used by this key. Connect one in Channel, or fill in `from`. |
| `channel_paused` | 403 | permission_error | Channel paused | The channel is paused because it exceeds the plan's quota. The owner can unpause it in Channel. |
| `window_closed` | 409 | channel_error | Outside the 24-hour window | More than 24 hours have passed since the customer last wrote. Send `type: template`. |
| `contact_blocked` | 422 | channel_error | Contact blocked or unsubscribed | The contact is blocked or has unsubscribed, so it is not sent messages. |
| `daily_limit` | 429 | rate_limit_error | Daily message limit reached | The daily message limit was reached. Wait for the time in `Retry-After`, or upgrade the plan. |
| `send_failed` | 502 | channel_error | Message failed to send | The message was created but failed to send. See `message`, then retry with the same Idempotency-Key. |
| `not_found` | 404 | not_found_error | Not found | The id does not exist or is outside what the key's creator can see. |
| `template_not_found` | 404 | not_found_error | Template not found or not approved | The template does not exist or is not approved yet. Check its name and language with `GET /api/v2/templates`. |
| `template_values` | 422 | invalid_request_error | Template variables incomplete | Fill in every template variable named in `message`. |
| `template_not_supported` | 422 | invalid_request_error | Template type not supported yet | This template type cannot be sent through the API yet. |
| `otp_code_invalid` | 422 | invalid_request_error | Invalid OTP code | Set `otp.code` to 1–15 letters, digits, or `-` characters. |
| `new_chat_limit` | 429 | rate_limit_error | Limit of chats to new numbers reached | This key has reached today's limit of chats to new numbers. |
| `channel_refused` | 502 | channel_error | WhatsApp refused the message | WhatsApp refused the message. The reason is in `message`. |
| `cursor_invalid` | 400 | invalid_request_error | Invalid cursor | Use `next_cursor` from the previous response as it is. |
| `live_key_required` | 403 | permission_error | Live key required | Managing webhooks needs a live key, because webhooks receive real events. Test keys can still read and send to test numbers. |
| `webhook_limit` | 422 | invalid_request_error | Webhook limit reached | At most 5 webhooks per business. Delete a webhook you no longer use first. |
| `console_test_only` | 403 | permission_error | The Try it console takes test keys only | The Try it console (Coba) in the docs accepts only test keys (kf_test_…). Call the API with a live key from your server. |
