API reference

    Errors and rate limits

    Every failure in the Preflight API is a JSON body with a stable code, a message written for a person and, when a field is at fault, its name. The status says what kind of failure it is: 4xx for a request the API will not take as sent, 402 for the plan's allowance, 422 for a post a network would refuse, 424 for a refusal passed on from a network, 429 for a rate limit. Requests are limited per address and, for the costlier calls, per key.

    Errors and limits

    Failures return a stable code and a message meant to be read by a person.

    { "error": { "code": "invalid_request", "message": "targets[] is required.", "field": "targets" } }
    400invalid_requestThe body did not validate; field says which
    400no_slotsA queued post for a channel without a schedule
    401unauthorizedMissing, expired or unrecognised key
    402post_limit, upload_limit, file_too_large, channel_limit, ai_limit, ai_not_in_planThe plan's allowance
    403forbiddenThe key lacks the scope for this call
    404not_foundNo such post, file or account here
    409account_not_connected, media_unusableA named account or file cannot be used
    409already_started, targets_locked, in_flight, nothing_to_retryNot in the post's current state
    409unsupported, not_published, account_disconnected, unsupported_connection, account_missingThe network or target does not allow this
    409video_on_youtubeThe video already waits on YouTube; the file cannot change
    413payload_too_large, file_too_largeA request body over 1 MB, or a file over the server's 2 GB
    422validation_failedA network would refuse it; see issues
    422ai_declinedThe assistant would not write this
    429rate_limitedToo many requests; wait for Retry-After
    424metrics_failed, comments_failed, comment_action_failed, update_failed, delete_failed, youtube_refused, playlist_refused, ai_failedThe network or the assistant refused; its message is passed on
    503ai_unavailableThe assistant is not set up on this server

    A 402 carries limit: { used, allowed } and the plan that would allow it in upgradeTo. Requests are limited to 600 a minute per address, with tighter limits on creating files (60), on AI (20), on account lookups such as boards and playlists (60), on creating webhooks (20) and on MCP (120). The tighter limits count per key.

    Questions: info@preflight.social. The same API as a schema: openapi.json (OpenAPI 3.1).

    Write it once. Let the rules be our problem.

    Preflight checks every post against each network's rules before it leaves, then publishes it to twelve networks. Free plan, no card.