Skip to content

TikTok: allow a comments-only connection (EEA accounts can't get Business Messaging scopes) #1563

Closed

Description

@rancaHoratiu

TikTok's Business Messaging API is not available to accounts registered in the EEA, Switzerland or the UK, so these accounts can't be granted message.list.read/send/manage. ChatbotX treats those scopes as core: the connect is refused without them, and saving TikTok credentials fails if the DIRECT_MESSAGE webhook subscription is rejected.

As a result, EU accounts can't use TikTok Comment Automation (public reply, like, hide) at all, even though it only needs the comment scopes.

Proposal: an opt-in env var TIKTOK_COMMENTS_ONLY=true. When set:

  • the messaging scopes are not requested or required; comment.list and comment.list.manage are required instead
  • only the COMMENT webhook is subscribed, and its failure fails the save

Default behaviour is unchanged. I'll open a PR with tests.

Activity

  1. sung17 commented on Oct 27, 2026

    @sung17
    Collaborator

    Thanks a lot @rancaHoratiu, both for the clear write-up and for opening #1564 with tests. You're right about the root cause: we treat the Business Messaging scopes as core, so EEA, Swiss and UK accounts can't connect at all, even though comment automation only needs the comment scopes.

    We'd like to solve it a bit differently, so we're going to open our own PR rather than merge #1564. Here's why:

    • Per credential instead of one switch for the whole server. TikTok app credentials are stored per platform and per reseller tenant. One TIKTOK_COMMENTS_ONLY flag would put every customer on the server into the same mode, so EU and non-EU accounts couldn't be served side by side. Instead, the TikTok settings dialog will get two switches, Messaging and Comments, saved with the credential. At least one has to stay on, and the default is unchanged.
    • Both connect paths. There are two places that check the granted scopes: exchangeCode in integration.ts and the older callbackHandler in handlers/callback.ts. feat(tiktok): opt-in comments-only connection for EEA accounts #1564 changes only the first, so a connect through the second path would still be refused. Both will use one shared helper.
    • Clear errors for features that need messaging. A comment-to-message private reply, or turning on Comment-to-Message on a comments-only connection, will stop early with a clear error instead of returning a confusing TikTok API error.
    • Docs in docs/comment-automation.md covering what works and what doesn't for EEA, Swiss and UK accounts.

    We'll link the new PR here and close #1564 in favour of it, credited to your proposal. Since you have an EEA account at hand, it would be a great help if you could test the PR once it's up. Thanks again!

  2. rancaHoratiu commented on Oct 27, 2026

    @rancaHoratiu
    Author

    Thanks @sung17! The per-credential approach makes a lot more sense, and good catch on callbackHandler.

    Happy to test the PR on our EEA account. One heads-up: we're only now applying for TikTok's Accounts API access (comment scopes only), so live testing may take a few weeks until the app is approved. I'll report back here once it is.

  3. sung17 commented on Oct 28, 2026

    @sung17
    Collaborator

    Follow-up PR is up: #1572. It adds the Messaging / Comments switches on the TikTok app credential described above.

  4. added a commit that references this issue on Oct 30, 2026
    17ab82b
  5. added a commit that references this issue on Nov 22, 2026
    d0bce04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions