Skip to content

API reference

Posts

Create, list and fetch posts; reschedule, cancel and archive them; retry failed deliveries.

A post holds the text, media and target accounts; each target account gets a delivery in logs. See Core concepts.

The post object

FieldTypeDescription
idstringPost id.
captionstringThe text.
mediaUrlsstring[]Attached uploads, in order.
mediaUrlstring \| nullOlder single-media field; null for posts created with mediaUrls.
scheduledAtstring \| nullWhen it’s (or was) scheduled to publish, UTC.
createdAtstringWhen the post was created, UTC.
logsDelivery[]One per target account: id, status, errorMessage, platformPostId, remoteDeletedAt, updatedAt, connectedAccount (id, platform, accountName).
mediaPreviews{url, kind}[]Temporary links to view the media (about 15 minutes). kind is image, video or unknown.

Create a post

POST/v1/posts

Publishes now, or at scheduledAt, to every account in accountIds. Each account gets its own delivery. The post is checked against every target platform’s rules first; if anything is wrong, nothing is created.

Auth
API key x-api-key
Rate limit
120/minute; 200 posts per 24 hours per Flenvio account (scheduled ones included)

Unknown fields are rejected (for example sending groupIds returns 400 property groupIds should not exist). The older single mediaUrl field is still accepted; prefer mediaUrls. mediaMeta is accepted and ignored.

Parameters

  • Idempotency-Keyheader · string

    A unique value per post. Repeating it with the same body returns the original post with status: "duplicate"; with a different body it answers 422 idempotency_key_reused. Strongly recommended.

  • accountIdsrequiredbody · string[]

    1–50 of your account ids. Each must be ACTIVE (see connectionStatus); a repeated id counts once.

  • captionrequiredbody · string

    The post text, 1–2,200 characters (less for some platforms). Used as the YouTube title (first line) and description.

  • mediaUrlsbody · string[]

    Up to 20 urls of your completed uploads, in display order. Several items make a carousel where supported.

  • scheduledAtbody · string (ISO 8601)

    Publish later. Future, within 365 days. Omit to publish now.

  • tiktokOptionsbody · object

    Required when targeting TikTok. See below.

  • tiktokOptions.privacyLevelbody · string

    PUBLIC_TO_EVERYONE, MUTUAL_FOLLOW_FRIENDS, FOLLOWER_OF_CREATOR or SELF_ONLY; must be one the account offers (see creator info).

  • tiktokOptions.disableComment / disableDuet / disableStitchbody · boolean

    Turn interactions off for this post. Leave unset to use the account’s own settings.

  • tiktokOptions.brandContentTogglebody · boolean

    Paid partnership disclosure. Not allowed with SELF_ONLY.

  • tiktokOptions.brandOrganicTogglebody · boolean

    “Promotes my own business” disclosure.

  • tiktokOptions.isAigcbody · boolean

    Label the content as AI-generated.

  • youtubeOptionsbody · object

    Optional YouTube upload settings; other platforms ignore it.

  • youtubeOptions.titlebody · string

    Video title, 1–100 characters, no < or >. Defaults to the caption’s first line.

  • youtubeOptions.descriptionbody · string

    Video description, up to 5,000 characters, no < or >. Defaults to the caption.

  • youtubeOptions.privacyStatusbody · string

    public, unlisted or private. Defaults to public. Until the app passes YouTube’s audit, YouTube keeps every upload private.

Example request

curl -X POST "https://api.flenvio.com/v1/posts" \
  -H "x-api-key: $FLENVIO_API_KEY" \
  -H 'Idempotency-Key: 6a1f9d52-0000-4000-8000-000000000001' \
  -H 'Content-Type: application/json' \
  -d '{
  "accountIds": [
    "acc1a000-0000-4000-8000-000000000001",
    "acc1a000-0000-4000-8000-000000000002"
  ],
  "caption": "New single origin from Huila just landed. Bright, juicy, a little floral.",
  "mediaUrls": [
    "https://media.flenvio.example/uploads/5c1f0e2a-0000-4000-8000-000000000001.jpg"
  ]
}'

Response 201

status is queued (publishing now), scheduled, or duplicate (an earlier request with the same key; postId is that post).

201 response
{
  "postId": "b0570000-0000-4000-8000-000000000001",
  "status": "queued"
}

Errors

Create a post errors
StatusWhen
400Validation failed (message is a list), a platform rule is broken (one sentence per problem, e.g. Instagram: add at least one image or video.), an account id isn’t yours (Unknown or unauthorized account(s): …), media isn’t one of your completed uploads, scheduledAt is in the past or too far ahead, or you reached the daily post limit.
403This account is being deleted.
422code: "idempotency_key_reused": this Idempotency-Key was already used with a different body. Nothing is created; use a new key for a new post.
409code: "account_reconnect_required": one or more accounts need reconnecting in the dashboard. accountIds lists them and accounts gives each one’s connectionStatus. Nothing is created.
401Missing, invalid, revoked or expired API key.
429Too many requests to this endpoint; wait Retry-After seconds.
403code: "api_key_read_only": the API key is read-only, and this request changes something.

List posts

GET/v1/posts

Your posts, newest first, each with its deliveries. Archived posts are left out.

Auth
API key x-api-key
Rate limit
120/minute

Account, platform and status filters apply to the same delivery: groupId=…&statuses=FAILED means “posts with a failed delivery to a member of the group”. nextCursor is null on the last page. Dates filter on creation time, not scheduled time.

Parameters

  • limitquery · integer

    1–50, default 20.

  • cursorquery · string

    The nextCursor from the previous page.

  • accountIdsquery · comma-separated ids

    Posts that targeted any of these accounts.

  • groupIdquery · string

    Posts that targeted any member of this group (combined with accountIds if both are given).

  • platformsquery · comma-separated

    For example INSTAGRAM,TIKTOK.

  • statusesquery · comma-separated

    Posts with at least one delivery in these statuses, e.g. FAILED.

  • dateFromquery · ISO 8601

    Created at or after (inclusive).

  • dateToquery · ISO 8601

    Created at or before (inclusive).

Example request

curl "https://api.flenvio.com/v1/posts?limit=20&statuses=FAILED&platforms=INSTAGRAM%2CFACEBOOK" \
  -H "x-api-key: $FLENVIO_API_KEY"

Response 200

200 response
{
  "items": [
    {
      "id": "b0570000-0000-4000-8000-000000000001",
      "caption": "New single origin from Huila just landed. Bright, juicy, a little floral.",
      "mediaUrl": null,
      "mediaUrls": [
        "https://media.flenvio.example/uploads/5c1f0e2a-0000-4000-8000-000000000001.jpg"
      ],
      "scheduledAt": null,
      "createdAt": "2026-10-12T09:30:00.512Z",
      "logs": [
        {
          "id": "de11e000-0000-4000-8000-000000000001",
          "status": "COMPLETED",
          "errorMessage": null,
          "platformPostId": "18000000000000001",
          "remoteDeletedAt": null,
          "updatedAt": "2026-10-12T09:30:04.211Z",
          "connectedAccount": {
            "id": "acc1a000-0000-4000-8000-000000000001",
            "platform": "INSTAGRAM",
            "accountName": "lumen.coffee"
          }
        },
        {
          "id": "de11e000-0000-4000-8000-000000000002",
          "status": "FAILED",
          "errorMessage": "Meta Graph error (400): (#324) Requires upload file",
          "platformPostId": null,
          "remoteDeletedAt": null,
          "updatedAt": "2026-10-12T09:30:21.870Z",
          "connectedAccount": {
            "id": "acc1a000-0000-4000-8000-000000000002",
            "platform": "FACEBOOK",
            "accountName": "Lumen Coffee Roasters"
          }
        }
      ],
      "mediaPreviews": [
        {
          "url": "https://media.flenvio.example/uploads/5c1f0e2a-0000-4000-8000-000000000001.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Expires=900&X-Amz-Signature=…",
          "kind": "image"
        }
      ]
    }
  ],
  "nextCursor": "b0570000-0000-4000-8000-000000000001"
}

Errors

List posts errors
StatusWhen
400Invalid filter (for example an unknown status, limit over 50, or dateFrom is not a valid ISO date.).
404Group not found. for an unknown groupId.
401Missing, invalid, revoked or expired API key.
429Too many requests to this endpoint; wait Retry-After seconds.

Get a post

GET/v1/posts/{id}

One post with all its deliveries. Works for archived posts too. Poll this to follow publishing.

Auth
API key x-api-key
Rate limit
120/minute

Parameters

  • idrequiredpath · string

    Post id.

Example request

curl "https://api.flenvio.com/v1/posts/b0570000-0000-4000-8000-000000000001" \
  -H "x-api-key: $FLENVIO_API_KEY"

Response 200

200 response
{
  "id": "b0570000-0000-4000-8000-000000000001",
  "caption": "New single origin from Huila just landed. Bright, juicy, a little floral.",
  "mediaUrl": null,
  "mediaUrls": [
    "https://media.flenvio.example/uploads/5c1f0e2a-0000-4000-8000-000000000001.jpg"
  ],
  "scheduledAt": null,
  "createdAt": "2026-10-12T09:30:00.512Z",
  "logs": [
    {
      "id": "de11e000-0000-4000-8000-000000000001",
      "status": "COMPLETED",
      "errorMessage": null,
      "platformPostId": "18000000000000001",
      "remoteDeletedAt": null,
      "updatedAt": "2026-10-12T09:30:04.211Z",
      "connectedAccount": {
        "id": "acc1a000-0000-4000-8000-000000000001",
        "platform": "INSTAGRAM",
        "accountName": "lumen.coffee"
      }
    },
    {
      "id": "de11e000-0000-4000-8000-000000000002",
      "status": "FAILED",
      "errorMessage": "Meta Graph error (400): (#324) Requires upload file",
      "platformPostId": null,
      "remoteDeletedAt": null,
      "updatedAt": "2026-10-12T09:30:21.870Z",
      "connectedAccount": {
        "id": "acc1a000-0000-4000-8000-000000000002",
        "platform": "FACEBOOK",
        "accountName": "Lumen Coffee Roasters"
      }
    }
  ],
  "mediaPreviews": [
    {
      "url": "https://media.flenvio.example/uploads/5c1f0e2a-0000-4000-8000-000000000001.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Expires=900&X-Amz-Signature=…",
      "kind": "image"
    }
  ]
}

Errors

Get a post errors
StatusWhen
404Post not found
401Missing, invalid, revoked or expired API key.
429Too many requests to this endpoint; wait Retry-After seconds.

Retry a failed delivery

POST/v1/posts/jobs/{deliveryId}/retry

Publishes one FAILED delivery again with the post’s original content. Returns the delivery, now PENDING.

Auth
API key x-api-key
Rate limit
120/minute

Parameters

  • deliveryIdrequiredpath · string

    The delivery’s id from the post’s logs.

Example request

curl -X POST "https://api.flenvio.com/v1/posts/jobs/de11e000-0000-4000-8000-000000000002/retry" \
  -H "x-api-key: $FLENVIO_API_KEY"

Response 201

201 response
{
  "id": "de11e000-0000-4000-8000-000000000002",
  "status": "PENDING",
  "errorMessage": null,
  "platformPostId": null,
  "remoteDeletedAt": null,
  "updatedAt": "2026-10-12T09:30:21.870Z",
  "connectedAccount": {
    "id": "acc1a000-0000-4000-8000-000000000002",
    "platform": "FACEBOOK",
    "accountName": "Lumen Coffee Roasters"
  }
}

Errors

Retry a failed delivery errors
StatusWhen
400Only FAILED jobs can be retried.
404Job not found
409The platform already received this post (platformPostId is set); retrying would likely duplicate it. Or code: "account_reconnect_required": reconnect the account in the dashboard first.
401Missing, invalid, revoked or expired API key.
429Too many requests to this endpoint; wait Retry-After seconds.
403code: "api_key_read_only": the API key is read-only, and this request changes something.

Reschedule a post

POST/v1/posts/{id}/reschedule

Moves the post’s still-scheduled deliveries to a new time.

Auth
API key x-api-key
Rate limit
120/minute

Parameters

  • idrequiredpath · string

    Post id.

  • scheduledAtrequiredbody · string (ISO 8601)

    At least a few seconds in the future, within 365 days.

Example request

curl -X POST "https://api.flenvio.com/v1/posts/b0570000-0000-4000-8000-000000000001/reschedule" \
  -H "x-api-key: $FLENVIO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "scheduledAt": "2026-10-21T08:30:00Z"
}'

Response 200

200 response
{
  "rescheduled": 2,
  "scheduledAt": "2026-10-21T08:30:00.000Z"
}

Errors

Reschedule a post errors
StatusWhen
400Invalid or past time, or This post has no scheduled deliveries left to reschedule.
404Post not found.
401Missing, invalid, revoked or expired API key.
429Too many requests to this endpoint; wait Retry-After seconds.
403code: "api_key_read_only": the API key is read-only, and this request changes something.

Cancel a scheduled post

POST/v1/posts/{id}/cancel

Cancels every still-scheduled delivery. alreadyPublishing counts deliveries that had started and will finish anyway.

Auth
API key x-api-key
Rate limit
120/minute

Parameters

  • idrequiredpath · string

    Post id.

Example request

curl -X POST "https://api.flenvio.com/v1/posts/b0570000-0000-4000-8000-000000000001/cancel" \
  -H "x-api-key: $FLENVIO_API_KEY"

Response 200

200 response
{
  "canceled": 2,
  "alreadyPublishing": 0
}

Errors

Cancel a scheduled post errors
StatusWhen
400This post has no scheduled deliveries left to cancel.
404Post not found.
401Missing, invalid, revoked or expired API key.
429Too many requests to this endpoint; wait Retry-After seconds.
403code: "api_key_read_only": the API key is read-only, and this request changes something.

Archive a post

POST/v1/posts/{id}/archive

Hides the post from the posts list. Nothing is deleted on the platforms and it can still be fetched by id. Repeating it is harmless. There is no unarchive.

Auth
API key x-api-key
Rate limit
120/minute

Parameters

  • idrequiredpath · string

    Post id.

Example request

curl -X POST "https://api.flenvio.com/v1/posts/b0570000-0000-4000-8000-000000000001/archive" \
  -H "x-api-key: $FLENVIO_API_KEY"

Response 201

201 response
{
  "archived": true
}

Errors

Archive a post errors
StatusWhen
404Post not found.
409The post still has scheduled deliveries; cancel it first.
401Missing, invalid, revoked or expired API key.
429Too many requests to this endpoint; wait Retry-After seconds.
403code: "api_key_read_only": the API key is read-only, and this request changes something.
Posts API reference · Flenvio