Skip to content

More

For AI agents

Give an AI agent like Claude Code, Cursor or ChatGPT safe access to Flenvio, with a copyable setup prompt and machine-readable docs.

An agent can draft posts, upload media, schedule them across your accounts and report back on how they did. Because posts go out publicly under your name, set it up so the agent always asks you before it publishes.

Give an agent access safely

  1. Create a dedicated key in Settings → Developer, named after the agent (for example “Claude Code – October campaign”), with the shortest expiry that fits the job.
  2. Give it to the agent as an environment variable (FLENVIO_API_KEY), not in the chat or in a file the agent might commit or share.
  3. Paste the setup prompt below into the agent’s instructions (a project rules file, custom instructions or the first message).
  4. Review before you confirm. The agent should show you the exact post, accounts and time, and wait for your yes.
  5. Revoke the key when you’re done. Revoking takes effect immediately.

Agent setup prompt

Copy this into your agent. It includes your API base URL, the endpoints it needs and the rule to ask before publishing.

Agent setup prompt
You can use the Flenvio API to publish and schedule social media posts for me.

Base URL: https://api.flenvio.com
Auth: send the header "x-api-key" with the value of the FLENVIO_API_KEY environment variable on every request. Never print, log or repeat the key.
Full documentation (markdown): http://flenvio.com/llms-full.txt

Key endpoints:
- GET /v1/accounts: accounts I can publish to. Only use ones with connectionStatus "ACTIVE" (others are refused with 409 account_reconnect_required).
- GET /v1/account-groups: my groups. Expand a group's members into accountIds and remove duplicates.
- Media: POST /v1/media/uploads {contentType, sizeBytes} -> PUT the file to uploadUrl with the returned headers -> POST /v1/media/uploads/{assetId}/complete -> put the returned url in mediaUrls.
- POST /v1/posts {accountIds, caption, mediaUrls?, scheduledAt?, tiktokOptions?} with an "Idempotency-Key" header (a new UUID per post; reuse it only when resending the same request).
- GET /v1/posts/{id}: each account's delivery is in logs[] with status and errorMessage.
- POST /v1/posts/{id}/reschedule {scheduledAt} and POST /v1/posts/{id}/cancel for scheduled posts.
- POST /v1/posts/jobs/{deliveryId}/retry: retry one FAILED delivery.

Rules:
1. Ask before acting. Before you publish, schedule, reschedule, cancel or retry anything, show me the exact text, the media, the accounts (name and platform) and the time with its time zone, and wait for my explicit yes. Do the same before replying to comments, sending messages, or hiding or deleting comments.
2. Never disconnect accounts (DELETE /v1/accounts/{id}) or delete or change groups unless I ask for exactly that.
3. Check platform rules first: Instagram, YouTube and TikTok need media; Threads allows at most 500 characters; YouTube takes exactly one video; TikTok needs tiktokOptions.privacyLevel chosen from GET /v1/tiktok/accounts/{accountId}/creator-info. If the API answers 400, read the message, fix the request and ask me again. Don't guess.
4. Times are ISO 8601. Convert my local time to UTC (or include the offset) and confirm it with me.
5. After creating a post, poll GET /v1/posts/{id} every few seconds, slowing down, until no delivery is PENDING or PROCESSING. Then report per account: published, scheduled, or failed with its errorMessage. A FAILED delivery may still be retried automatically for about a minute.
6. Never retry a delivery whose platformPostId is set; tell me instead. On 429, wait Retry-After seconds. Don't loop on errors: stop and tell me.

Where to put it

AgentWhere
Claude CodeA CLAUDE.md file in your project, or the start of the conversation. Set FLENVIO_API_KEY in the shell you start it from.
CursorA project rule (.cursor/rules), with the key in your environment.
ChatGPT and other chat agentsCustom instructions or the first message. Only use agents that can make HTTP requests with a secret you provide, and never paste the key into the chat itself.

Docs for agents

  • /llms.txt: a short index of these docs, following the llms.txt convention.
  • /llms-full.txt: every page as plain markdown in one file, so an agent can read the whole documentation in one request.

A good agent workflow

  1. List accounts and groups, and confirm with you which ones to use.
  2. Draft the text and check it against platform rules.
  3. Upload media and show you what it will attach.
  4. Show the final post, accounts and time; wait for your yes.
  5. Create the post with a fresh Idempotency-Key.
  6. Poll until each delivery finishes, then report results and any errorMessage.
Using the Flenvio API with AI agents · Flenvio