# Thread Control (Cloud API)

Transfer thread control for a consumer conversation on a WhatsApp Business phone number.

Transfer thread control for a consumer conversation: release it back to Meta Business Agent as the automatic responder, or take it from the current owner.

## Base URL

| URL | Description |
|-----|-------------|
| https://api.facebook.com/business/whatsapp/phone_numbers/{phone_number_id}/thread_control |  |

## Authorization

This API requires:

any of the following Permission: whatsapp_business_messaging

## APIs

| Method | Endpoint |
|--------|----------|
| POST | [/](#post) |

<jumplink id="post"></jumplink>
## POST /

Release or take thread control for a consumer conversation.


### Header Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| X-API-Version | "1.0.0" |  |  |

### Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| phone_number_id | integer [min: 1] | ✓ | WhatsApp Business Account Phone Number ID |

### Request Body (Required)

**Content Type**: `application/json`

**Schema**: [ThreadControlRequest](#threadcontrolrequest)

### Responses

**200**

Thread control action result with messaging product and request identifiers.


**Content Type**: `application/json`

**Schema**: [ThreadControlResponse](#threadcontrolresponse)


# Components

## Schemas

<jumplink id="threadcontrolpassrequest"></jumplink>
### ThreadControlPassRequest

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| target_role | One of "ai_agent", "ctwa", "customer_service", "escalation", "marketing", "utility" | ✓ | Role receiving thread control. "ai_agent" selects Meta Business Agent. "escalation" selects the configured escalation partner, which is also what happens when control_pass is omitted. "ctwa", "customer_service", "marketing" and "utility" each select whoever is configured as the primary for that entry point. You name a role, not a business: the destination is resolved against the phone number's routing configuration, and the request is rejected if that entry point has no primary or more than one. |

<jumplink id="threadcontrolrequest"></jumplink>
### ThreadControlRequest

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| messaging_product | "whatsapp" | ✓ | Messaging service used for the request. Must be "whatsapp". |
| action | One of "pass", "release", "take" | ✓ | The thread control action to perform. "release" relinquishes thread control and hands the conversation back to Meta Business Agent as the automatic responder; you must currently hold thread control. "take" acquires thread control from the current owner and is restricted to the configured escalation partner. "pass" transfers thread control to the party named by control_pass.target_role, or to the configured escalation partner when control_pass is omitted; you must currently hold thread control. |
| to | string |  | Consumer identifier (phone number or WhatsApp ID) whose thread control is being transferred. Provide exactly one of `to` or `recipient`; a request carrying both is rejected. |
| recipient | string |  | Business-scoped user ID (BSUID) of the consumer whose thread control is being transferred. Use this for consumers who have a WhatsApp username but no phone number. Provide exactly one of `to` or `recipient`; a request carrying both is rejected. |
| metadata | string |  | Optional free-form string forwarded verbatim to the receiving app in the resulting messaging_handovers webhook. |
| control_pass | [ThreadControlPassRequest](#threadcontrolpassrequest) |  | Optional configuration for a pass action. When omitted, pass uses the configured escalation partner. |

<jumplink id="threadcontrolresponse"></jumplink>
### ThreadControlResponse

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| messaging_product | "whatsapp" | ✓ | Messaging service used for the response. Always "whatsapp". |
| request_id | string | ✓ | Opaque identifier for this request. Include it when you contact support. |

## Authentication

| Method | How to send it |
|--------|----------------|
| Authorization header | `Authorization: Bearer {access-token}` |
| Query parameter | `access_token={access-token}` |
| Query parameter | `oauth_token={access-token}` |

### Global Authentication Requirements

All endpoints require one of: `Authorization: Bearer {access-token}`, `access_token={access-token}` or `oauth_token={access-token}`