Skip to content

Instagram Autoposting

Setup and workflow for automating Instagram posts from the agent: store Instagram Graph API credentials securely, and the agent uploads generated images and captions directly to client business accounts.

Required credentials

Obtain per client account from the Facebook Developers Console:

  1. Instagram Business Account ID — unique numeric ID for the business account.
  2. Long-lived access token — 60-day (or permanent) token with these permissions:
    • instagram_basic
    • instagram_content_publish
    • pages_show_list
    • pages_read_engagement

Store tokens in a secure Supabase table so the agent can fetch them whenever a post is ready:

  • Table: social_credentials
  • Columns: client_name, platform, account_id, access_token, updated_at

⚠️ Tokens go into the database via the administrator — never commit them to a repo or paste them into docs.

Trigger

Once credentials are stored, posting is a plain agent command, e.g. "Prepare today's teaser and post it automatically using the stored credentials."