> ## 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.

# Template Synchronisation

## I. Interface instruction

### 1. Request example:

```hurl theme={"theme":{"light":"github-light","dark":"github-dark"}}
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 theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "wabaId": "string",
  "message": "string"
}
```

Parameter info:

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

Response example:

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "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 |


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