Skip to content

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.

A rule or state problem · 400
{
  "message": "TikTok: choose who can view the post.",
  "error": "Bad Request",
  "statusCode": 400
}
Request validation · 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

StatuscodeMeaning
403api_key_read_onlyThe API key is read-only and the request isn’t a GET. Nothing was changed. Use a key with full access.
409account_reconnect_requiredA 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.
422idempotency_key_reusedThe 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.
An account needs reconnecting · 409
{
  "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

StatusMeaningRetry?
200 / 201Success. Most POST requests answer 201; the reference gives the exact code for each endpoint.—
400The 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.
401Missing, invalid, revoked or expired API key, or an endpoint that needs the dashboard.No. Check the key.
403Your Flenvio account is being deleted, or a read-only API key tried to change something (code: "api_key_read_only").No.
404Not found, or not yours (Flenvio doesn’t say which).No.
409Conflict 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.
413Upload larger than allowed.No.
422An Idempotency-Key was reused with a different request body (code: "idempotency_key_reused").No. Use a new key.
429Rate limited.Yes, after Retry-After seconds.
500Something 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:

HeaderMeaning
X-RateLimit-LimitRequests allowed per window for this endpoint.
X-RateLimit-RemainingRequests left in the current window.
X-RateLimit-ResetSeconds until the window resets.
Retry-AfterOn 429 only: seconds to wait.
Rate limited · 429
{
  "statusCode": 429,
  "message": "ThrottlerException: Too Many Requests"
}

Usage limits

Per Flenvio account. Going over one answers 400 with a message naming the limit.

LimitValue
Posts created200 per 24 hours (scheduled ones included)
Accounts per post50
Groups50
Connected accounts50
Active API keys10
Uploads200 per 24 hours
Media storage10 GB
Scheduling horizon365 days

Retrying safely

  • Retry 429 after Retry-After, and 500, 502, 503, 504 and network errors with exponential backoff (for example 1, 2, 4, 8 seconds) and a cap.
  • Always send an Idempotency-Key on POST /v1/posts, and reuse it when retrying that request, so a retry can never publish twice.
  • Don’t retry other 4xx errors unchanged. They’ll fail the same way.
  • A failed delivery is different from a failed request: see Delivery status and retries.
Errors and rate limits · Flenvio API · Flenvio