Connected Accounts is where platform tokens are managed. Telegram, Facebook, Instagram, and Threads accounts are stored per-business in the database — not in .env.
Manage Connected Accounts →
Two-tier credential system:
Connected Accounts (database) — the primary method. Each platform account is saved per-business with an encrypted token. Use the Connected Accounts page to add or update tokens.

Legacy .env keys (this page) — fallback only. If a Connected Account exists for a platform, these .env keys are ignored for posting. They are still read by the legacy api/social_test.php endpoint used by the Test buttons below.
App-Level Secrets (Coolify / .env)
TOKEN_ENCRYPTION_KEY Encrypts all stored platform tokens at rest (AES-256). Required before saving accounts in Connected Accounts.
✓ Set
CRON_SECRET Protects the token-refresh and migration endpoints. Defaults to a hardcoded value if not set — set a unique secret in Coolify.
✓ Set
FACEBOOK_APP_ID Required for OAuth login flow (future phase). Not needed for manual token paste in Connected Accounts.
— Not set
FACEBOOK_APP_SECRET Required for OAuth login flow (future phase).
— Not set
FACEBOOK_API_VERSION Optional — defaults to v19.0 if not set.
— Not set
Legacy .env Platform Credentials
✈
Telegram Live
.env not set
Legacy fallback. If this platform is already connected via Connected Accounts, these .env keys are not required for posting. Telegram connected accounts are fully operational — you do not need to set TELEGRAM_BOT_TOKEN here.
TELEGRAM_BOT_TOKEN
not set ✗
TELEGRAM_CHAT_ID
not set ✗
  1. 1. Open Telegram and search for @BotFather.
  2. 2. Send /newbot, follow prompts, copy the Bot Token (looks like 123456:ABCdef…).
  3. 3. Add the bot as Admin to your channel or group.
  4. 4. Chat ID: use your public channel username (e.g. @mychannel) or the numeric ID of a private group (e.g. -1001234567890).
  5. 5. To find a private group ID: forward any message from the group to @userinfobot.
𝐟
Facebook Page Live
.env not set
Legacy fallback. If this platform is already connected via Connected Accounts, these .env keys are not required for posting.
META_ACCESS_TOKEN
not set ✗
META_PAGE_ID
not set ✗
  1. 1. Go to developers.facebook.com → My Apps → create or select your app.
  2. 2. Add Pages API product. Under Tools → Graph API Explorer.
  3. 3. Select your app, then Generate User Token with permissions: pages_manage_posts, pages_read_engagement, pages_show_list.
  4. 4. Exchange for a long-lived Page Access Token (valid 60 days). Paste into META_ACCESS_TOKEN.
  5. 5. Page ID: Open your Facebook Page → About → Page Transparency → Page ID (numeric, e.g. 123456789). Paste into META_PAGE_ID.
◈
Instagram Live
.env not set
Legacy fallback. If this platform is already connected via Connected Accounts, these .env keys are not required for posting.
META_ACCESS_TOKEN
not set ✗
INSTAGRAM_ACCOUNT_ID
not set ✗
  1. 1. Connect your Instagram account to your Facebook Page (Settings → Linked Accounts).
  2. 2. In Graph API Explorer, call GET /me/accounts with your user token to see pages.
  3. 3. From the page entry, call GET /{page-id}?fields=instagram_business_account to get the Instagram Business Account ID.
  4. 4. Paste that numeric ID into INSTAGRAM_ACCOUNT_ID.
  5. 5. Use the same META_ACCESS_TOKEN as Facebook — it covers both.
  6. ⚠ Instagram API requires a media (image/video) — text-only posts are not supported.
◎
Threads Live
.env not set
Legacy fallback. If this platform is already connected via Connected Accounts, these .env keys are not required for posting.
THREADS_ACCESS_TOKEN
not set ✗
THREADS_USER_ID
not set ✗
  1. 1. Go to developers.facebook.com → create a new app, add Threads API product.
  2. 2. Complete the OAuth flow: https://threads.net/oauth/authorize?client_id=…&scope=threads_basic,threads_content_publish.
  3. 3. Exchange the code for an access token via POST https://graph.threads.net/oauth/access_token.
  4. 4. Extend to long-lived token via GET /access_token?grant_type=th_exchange_token&….
  5. 5. Call GET /me?fields=id,username to get your Threads User ID.
  6. 6. Paste token → THREADS_ACCESS_TOKEN and numeric ID → THREADS_USER_ID.
♪
TikTok Placeholder
.env not set
Legacy fallback. TikTok requires a per-user OAuth token — these app-level keys are used to initiate the OAuth flow (Phase 2).
TIKTOK_CLIENT_KEY
not set ✗
TIKTOK_CLIENT_SECRET
not set ✗
  1. 1. Go to developers.tiktok.com → My Apps → Create App.
  2. 2. Add the Content Posting API product.
  3. 3. Under App Settings, copy your Client Key and Client Secret.
  4. 4. Paste into TIKTOK_CLIENT_KEY and TIKTOK_CLIENT_SECRET.
  5. ⚠ TikTok requires a video file — text-only posts are not supported.
  6. ⚠ Full OAuth user-login flow is needed before posting. This is Phase 2.