Skip to content

Get started

Quickstart

Create an API key, list your connected accounts and publish your first post, with copy-paste examples in curl, JavaScript and Python.

You need a Flenvio account with at least one connected account. A Facebook Page or Threads profile is easiest for a first test because they accept text-only posts; Instagram, YouTube and TikTok need an image or video (see Upload media).

1. Create an API key

  1. In the dashboard, open Settings → Developer.
  2. Under API keys, enter a name you’ll recognize later (for example “Blog autoposter”), keep Full access (this guide publishes a post), pick an expiry and select Create key.
  3. Copy the key now. It starts with flv_ and is shown only once.

Keep the key out of your code. The examples below read it from the FLENVIO_API_KEY environment variable:

bash
export FLENVIO_API_KEY="flv_…your key…"

2. List your accounts

Every request sends the key in the x-api-key header. Start by listing the accounts you can publish to:

curl "https://api.flenvio.com/v1/accounts" \
  -H "x-api-key: $FLENVIO_API_KEY"
Response · 200
[
  {
    "id": "acc1a000-0000-4000-8000-000000000001",
    "platform": "INSTAGRAM",
    "accountName": "lumen.coffee",
    "avatarUrl": "https://media.flenvio.example/avatars/lumen-ig.png",
    "platformAccountId": "17841400000000001",
    "createdAt": "2026-09-02T14:05:11.000Z",
    "connectionStatus": "ACTIVE"
  },
  {
    "id": "acc1a000-0000-4000-8000-000000000002",
    "platform": "FACEBOOK",
    "accountName": "Lumen Coffee Roasters",
    "avatarUrl": "https://media.flenvio.example/avatars/lumen-fb.png",
    "platformAccountId": "100000000000001",
    "createdAt": "2026-09-02T14:03:40.000Z",
    "connectionStatus": "ACTIVE"
  }
]

Note the id of the account you want to post to. Only use accounts whose connectionStatus is ACTIVE: an account marked REAUTH_REQUIRED needs to be reconnected in the dashboard first, and posts to it are refused with 409 (code: "account_reconnect_required").

3. Publish a post

Send the text and the account ids. Add an Idempotency-Key header with a unique value: if your request times out and you send it again with the same key, Flenvio returns the first post instead of publishing twice.

curl -X POST "https://api.flenvio.com/v1/posts" \
  -H "x-api-key: $FLENVIO_API_KEY" \
  -H 'Idempotency-Key: quickstart-2026-10-12-001' \
  -H 'Content-Type: application/json' \
  -d '{
  "accountIds": [
    "acc1a000-0000-4000-8000-000000000002"
  ],
  "caption": "New single origin from Huila just landed. Bright, juicy, a little floral."
}'
Response · 201
{
  "postId": "b0570000-0000-4000-8000-000000000001",
  "status": "queued"
}

queued means Flenvio accepted the post and is publishing it now. Nothing was rejected: if the text or media broke a platform’s rules you’d get a 400 with the reason instead.

4. Check that it published

Each account gets its own delivery. Fetch the post to see how each one went:

curl "https://api.flenvio.com/v1/posts/b0570000-0000-4000-8000-000000000001" \
  -H "x-api-key: $FLENVIO_API_KEY"
Response · 200
{
  "id": "b0570000-0000-4000-8000-000000000001",
  "caption": "New single origin from Huila just landed. Bright, juicy, a little floral.",
  "mediaUrl": null,
  "mediaUrls": [],
  "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-000000000002",
        "platform": "FACEBOOK",
        "accountName": "Lumen Coffee Roasters"
      }
    }
  ],
  "mediaPreviews": []
}

A delivery with status: "COMPLETED" is live, and platformPostId is the post’s id on the platform. Most posts finish within seconds; videos can take a few minutes. If a delivery shows FAILED, errorMessage says why. See Delivery status and retries.

Next steps

Quickstart: your first post with the Flenvio API · Flenvio