> For the complete documentation index, see [llms.txt](https://helpdocs.ycloud.com/partner-center/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://helpdocs.ycloud.com/partner-center/english-en-2/ji-shu-kai-fa-huo-ban/template-synchronisation.md).

# Template Synchronisation

The Template Synchronisation API enables you to trigger the synchronisation of templates from your WhatsApp Business Account (WABA) to the YCloud platform. This API is designed for template migration.

## I. Interface instruction

### 1. Request example:

```hurl
curl -X POST 'https://api.ycloud.com/v2/whatsapp/templates/{wabaId}/sync' \
-H 'X-API-Key: {{YOUR-API-KEY}}'
```

### 2. Request payloads:

Path parameters

| Parameter name | Type   | Is required | Note                         |
| -------------- | ------ | ----------- | ---------------------------- |
| wabaId         | String | Yes         | WhatsApp Business Account ID |

Head parameters

| Parameter name | Type   | Is required | Note                       |
| -------------- | ------ | ----------- | -------------------------- |
| X-API-KEY      | String | 是           | Your YCloud accout API key |

### 3. Response details

Successfully responsed (200 OK)

```json
{
  "wabaId": "string",
  "message": "string"
}
```

Parameter info:

| Name    | Type   | Note                         |
| ------- | ------ | ---------------------------- |
| wabaId  | String | WhatsApp Business Account ID |
| message | String | 同步状态说明信息                     |

Response example:

```json
{
  "wabaId": "123456789012345",
  "message": "Template sync has been triggered. It may take a few minutes to complete. If templates were recently migrated to this WABA on Meta, the system will automatically retry for up to 30 minutes."
}
```

## II: Interface Specifications

### 1. Authorisation Verification

* This interface is for technical development partners only.
* It is exclusively for WABA accounts already bound to YCloud.

### 2. Frequency Restriction

This interface features dual-layer frequency restrictions, namely WABA-level restrictions and tenant-level restrictions. If you are worry about this restriction, please contact YCloud team.

WABA Restriction

* Time window: 10 minute
* Restriction policy: Each WABA may only initiate one synchronisation request within the time window.
* Error message: "Template sync for this WABA was recently triggered. Please try again later."

Tenant Restriction

* Time window: 1 hour
* Maximum requests: 20 times
* Restriciton policy: Each tenant may initiate up to 20 synchronisation requests within the time window.
* Error message: "Too many template sync requests from the tenant. Please try again later."

### 3. Automatic Retry

When the Meta platform returns an empty template list, the system will automatically retry:

* Maximum retry: 3 times
* Retry interval: 5 minutes → 10 minutes → 15 minutes
* Total retry duration: 30 minutes

### 4. Error Code

| 403 | FORBIDDEN           | This API is available only to TP partners. |
| --- | ------------------- | ------------------------------------------ |
| 403 | FORBIDDEN           | WABA is not bound to a YCloud account      |
| 429 | TOO\_MANY\_REQUESTS | Exceeding the WABA-level frequency limit   |
| 429 | TOO\_MANY\_REQUESTS | Exceeding the tenant-level frequency limit |
