> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ycloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# whatsapp.phone_number.name_updated

> 在 WhatsApp 商业电话号码的名称获得批准或被拒绝时触发。

使用 `whatsapp.phone_number.name_updated` 在您的 Webhook 端点处理此事件。

## 触发条件

在 WhatsApp 商业电话号码的名称获得批准或被拒绝时触发。

在您[配置 Webhook 端点](https://docs.ycloud.com/zh/api-reference/guides/api-fundamentals/configure-webhooks.md)时订阅 `whatsapp.phone_number.name_updated`。

## 语法

YCloud 会向您配置的 Webhook URL 发送一个 HTTP `POST` 请求。以下结构展示了一种载荷变体。尖括号中的值为占位符；其类型列在 **参数** 下。可选字段和其他变体在下文中有详细说明。

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "id": "<ID>",
  "type": "whatsapp.phone_number.name_updated",
  "apiVersion": "<API_VERSION>",
  "createTime": "<CREATE_TIME>",
  "whatsappPhoneNumber": {
    "id": "<ID>",
    "phoneNumber": "<PHONE_NUMBER>",
    "wabaId": "<WABA_ID>",
    "verifiedName": "<VERIFIED_NAME>",
    "requestedVerifiedName": "<REQUESTED_VERIFIED_NAME>",
    "decision": "<DECISION>",
    "nameStatus": "<NAME_STATUS>",
    "newNameStatus": "<NEW_NAME_STATUS>"
  }
}
```

## 参数

在处理 JSON 请求体之前，请先验证 `YCloud-Signature` HTTP 请求头。请参阅[签名验证](https://docs.ycloud.com/zh/api-reference/guides/api-fundamentals/configure-webhooks.md)。

### 事件外层封装

| 参数 | 类型 | 必填 | 说明 |
| - | - | - | - |
| `id` | string | 是 | 事件的唯一 ID。最小长度：`6`。最大长度：`128`。 |
| `type` | string | 是 | 固定为 `whatsapp.phone_number.name_updated`。 |
| `apiVersion` | string | 是 | 用于渲染此事件的 API 版本。 |
| `createTime` | string (date-time) | 是 | 创建此事件的时间，格式为 [RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339)。例如：`2022-06-01T12:00:00.000Z`。 |

### 事件载荷

| 参数 | 类型 | 必填 | 说明 |
| - | - | - | - |
| `whatsappPhoneNumber` | object | 否 | 事件特有的 `whatsappPhoneNumber` 载荷。 |

四个通用外层封装字段为必填项。载荷字段取决于事件变体。在每个对象表中， **必填** 规则在其父对象存在时适用。可选字段可以省略；示例并不表示字段是必填的。

#### whatsappPhoneNumber

| 参数 | 类型 | 必填 | 说明 |
| - | - | - | - |
| `id` | string | 否 | 电话号码 ID。 |
| `phoneNumber` | string | 否 | 采用 [E.164](https://en.wikipedia.org/wiki/E.164) 格式的电话号码。 |
| `displayPhoneNumber` | string | 否 | 显示的电话号码。 |
| `wabaId` | string | 否 | WhatsApp 商业账户 ID。 |
| `verifiedName` | string | 否 | 认证名称。 |
| `nameStatus` | string | 否 | 当前显示名称请求的审核状态。另请参阅 [Get Display Name Status](https://developers.facebook.com/docs/whatsapp/business-management-api/manage-phone-numbers#get-display-name-status--beta-)。<ul><li>`APPROVED`：名称已获得批准。您现在可以下载证书。</li><li>`AVAILABLE_WITHOUT_REVIEW`：该电话号码的证书可用，显示名称无需审核即可直接使用。</li><li>`DECLINED`：名称未获得批准。您无法下载证书。</li><li>`EXPIRED`：您的证书已过期，无法再下载。</li><li>`PENDING_REVIEW`：您的名称请求正在审核中。您无法下载证书。</li><li>`NONE`：无可用证书。</li></ul> |
| `newNameStatus` | string | 否 | 新显示名称请求的审核状态。另请参阅 [Get Display Name Status](https://developers.facebook.com/docs/whatsapp/business-management-api/manage-phone-numbers#get-display-name-status--beta-)。可选值：`APPROVED`、`AVAILABLE_WITHOUT_REVIEW`、`DECLINED`、`EXPIRED`、`PENDING_REVIEW`、`NONE`。 |
| `decision` | string | 否 | 对此电话号码做出的审核决定。为 `APPROVED` 或 `REJECTED` 之一。 |
| `requestedVerifiedName` | string | 否 | 上次请求的认证名称。 |
| `rejectionReason` | string | 否 | 拒绝原因。 |

## 示例

以下 JSON 是发送至接收端的主体内容。ID、电话号码及其他账户值仅供参考。

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "id": "evt_example_whatsapp_phone_number_name_updated",
  "type": "whatsapp.phone_number.name_updated",
  "apiVersion": "v2",
  "createTime": "2026-05-26T12:00:00.000Z",
  "whatsappPhoneNumber": {
    "id": "1234567890123456",
    "phoneNumber": "+12025550124",
    "wabaId": "whatsapp-business-account-id",
    "verifiedName": "Example business",
    "requestedVerifiedName": "Example business",
    "decision": "APPROVED",
    "nameStatus": "APPROVED",
    "newNameStatus": "APPROVED"
  }
}
```

在验证签名并持久化接收事件后，请返回 `2xx` 响应。耗时工作请异步处理。

```http theme={"theme":{"light":"github-light","dark":"github-dark"}}
HTTP/1.1 200 OK
```

有关场景演练，请参阅[带注释的示例](https://docs.ycloud.com/zh/api-reference/guides/examples/webhook-examples/whatsapp-business-account-updated-webhook-examples)。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.