More
Errors and rate limits
The error format, what each status code means, request rate limits, usage limits and how to retry safely.
Error format
Errors are JSON with the HTTP status in statusCode, a human-readable message and usually an error name. message is a string, or a list of strings when several request fields failed validation. Some errors also carry a machine-readable code (see Error codes) and extra fields.
{
"message": "TikTok: choose who can view the post.",
"error": "Bad Request",
"statusCode": 400
}{
"message": [
"caption must be longer than or equal to 1 characters",
"property groupIds should not exist"
],
"error": "Bad Request",
"statusCode": 400
}Messages are written for people and are safe to show to your users. Don’t parse their wording; it may change. Branch on the status code, and on code when there is one.
Error codes
| Status | code | Meaning |
|---|---|---|
403 | api_key_read_only | The API key is read-only and the request isn’t a GET. Nothing was changed. Use a key with full access. |
409 | account_reconnect_required | A post (or a retry) targets accounts that are disconnected or need re-authorization. accountIds lists them; accounts gives each id with its connectionStatus. Reconnect them in the dashboard, or leave them out. |
422 | idempotency_key_reused | The Idempotency-Key on POST /v1/posts was already used with a different body. Nothing was created. Use a new key for a new post; reuse a key only to resend the identical request. |
{
"statusCode": 409,
"error": "Conflict",
"code": "account_reconnect_required",
"message": "One of the selected accounts needs to be reconnected before you can post to it.",
"accountIds": [
"acc1a000-0000-4000-8000-000000000003"
],
"accounts": [
{
"id": "acc1a000-0000-4000-8000-000000000003",
"connectionStatus": "REAUTH_REQUIRED"
}
]
}Status codes
| Status | Meaning | Retry? |
|---|---|---|
200 / 201 | Success. Most POST requests answer 201; the reference gives the exact code for each endpoint. | — |
400 | The request can’t be done as sent: invalid fields, a broken platform rule, an id that isn’t yours, a usage limit, or nothing left to cancel or reschedule. | Not as is. Fix the request. |
401 | Missing, invalid, revoked or expired API key, or an endpoint that needs the dashboard. | No. Check the key. |
403 | Your Flenvio account is being deleted, or a read-only API key tried to change something (code: "api_key_read_only"). | No. |
404 | Not found, or not yours (Flenvio doesn’t say which). | No. |
409 | Conflict with the current state: a duplicate group name or member set, archiving a scheduled post, retrying a delivery the platform already received, or posting to an account that needs reconnecting. | No. Read the message. |
413 | Upload larger than allowed. | No. |
422 | An Idempotency-Key was reused with a different request body (code: "idempotency_key_reused"). | No. Use a new key. |
429 | Rate limited. | Yes, after Retry-After seconds. |
500 | Something went wrong on Flenvio’s side, or a platform refused a comment or message action. | Yes, with backoff, a few times. |
Rate limits
Each endpoint allows 120 requests per minute from the same IP address (counted per endpoint, so polling one post doesn’t slow down uploads). Starting an upload is limited to 30 per minute. Every response includes the current window:
| Header | Meaning |
|---|---|
X-RateLimit-Limit | Requests allowed per window for this endpoint. |
X-RateLimit-Remaining | Requests left in the current window. |
X-RateLimit-Reset | Seconds until the window resets. |
Retry-After | On 429 only: seconds to wait. |
{
"statusCode": 429,
"message": "ThrottlerException: Too Many Requests"
}Usage limits
Per Flenvio account. Going over one answers 400 with a message naming the limit.
| Limit | Value |
|---|---|
| Posts created | 200 per 24 hours (scheduled ones included) |
| Accounts per post | 50 |
| Groups | 50 |
| Connected accounts | 50 |
| Active API keys | 10 |
| Uploads | 200 per 24 hours |
| Media storage | 10 GB |
| Scheduling horizon | 365 days |
Retrying safely
- Retry
429afterRetry-After, and500,502,503,504and network errors with exponential backoff (for example 1, 2, 4, 8 seconds) and a cap. - Always send an
Idempotency-KeyonPOST /v1/posts, and reuse it when retrying that request, so a retry can never publish twice. - Don’t retry other
4xxerrors unchanged. They’ll fail the same way. - A failed delivery is different from a failed request: see Delivery status and retries.