Errors

Every error uses the same JSON envelope and carries the HTTP status that describes it.

The envelope

json
{
  "error": {
    "type": "validation_error",
    "code": "validation",
    "message": "The scheduled_at field must be a time in the future.",
    "param": "scheduled_at",
    "request_id": "req_a1b2c3d4e5f6a1b2c3d4e5f6",
    "doc_url": "https://iqcore.ai/developers/docs/errors#validation"
  }
}
Field Meaning
type The family: invalid_request, authentication_error, billing_error, permission_error, not_found, conflict, validation_error, rate_limit_error, api_error or platform_error.
code A stable, machine-readable code. Branch on this field.
message A sentence in English for a person. It may change at any time. Do not parse it.
param The request field the error is about, or null.
request_id The id of this request (req_ and 24 characters).
doc_url A link to the entry for this code below.

Every response, success or error, has an X-Request-Id header with the same id. Quote it when you contact Support. IQCore never takes the id from the client.

Messages are in English only and never contain a secret or an internal detail. A 500 says only internal; the request id is enough for Support to find it.

202 is not an error

Some calls answer 202 Accepted with the resource and a requires_action object: nothing ran yet, and a person must act in IQCore first (approve a post, or choose TikTok settings). Treat it as a normal answer. See Post states and approval.

Extra fields

Some errors add fields inside error:

Field Seen on Meaning
details[] validation A list of {param, message}, one per invalid field.
required_scope missing_scope The scope the operation needs.
required_role team_role The lowest role that may do this.
existing_id external_ref_exists The id of the post that already has this external_ref.
oldest_cursor cursor_expired The oldest events cursor still served. Start again from it.
billing_url insufficient_credits A dashboard page where credits can be bought.
credits insufficient_credits, quote_exceeded, spend_cap_reached The price of the request in credits.
max_credits quote_exceeded The limit you sent.
balance insufficient_credits, quote_exceeded The credits that could pay.
limit spend_cap_reached Which daily cap was reached: key or organization.
cap spend_cap_reached The daily limit in credits.
used spend_cap_reached Credits used today.
resets_at spend_cap_reached When the limit resets.

Clients must ignore fields they do not know. New fields can appear at any time (see Versioning).

Which errors to retry

Status Retry?
400, 401, 403, 404, 410, 413, 422 No. Fix the request, key or permission first. 410 cursor_expired has its own recovery: restart from oldest_cursor (see Events).
402 No. Buy credits, raise max_credits or wait for the daily cap to reset. Nothing was charged.
409 request_in_progress Yes, after Retry-After seconds (it is 1), with the same Idempotency-Key.
409 (other) No. The state changed: read the resource and decide.
429 Yes, after the Retry-After seconds. See Rate limits.
500, 502 Yes, with backoff (1 s, 2 s, 4 s ... up to a minute) and the same Idempotency-Key for writes. If the answer was 500 outcome_unknown on a spend, check the job before you try again.

Send an Idempotency-Key on every write. Then a retry after a timeout or a 5xx can never act twice. Refusals that changed nothing (4xx, 202) free the key, so you can fix the cause and retry with the same key.

Error codes

CodeHTTPMeaningWhat to do
organization_required400The key works in several organizations and the request named none.Send organization_id (query on GET, body on writes).
key_in_url400An API key was found in the URL. URLs end up in logs.Rotate the key now and send it only in the Authorization header.
malformed_json400The body is not valid JSON.Fix the JSON; send Content-Type: application/json.
invalid_body400The JSON body is not an object.Send a JSON object.
idempotency_key_invalid400The Idempotency-Key header has the wrong format.Use 1–100 characters of A–Z a–z 0–9 . _ : -
method_not_allowed405This method is not allowed on this path.Check the method in the reference.
unsupported_media_type415The body type does not fit the operation (multipart to a JSON operation, or the other way round).Send JSON, or multipart/form-data where the reference says so.
missing_api_key401No Authorization header.Send Authorization: Bearer iqk_….
invalid_api_key401The key is unknown or malformed.Check the key; make a new one on the API keys page.
api_key_revoked401The key was revoked (by a person, an admin, or because the password, e-mail or two-step sign-in changed).Make a new key.
api_key_expired401The key expired, or its rotation grace ended.Use the new key from the rotation, or make a new one.
insufficient_credits402Not enough purchased credits for this work.Buy credits (billing_url) and retry.
quote_exceeded402The price is higher than your max_credits.Check GET /quote and send a higher max_credits if you agree.
spend_cap_reached402The daily API credit cap of the key or the organization is reached.Wait for resets_at, or ask the owner to raise the cap.
missing_scope403The key does not have the scope this operation needs (required_scope).Give the key the scope on the API keys page.
team_role403The login behind the key has a role too low for this (required_role), or may no longer hold a key.Use a key of an owner or admin, or change the role.
plan_required403The organization has no plan that includes this (or live keys).Choose a plan; test keys work on every plan.
plan_limit403The organization has more keys than its plan allows (newest keys paused).Revoke keys or upgrade.
api_disabled403The API is not open for this organization (private beta).Ask support to join the beta.
organization_suspended403The organization is suspended.Contact support.
login_suspended403The login behind the key is suspended.Contact support.
verify_email403The login behind the key has not verified its e-mail address.Verify the e-mail address in IQCore.
sandbox_forbidden403A test key tried something only a live key may do: change a live post, spend credits, or change anything other than its own sandbox posts and new media files.Use a live key for this, or work on sandbox posts.
storage_full403The Media library storage of the organization is full.Delete files or upgrade.
disabled403This feature is switched off for now.Try again later or ask support.
approval_required403This action must be done by a person in IQCore.Open IQCore and do it there.
forbidden403Not allowed.Check the key, its scopes and the organization.
not_found404No such resource in this organization (also for another organization's ids).Check the id and organization_id.
external_ref_exists409A post with this external_ref already exists (existing_id).Use the existing post, or another external_ref.
not_editable409The post (or one of its targets) is publishing or published and cannot change.Read the post; create a new one if needed.
request_in_progress409A request with the same Idempotency-Key is still running.Wait Retry-After seconds and send it again.
in_progress409The same action is already running.Wait Retry-After seconds and read the result.
stale409The price or the state changed between the quote and the run.Read the resource or quote again, then retry.
version_conflict409Someone changed the resource at the same time.Read it again and retry.
cursor_expired410The events cursor is older than the oldest kept event (30 days).Restart from oldest_cursor and reconcile with GET /posts?updated_since=.
file_too_large413The file or the request body is too large.Send a smaller file, or import large videos from a URL.
validation422A parameter is missing or wrong (param, details[]).Fix the parameters named in details[].
idempotency_key_reused422The Idempotency-Key was used for another request in the last 24 hours.Use a new key for a new request.
max_credits_required422An operation that spends credits needs max_credits.Send max_credits (GET /quote tells the price).
model_unavailable422The chosen AI model is not available now.Choose another model from the models list.
unsupported_format422The format is not supported here (for example story).Use post, reel or carousel.
media_not_ready422The media item is not ready (still importing, or failed).Wait for media.ready or poll GET /media/{id}.
time_passed422The time is in the past or too close.Send a time at least one minute ahead.
file_upload_failed422The upload did not arrive complete.Upload again.
unsupported_file_type422The file type (read from its bytes) is not accepted.Send JPG, PNG, WebP, GIF, MP4, MOV, WebM or a supported audio file.
file_rejected422The file was refused by the checks (virus scan, size, type, pixel limit).Send another file.
import_failed422The file could not be stored because of an error on our side. Nothing was saved, and the answer never contains internal details.Try again later. If it keeps happening, send the request_id to IQCore support.
empty422The file or the URL's answer is empty.Check the file or URL.
url_invalid422The URL is not a valid web address.Send a full https:// URL.
url_scheme422Only http:// and https:// URLs can be imported.Use https.
url_credentials422URLs with a user name or password are refused.Use a signed or public link.
url_port422Only the standard ports are accepted (443 for https, 80 for http).Serve the file on the standard port.
url_host422The URL must name a public host (no IP addresses, no local names).Use a public host name.
url_unresolvable422The host of the URL could not be found.Check the URL.
url_not_public422The host of the URL is not a public internet address.Use a public host.
rate_limited429Too many requests for one of the rate-limit buckets.Wait Retry-After seconds; spread the calls.
internal500Something went wrong on our side. No detail is given.Retry later; give support the request_id.
outcome_unknown500A spend started but its result is not known.Do not repeat blindly: read the job or the list first, then give support the request_id.
provider_error502The platform (Meta, TikTok) refused.Read the message; retry later or fix the content.

Next: Rate limits, Idempotency and external_ref.