Channels
Conversations happen on Telegram, Instagram (Direct) and Facebook (Messenger). All three share one inbox, one AI Seller and one case analysis; what differs is how an account is connected and the platform rules a reply must obey. Instagram and Facebook add Meta's messaging windows, and those windows decide what the AI may send.
What each channel is#
A conversation carries its channel (TELEGRAM, INSTAGRAM or FACEBOOK), so the inbox can filter by it and every insight board has a view per channel plus one for all channels. Social content is analysed separately, under Business insights.
Connect Instagram#
Instagram connects with Instagram Login, which needs no Facebook Page — the usual case for a business that only has an Instagram account.
- In the console, Channels → Instagram → Connect, or
POST /channels/instagram/connect. The answer holds the authorize URL; the request is signed state, valid for ten minutes and single-use. - You sign in at Instagram and grant the messaging permissions. Oqim exchanges the code for a long-lived token (60 days), reads the profile, and creates the account with the capabilities the granted permissions allow.
- The account is subscribed to Meta's webhooks (messages, postbacks, reactions, seen, comments, mentions) and its history import starts by itself.
- The browser returns to the console with
?connected=, or with?error=and one ofdenied,state_invalid,already_connected_elsewhere,missing_permissionsorprovider_error.
Connect Facebook Pages#
Facebook connects with Facebook Login for Business. You grant the Pages you want, and every Page in the grant is connected with its own Page token and its own webhooks (messages, postbacks, feed) — the console reports them as ?connected=<id,id>.
Account status, capabilities and tokens#
Capabilities come from the permissions actually granted: MESSAGING (read and answer direct messages), COMMENTS (read comments, reply, send private replies), CONTENT (read posts and videos) and INSIGHTS (reach, views and audience metrics). Turning the AI on for an account needs the messaging capability and a business assigned to it.
Instagram tokens are refreshed before they expire by a daily task. A token Meta rejects as invalid sets the account to AUTH_REQUIRED with a reason. A YouTube owner's refresh token being refused does the same, and a public channel keeps syncing with the platform key meanwhile.
Meta's messaging windows#
Meta decides when a business may write to a person, and Oqim enforces it in the reply gate — before a message is queued, not after it fails.
- The AI replies only inside 24 hours. Outside that window it does not write, whatever its autonomy level.
- The human agent window needs the Human Agent permission, approved in App Review; the platform setting
META_HUMAN_AGENTsays whether the app has it. Where it does, a reply sent between 24 hours and 7 days carries the tag so Meta accepts it. - Your business's reply window setting can shorten the 24 hours, never lengthen it. The gate uses the earlier of the two.
- Follow-ups after a private reply are allowed only once the person answers — and then the 24-hour window applies as usual.
- A private reply goes over the wire with the comment it answers, so it can never be repeated for the same comment.
What the gate records
Each conversation on Instagram or Facebook carries the window's end (the person's last message plus 24 hours), the human window's end where the app has the permission, and the basis a message may be sent on: REPLY_WINDOW for anyone inside 24 hours, HUMAN_AGENT for a person between 24 hours and 7 days.
What cannot be done#
- No cold outreach, ever. Nothing is sent to people who never wrote to the account. A campaign on Instagram or Facebook reaches only the people whose window is open; the rest are skipped with a reason, and the audience preview says who can be reached now and why.
- No marketing messages. Messenger's marketing messages exist in Meta's documentation but are a paid ad-account API, which Oqim does not drive — launching such a campaign is refused with a clear error. Instagram has no marketing messages at all. Oqim does record a Page's opt-ins and show the topics and their subscribers.
- History is limited. Meta's Conversations API returns only the last 20 messages of a thread, so older history cannot be fetched; the console says so plainly. Every new message is stored in full from the moment the account is connected.
- Groups and channels are not covered. Oqim handles private chats only.
- Text limits and rate limits differ per channel. Oqim uses the channel's own limit for a reply and shows it to the console, rather than assuming one number everywhere.
- Meta's terms win. What Oqim may do on Instagram and Facebook is bounded by Meta's platform rules and by the permissions and reviews your app actually has.
Comment-to-DM automation#
When a comment on one of the account's posts or reels matches an automation, the Seller sends one private reply to that commenter, within Meta's 7-day window. A comment matches when it contains one of the automation's keywords, or when JEV judges it a buying or pricing question above the automation's confidence threshold. Automation rules are per account: which posts (all or selected), the keywords, the threshold, and either a message template per language or the Seller's own reply.
- One private reply per comment, ever. Webhook replays and periodic syncs never produce a duplicate.
- Every reply is logged per comment, audited, and rate-limited twice: by the automation's own hourly cap (100 by default, at most 750) and by Meta's 750 an hour per account.
- Public replies to comments are optional and are human-approved drafts by default.
App review, before you can connect#
Until Meta grants advanced access — which needs business verification and App Review for the messaging, comment and insights permissions — only people with a role on your Meta app can connect an account. The console says so when the provider reports review_pending, and connecting is refused rather than half-working. The Human Agent permission is a separate review.
Meta callbacks#
Meta requires two callbacks, both signed. On a deauthorize or a data deletion request Oqim drops that account's tokens and marks it disconnected; for a data deletion it also deletes that person's messages and profile data, and answers with a confirmation code and a status URL.
Where to manage this#
- Channels in the console lists every account by platform with its status, capabilities, the business it answers for, whether the AI answers DMs there, open conversations and the last sync.
- The account page shows the status and its reason, lets you reconnect, check or disconnect, explains in plain words what the 24-hour rule means for AI replies, and holds the history and content imports.
- Live changes arrive as
channels.account.updated,channels.history.imported,channels.private_reply.sent,channels.private_reply.failed,channels.marketing_subscription.updated,ai.social.syncedandai.social.narrative_ready— see Webhooks.
Endpoints#
All under /api/v1. Viewing takes accounts:read; connecting, changing or disconnecting takes accounts:manage. Callbacks and webhooks are public but verified. See the API reference for bodies and responses.