Get Thread Owner

The handover protocol's Thread Owner API returns the app ID of the app the currently has thread control for a Page. This is useful for bots that have complex implementations of the handover protocol, where an app's actions are dependent on whether it currently has thread control.

The Thread Owner API may be called by apps with the Primary Receiver and the Secondary receiver app roles.


Permission by App Role

If the app calling the Thread Owner API has the Primary Receiver role, the API will always return the app ID of the current thread owner.

If the calling app has the Secondary Receiver role, the API will only return the app ID of the current thread owner if the Primary Receiver app is the owner. If a different Secondary Receiver app has thread control, the following error will be returned:

  "error": {
    "message": "(#100) Denying visibility of any secondary receiver to another secondary receiver other than itself.",

Getting the Thread Owner

To get the app ID of the current thread owner, send a GET request to the /thread_owner endpoint.

The thread the API should return the owner of is specified by providing the PSID of the user in the thread in the recipient parameter of the request:

curl -X GET "<PSID>&access_token=<PAGE_ACCESS_TOKEN>"

For complete API details and request properties, see the Thread Owner API Reference.

On success, the Messenger Platform will return the thread_owner object with the app_id of the app that currently has thread control in the body of the response:

  "data": [ 
        "app_id": <APP_ID>