Skip to content
Connect an agent

Overview

Errors

Every failed call answers with the same JSON shape and a stable code. Branch on the code; the message is for people and may change.

TL;DR

QuestionAnswer
What does a failure look like?{ "error": { "code": "...", "message": "...", "details": ... } } with a 4xx or 5xx status.
What should my code branch on?error.code. It never changes for a given problem.
What does the SDK do?It throws FlungError with status, code, message and details. Two codes are its own: network_error (no answer arrived) and unexpected_response.
Which are worth retrying?rate_limited after Retry-After, and internal_error with the same idempotency key. The SDK retries these and network failures by itself.

Codes

22 codes.

CodeWhat to do
unauthorizedThe credential is missing, unknown, revoked or expired. Check the key, or refresh the OAuth token.
forbiddenThe credential cannot do this: a connect token outside its seven calls or its page, or a key without the scope.
validation_failedThe request does not match the schema. details lists each problem with its path.
not_foundNo such resource in this workspace, or the route does not exist.
unknown_accountsOne or more accountIds are not this workspace's. details.accountIds names them.
platform_not_supportedFlung cannot connect that platform here.
media_requiredThe platform refuses a post with no image or video.
account_needs_reconnectThe account's access ended. Start a reconnect and have the person approve it.
not_configuredThe platform's app credentials are not set up in this environment.
connect_failedThe platform refused to start the connect. The message says why.
platform_errorThe platform answered with an error. The message carries its reason.
post_not_editableThe post has started publishing or has finished, so it can no longer change.
unknown_variableThe text names a {{variable}} the workspace has not set.
rate_limitedToo many requests. Wait for the seconds in Retry-After.
unsupported_mediaThe file is not a type Flung accepts, judged from its first bytes.
media_too_largeThe file is over the limit for its type.
unknown_mediaOne or more mediaIds are not this workspace's.
media_not_readyA file is still uploading. Wait until its status is ready.
text_too_longThe text is over a platform's limit. details names the platform and the limit.
publish_at_in_pastpublishAt is in the past. Omit it to publish now.
idempotency_key_reusedThe Idempotency-Key was used before with a different request. Use a new key for new work.
internal_errorSomething failed on Flung's side. Retry with the same idempotency key.