> For the complete documentation index, see [llms.txt](https://docs.360dialog.com/partner/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.360dialog.com/partner/partner-api/api-reference/templates-management.md).

# Templates Management

Endpoints for managing WhatsApp message templates

## Get templates

> Use this endpoint to get templates. Filtering is available.\
> \*\*Rate limits:\*\* This endpoint is subject to rate limits. A maximum of \*\*400 total requests per minute\*\* is allowed. Requests exceeding these limits will receive a \`429 Too Many Requests\` response.

```json
{"openapi":"3.1.0","info":{"title":"Partners V2 API","version":"2.0.0"},"tags":[{"name":"Templates Management","description":"Endpoints for managing WhatsApp message templates"}],"servers":[{"description":"Production Server","url":"https://hub.360dialog.io"}],"security":[{"PartnerApiKeyV2":[]},{"Bearer":[]}],"components":{"securitySchemes":{"PartnerApiKeyV2":{"type":"apiKey","name":"X-API-Key","in":"header","description":"API Key for V2 authentication. Send your Partner API key in the X-API-Key header. Preferred authentication method."},"Bearer":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer token authentication. Token obtained via /api/v2/token endpoint."}},"schemas":{"TemplateListOut":{"type":"object","properties":{"filters":{"type":"object","description":"Allowed keys: ['id', 'partner_id', 'business_templates.name', 'status', 'category', 'language']","additionalProperties":{}},"sort":{"type":"array","items":{"type":"string","enum":["id","partner_id","business_templates.name","status","category","language"]}},"limit":{"type":"integer","minimum":0,"description":"Maximum number of returned objects."},"offset":{"type":"integer","minimum":0,"description":"Number of objects to skip."},"count":{"type":"integer","description":"Number of returned objects."},"total":{"type":"integer","description":"Total number of objects on 360 side."},"waba_templates":{"type":"array","items":{"$ref":"#/components/schemas/TemplateOut"}}},"additionalProperties":false},"TemplateOut":{"type":"object","properties":{"modified_by":{"type":"object","description":"Information about the user who last modified the entity","additionalProperties":{}},"created_by":{"type":"object","description":"Information about the user who created the entity","additionalProperties":{}},"modified_at":{"type":"string","description":"Time when the entity was last modified"},"created_at":{"type":"string","description":"Time when the entity was created"},"category":{"type":"string","enum":["AUTHENTICATION","MARKETING","UTILITY"],"description":"Template category.","nullable":true},"components":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/TemplateComponent"}},"language":{"type":"string","enum":["af","sq","ar","ar_EG","ar_AE","ar_LB","ar_MA","ar_QA","az","be_BY","bn","bn_IN","bg","ca","zh_CN","zh_HK","zh_TW","hr","cs","da","nl","nl_BE","en","en_GB","en_US","en_AE","en_AU","en_CA","en_GH","en_IE","en_IN","en_JM","en_MY","en_NZ","en_QA","en_SG","en_UG","en_ZA","et","fil","fi","fr","fr_BE","fr_CA","fr_CH","fr_CI","fr_MA","ka","de","de_AT","de_CH","el","gu","ha","he","hi","hu","id","ga","it","ja","kn","kk","rw_RW","ko","ky_KG","lo","lv","lt","mk","ms","ml","mr","nb","fa","pl","pt_BR","pt_PT","pa","ps_AF","prs_AF","ro","ru","sr","si_LK","sk","sl","es","es_AR","es_CO","es_ES","es_MX","es_CL","es_CR","es_DO","es_EC","es_HN","es_PA","es_PE","es_UY","sw","sv","ta","te","th","tr","uk","ur","uz","vi","zu"],"description":"Template language short code."},"name":{"type":"string","minLength":1,"maxLength":512,"description":"Template name."},"external_id":{"type":"string","description":"Template id on Meta side."},"id":{"type":"string","description":"Template id on 360 side."},"namespace":{"type":"string","description":"Template namespace on Meta side"},"partner_id":{"type":"string","description":"Template's owner partner id."},"quality_score":{"description":"Template quality score.","allOf":[{"$ref":"#/components/schemas/QualityScore"}]},"rejected_reason":{"type":"string","description":"Reason of rejecting a template by Meta."},"status":{"type":"string","description":"Template status (synchronized with status on Meta side)."},"updated_external":{"type":"boolean","description":"[Deprecated] Is template synchronized with Meta (always `true`).","deprecated":true},"waba_account_id":{"type":"string","description":"WABA account id on 360 side."}},"additionalProperties":false},"TemplateComponent":{"type":"object","properties":{"text":{"type":"string","description":"Text. Can contain variables."},"type":{"type":"string","enum":["BODY","BUTTONS","CAROUSEL","FOOTER","HEADER","LIMITED_TIME_OFFER","CALL_PERMISSION_REQUEST"],"description":"Component type."},"format":{"type":"string","enum":["IMAGE","DOCUMENT","TEXT","LOCATION","VIDEO","PRODUCT","GIF"],"description":"Header format."},"buttons":{"type":"array","items":{"type":"object","description":"Button structure can be very different, depending on button type. Please see Meta documentation.","additionalProperties":{}}},"cards":{"type":"array","description":"List of cards in carousel.","items":{"$ref":"#/components/schemas/TemplateCardComponents"}},"limited_time_offer":{"description":"Limited time offer details.","allOf":[{"$ref":"#/components/schemas/LimitedTimeOffer"}]},"add_security_recommendation":{"type":"boolean","description":"Is security message is needed for Authentication template"},"code_expiration_minutes":{"type":"integer","minimum":1,"maximum":90,"description":"One-time code expiration minutes for Authentication template"}},"additionalProperties":false},"TemplateCardComponents":{"type":"object","properties":{"components":{"type":"array","description":"Card components.","items":{"$ref":"#/components/schemas/TemplateComponent"}}},"additionalProperties":false},"LimitedTimeOffer":{"type":"object","properties":{"text":{"type":"string","maxLength":16,"description":"Offer text."},"has_expiration":{"type":"boolean","description":"True to have offer expiration details in delivered message."}},"additionalProperties":false},"QualityScore":{"type":"object","properties":{"score":{"type":"string","enum":["RED","YELLOW","GREEN","UNKNOWN"],"description":"Template quality score on Meta side.","nullable":true},"reasons":{"type":"array","description":"Reasons of the last quality update.","items":{"type":"string"}}},"additionalProperties":false},"DefaultValidationError":{"type":"object","properties":{"meta":{"allOf":[{"$ref":"#/components/schemas/MetaSchemaErrorWithDetails"}]}},"required":["meta"],"additionalProperties":false},"MetaSchemaErrorWithDetails":{"type":"object","properties":{"developer_message":{"type":"string"},"http_code":{"type":"integer"},"success":{"type":"boolean"},"360dialog_trace_id":{"type":"string","description":"Trace ID for debugging purposes"},"details":{"type":"object","description":"Additional error data","additionalProperties":{}}},"required":["developer_message","http_code","success"],"additionalProperties":false},"DefaultHttpError":{"type":"object","properties":{"meta":{"allOf":[{"$ref":"#/components/schemas/_MetaSchemaError"}]}},"required":["meta"],"additionalProperties":false},"_MetaSchemaError":{"type":"object","properties":{"developer_message":{"type":"string"},"http_code":{"type":"integer"},"success":{"type":"boolean"},"360dialog_trace_id":{"type":"string","description":"Trace ID for debugging purposes"}},"required":["developer_message","http_code","success"],"additionalProperties":false}}},"paths":{"/api/v2/partners/{partner_id}/waba_accounts/{waba_account_id}/waba_templates":{"get":{"parameters":[{"in":"query","name":"filters","description":"Allowed keys: ['id', 'partner_id', 'business_templates.name', 'status', 'category', 'language']","schema":{"type":"object","additionalProperties":{}},"required":false},{"in":"query","name":"sort","schema":{"type":"array","items":{"type":"string","enum":["id","partner_id","business_templates.name","status","category","language"]}},"required":false,"explode":true,"style":"form","description":"The sort query parameter"},{"in":"query","name":"limit","description":"Maximum number of returned objects.","schema":{"type":"integer","minimum":0},"required":false},{"in":"query","name":"offset","description":"Number of objects to skip.","schema":{"type":"integer","minimum":0},"required":false},{"in":"path","name":"partner_id","description":"The ID of the partner.","schema":{"type":"string"},"required":true},{"in":"path","name":"waba_account_id","description":"Internal 360dialog ID of the waba account. This ID always have postfix WA.","schema":{"type":"string"},"required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateListOut"}}},"description":"Successful response","headers":{"RateLimit-Limit":{"schema":{"type":"integer"},"description":"The maximum quota units allowed in the current window (from the most critical policy).","required":true},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"The number of remaining quota units (from the most critical policy).","required":true},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"The time, in seconds, until the critical rate limit resets.","required":true},"RateLimit-Policy":{"schema":{"type":"string"},"description":"A Structured Field string listing all concurrent policies enforced by the server.","required":true}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultValidationError"}}},"description":"Wrong payload"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultHttpError"}}},"description":"Not found"}},"tags":["Templates Management"],"summary":"Get templates","description":"Use this endpoint to get templates. Filtering is available.\n**Rate limits:** This endpoint is subject to rate limits. A maximum of **400 total requests per minute** is allowed. Requests exceeding these limits will receive a `429 Too Many Requests` response.","operationId":"get_Partners_v2_api_get_templates_list"}}}}
```

## Create a template

> Use this endpoint to create a template.\
> \*\*Rate limits:\*\* This endpoint is subject to rate limits. A maximum of \*\*60 total requests per minute per waba id\*\* is allowed. Requests exceeding these limits will receive a \`429 Too Many Requests\` response.

```json
{"openapi":"3.1.0","info":{"title":"Partners V2 API","version":"2.0.0"},"tags":[{"name":"Templates Management","description":"Endpoints for managing WhatsApp message templates"}],"servers":[{"description":"Production Server","url":"https://hub.360dialog.io"}],"security":[{"PartnerApiKeyV2":[]},{"Bearer":[]}],"components":{"securitySchemes":{"PartnerApiKeyV2":{"type":"apiKey","name":"X-API-Key","in":"header","description":"API Key for V2 authentication. Send your Partner API key in the X-API-Key header. Preferred authentication method."},"Bearer":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer token authentication. Token obtained via /api/v2/token endpoint."}},"schemas":{"TemplateOut":{"type":"object","properties":{"modified_by":{"type":"object","description":"Information about the user who last modified the entity","additionalProperties":{}},"created_by":{"type":"object","description":"Information about the user who created the entity","additionalProperties":{}},"modified_at":{"type":"string","description":"Time when the entity was last modified"},"created_at":{"type":"string","description":"Time when the entity was created"},"category":{"type":"string","enum":["AUTHENTICATION","MARKETING","UTILITY"],"description":"Template category.","nullable":true},"components":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/TemplateComponent"}},"language":{"type":"string","enum":["af","sq","ar","ar_EG","ar_AE","ar_LB","ar_MA","ar_QA","az","be_BY","bn","bn_IN","bg","ca","zh_CN","zh_HK","zh_TW","hr","cs","da","nl","nl_BE","en","en_GB","en_US","en_AE","en_AU","en_CA","en_GH","en_IE","en_IN","en_JM","en_MY","en_NZ","en_QA","en_SG","en_UG","en_ZA","et","fil","fi","fr","fr_BE","fr_CA","fr_CH","fr_CI","fr_MA","ka","de","de_AT","de_CH","el","gu","ha","he","hi","hu","id","ga","it","ja","kn","kk","rw_RW","ko","ky_KG","lo","lv","lt","mk","ms","ml","mr","nb","fa","pl","pt_BR","pt_PT","pa","ps_AF","prs_AF","ro","ru","sr","si_LK","sk","sl","es","es_AR","es_CO","es_ES","es_MX","es_CL","es_CR","es_DO","es_EC","es_HN","es_PA","es_PE","es_UY","sw","sv","ta","te","th","tr","uk","ur","uz","vi","zu"],"description":"Template language short code."},"name":{"type":"string","minLength":1,"maxLength":512,"description":"Template name."},"external_id":{"type":"string","description":"Template id on Meta side."},"id":{"type":"string","description":"Template id on 360 side."},"namespace":{"type":"string","description":"Template namespace on Meta side"},"partner_id":{"type":"string","description":"Template's owner partner id."},"quality_score":{"description":"Template quality score.","allOf":[{"$ref":"#/components/schemas/QualityScore"}]},"rejected_reason":{"type":"string","description":"Reason of rejecting a template by Meta."},"status":{"type":"string","description":"Template status (synchronized with status on Meta side)."},"updated_external":{"type":"boolean","description":"[Deprecated] Is template synchronized with Meta (always `true`).","deprecated":true},"waba_account_id":{"type":"string","description":"WABA account id on 360 side."}},"additionalProperties":false},"TemplateComponent":{"type":"object","properties":{"text":{"type":"string","description":"Text. Can contain variables."},"type":{"type":"string","enum":["BODY","BUTTONS","CAROUSEL","FOOTER","HEADER","LIMITED_TIME_OFFER","CALL_PERMISSION_REQUEST"],"description":"Component type."},"format":{"type":"string","enum":["IMAGE","DOCUMENT","TEXT","LOCATION","VIDEO","PRODUCT","GIF"],"description":"Header format."},"buttons":{"type":"array","items":{"type":"object","description":"Button structure can be very different, depending on button type. Please see Meta documentation.","additionalProperties":{}}},"cards":{"type":"array","description":"List of cards in carousel.","items":{"$ref":"#/components/schemas/TemplateCardComponents"}},"limited_time_offer":{"description":"Limited time offer details.","allOf":[{"$ref":"#/components/schemas/LimitedTimeOffer"}]},"add_security_recommendation":{"type":"boolean","description":"Is security message is needed for Authentication template"},"code_expiration_minutes":{"type":"integer","minimum":1,"maximum":90,"description":"One-time code expiration minutes for Authentication template"}},"additionalProperties":false},"TemplateCardComponents":{"type":"object","properties":{"components":{"type":"array","description":"Card components.","items":{"$ref":"#/components/schemas/TemplateComponent"}}},"additionalProperties":false},"LimitedTimeOffer":{"type":"object","properties":{"text":{"type":"string","maxLength":16,"description":"Offer text."},"has_expiration":{"type":"boolean","description":"True to have offer expiration details in delivered message."}},"additionalProperties":false},"QualityScore":{"type":"object","properties":{"score":{"type":"string","enum":["RED","YELLOW","GREEN","UNKNOWN"],"description":"Template quality score on Meta side.","nullable":true},"reasons":{"type":"array","description":"Reasons of the last quality update.","items":{"type":"string"}}},"additionalProperties":false},"DefaultHttpError":{"type":"object","properties":{"meta":{"allOf":[{"$ref":"#/components/schemas/_MetaSchemaError"}]}},"required":["meta"],"additionalProperties":false},"_MetaSchemaError":{"type":"object","properties":{"developer_message":{"type":"string"},"http_code":{"type":"integer"},"success":{"type":"boolean"},"360dialog_trace_id":{"type":"string","description":"Trace ID for debugging purposes"}},"required":["developer_message","http_code","success"],"additionalProperties":false},"TemplateCreateIn":{"type":"object","properties":{"category":{"type":"string","enum":["AUTHENTICATION","MARKETING","UTILITY"],"description":"Template category.","nullable":true},"components":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/TemplateComponent"}},"language":{"type":"string","enum":["af","sq","ar","ar_EG","ar_AE","ar_LB","ar_MA","ar_QA","az","be_BY","bn","bn_IN","bg","ca","zh_CN","zh_HK","zh_TW","hr","cs","da","nl","nl_BE","en","en_GB","en_US","en_AE","en_AU","en_CA","en_GH","en_IE","en_IN","en_JM","en_MY","en_NZ","en_QA","en_SG","en_UG","en_ZA","et","fil","fi","fr","fr_BE","fr_CA","fr_CH","fr_CI","fr_MA","ka","de","de_AT","de_CH","el","gu","ha","he","hi","hu","id","ga","it","ja","kn","kk","rw_RW","ko","ky_KG","lo","lv","lt","mk","ms","ml","mr","nb","fa","pl","pt_BR","pt_PT","pa","ps_AF","prs_AF","ro","ru","sr","si_LK","sk","sl","es","es_AR","es_CO","es_ES","es_MX","es_CL","es_CR","es_DO","es_EC","es_HN","es_PA","es_PE","es_UY","sw","sv","ta","te","th","tr","uk","ur","uz","vi","zu"],"description":"Template language short code."},"name":{"type":"string","minLength":1,"maxLength":512,"description":"Template name."},"message_send_ttl_seconds":{"type":"integer","description":"To override the default time-to-live when creating an authentication, utility and marketing templates"},"allow_category_change":{"type":"boolean","description":"Allow Meta to auto-update template category","deprecated":true},"cta_url_link_tracking_opted_out":{"type":"boolean","description":"Opt in or opt out of button click analytics for the template"}},"required":["category","components","language","name"],"additionalProperties":false}}},"paths":{"/api/v2/partners/{partner_id}/waba_accounts/{waba_account_id}/waba_templates":{"post":{"parameters":[{"in":"path","name":"partner_id","description":"The ID of the partner.","schema":{"type":"string"},"required":true},{"in":"path","name":"waba_account_id","description":"Internal 360dialog ID of the waba account. This ID always have postfix WA.","schema":{"type":"string"},"required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateOut"}}},"description":"Successful response","headers":{"RateLimit-Limit":{"schema":{"type":"integer"},"description":"The maximum quota units allowed in the current window (from the most critical policy).","required":true},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"The number of remaining quota units (from the most critical policy).","required":true},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"The time, in seconds, until the critical rate limit resets.","required":true},"RateLimit-Policy":{"schema":{"type":"string"},"description":"A Structured Field string listing all concurrent policies enforced by the server.","required":true}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultHttpError"}}},"description":"Wrong payload"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultHttpError"}}},"description":"Not found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultHttpError"}}},"description":"Client error"}},"tags":["Templates Management"],"summary":"Create a template","description":"Use this endpoint to create a template.\n**Rate limits:** This endpoint is subject to rate limits. A maximum of **60 total requests per minute per waba id** is allowed. Requests exceeding these limits will receive a `429 Too Many Requests` response.","operationId":"post_Partners_v2_api_create_template","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateCreateIn"}}}}}}}}
```

## Migrate templates

> Use this endpoint to move templates from one waba account to another (in the same business account).\
> Useful for migrating between WABAs.

```json
{"openapi":"3.1.0","info":{"title":"Partners V2 API","version":"2.0.0"},"tags":[{"name":"Templates Management","description":"Endpoints for managing WhatsApp message templates"}],"servers":[{"description":"Production Server","url":"https://hub.360dialog.io"}],"security":[{"PartnerApiKeyV2":[]},{"Bearer":[]}],"components":{"securitySchemes":{"PartnerApiKeyV2":{"type":"apiKey","name":"X-API-Key","in":"header","description":"API Key for V2 authentication. Send your Partner API key in the X-API-Key header. Preferred authentication method."},"Bearer":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer token authentication. Token obtained via /api/v2/token endpoint."}},"schemas":{"MigrateWabaTemplatesOut":{"type":"object","properties":{"migrated_templates":{"type":"array","description":"List of template ids that successfully migrated.","items":{"type":"string"}},"failed_templates":{"type":"object","description":"Templates that failed to migrate in key(id): value(error) format.","additionalProperties":{"type":"string"}}},"additionalProperties":false},"DefaultHttpError":{"type":"object","properties":{"meta":{"allOf":[{"$ref":"#/components/schemas/_MetaSchemaError"}]}},"required":["meta"],"additionalProperties":false},"_MetaSchemaError":{"type":"object","properties":{"developer_message":{"type":"string"},"http_code":{"type":"integer"},"success":{"type":"boolean"},"360dialog_trace_id":{"type":"string","description":"Trace ID for debugging purposes"}},"required":["developer_message","http_code","success"],"additionalProperties":false},"MigrateWabaTemplatesIn":{"type":"object","properties":{"source_waba_account_id":{"type":"string","description":"Source WhatsApp Business Account ID to copy templates from"},"page_number":{"type":"integer","default":0,"description":"This field specifies the index of which page of templates need to be migrated. Page 0 will migrate the first 2500 templates, and page 1 will migrate the next 2500 and so on."}},"required":["source_waba_account_id"],"additionalProperties":false}}},"paths":{"/api/v2/partners/{partner_id}/waba_accounts/{waba_account_id}/migrate_templates":{"post":{"parameters":[{"in":"path","name":"partner_id","description":"The ID of the partner.","schema":{"type":"string"},"required":true},{"in":"path","name":"waba_account_id","description":"Internal 360dialog ID of the waba account. This ID always have postfix WA.","schema":{"type":"string"},"required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MigrateWabaTemplatesOut"}}},"description":"Successful response"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultHttpError"}}},"description":"Wrong payload"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultHttpError"}}},"description":"Not found"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultHttpError"}}},"description":"Server error"}},"tags":["Templates Management"],"summary":"Migrate templates","description":"Use this endpoint to move templates from one waba account to another (in the same business account).\nUseful for migrating between WABAs.","operationId":"post_Partners_v2_api_migrate_waba_templates","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MigrateWabaTemplatesIn"}}}}}}}}
```

## Get template previews

> Use this endpoint to generate previews of template texts in various languages.\
> Currently only authentication templates are supported (use AUTHENTICATION as category parameter value).\
> You can optionally include the security recommendation string and code expiration string.

```json
{"openapi":"3.1.0","info":{"title":"Partners V2 API","version":"2.0.0"},"tags":[{"name":"Templates Management","description":"Endpoints for managing WhatsApp message templates"}],"servers":[{"description":"Production Server","url":"https://hub.360dialog.io"}],"security":[{"PartnerApiKeyV2":[]},{"Bearer":[]}],"components":{"securitySchemes":{"PartnerApiKeyV2":{"type":"apiKey","name":"X-API-Key","in":"header","description":"API Key for V2 authentication. Send your Partner API key in the X-API-Key header. Preferred authentication method."},"Bearer":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer token authentication. Token obtained via /api/v2/token endpoint."}},"schemas":{"TemplatePreviewOut":{"type":"object","properties":{"body":{"type":"string","description":"The body of the template."},"buttons":{"type":"array","description":"The buttons of the template.","items":{"type":"object","additionalProperties":{}}},"footer":{"type":"string","description":"The footer of the template."},"language":{"type":"string","description":"The language of the template."}},"required":["body","buttons","footer","language"],"additionalProperties":false},"DefaultHttpError":{"type":"object","properties":{"meta":{"allOf":[{"$ref":"#/components/schemas/_MetaSchemaError"}]}},"required":["meta"],"additionalProperties":false},"_MetaSchemaError":{"type":"object","properties":{"developer_message":{"type":"string"},"http_code":{"type":"integer"},"success":{"type":"boolean"},"360dialog_trace_id":{"type":"string","description":"Trace ID for debugging purposes"}},"required":["developer_message","http_code","success"],"additionalProperties":false}}},"paths":{"/api/v2/partners/{partner_id}/waba_accounts/{waba_account_id}/message_template_previews":{"get":{"parameters":[{"in":"query","name":"category","description":"The category of the template.","schema":{"type":"string"},"required":false},{"in":"query","name":"languages","description":"Comma-separated template languages to preview (e.g. `en_US,es_US`)","schema":{"type":"string"},"required":false},{"in":"query","name":"add_security_recommendation","description":"The security recommendation.","schema":{"type":"boolean"},"required":false},{"in":"query","name":"code_expiration_minutes","description":"The code expiration minutes.","schema":{"type":"integer"},"required":false},{"in":"query","name":"button_types","description":"The button types.","schema":{"type":"string"},"required":false},{"in":"path","name":"partner_id","description":"The ID of the partner.","schema":{"type":"string"},"required":true},{"in":"path","name":"waba_account_id","description":"Internal 360dialog ID of the waba account. This ID always have postfix WA.","schema":{"type":"string"},"required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TemplatePreviewOut"}}}},"description":"Successful response"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultHttpError"}}},"description":"Wrong payload"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultHttpError"}}},"description":"Not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultHttpError"}}},"description":"Internal server error"}},"tags":["Templates Management"],"summary":"Get template previews","description":"Use this endpoint to generate previews of template texts in various languages.\nCurrently only authentication templates are supported (use AUTHENTICATION as category parameter value).\nYou can optionally include the security recommendation string and code expiration string.","operationId":"get_Partners_v2_api_template_previews_partner_api"}}}}
```

## Update a template

> Use this endpoint to update a template.\
> \*\*Rate limits:\*\* This endpoint is subject to rate limits. A maximum of \*\*60 total requests per minute per waba id\*\* is allowed. Requests exceeding these limits will receive a \`429 Too Many Requests\` response.

```json
{"openapi":"3.1.0","info":{"title":"Partners V2 API","version":"2.0.0"},"tags":[{"name":"Templates Management","description":"Endpoints for managing WhatsApp message templates"}],"servers":[{"description":"Production Server","url":"https://hub.360dialog.io"}],"security":[{"PartnerApiKeyV2":[]},{"Bearer":[]}],"components":{"securitySchemes":{"PartnerApiKeyV2":{"type":"apiKey","name":"X-API-Key","in":"header","description":"API Key for V2 authentication. Send your Partner API key in the X-API-Key header. Preferred authentication method."},"Bearer":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer token authentication. Token obtained via /api/v2/token endpoint."}},"schemas":{"TemplateOut":{"type":"object","properties":{"modified_by":{"type":"object","description":"Information about the user who last modified the entity","additionalProperties":{}},"created_by":{"type":"object","description":"Information about the user who created the entity","additionalProperties":{}},"modified_at":{"type":"string","description":"Time when the entity was last modified"},"created_at":{"type":"string","description":"Time when the entity was created"},"category":{"type":"string","enum":["AUTHENTICATION","MARKETING","UTILITY"],"description":"Template category.","nullable":true},"components":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/TemplateComponent"}},"language":{"type":"string","enum":["af","sq","ar","ar_EG","ar_AE","ar_LB","ar_MA","ar_QA","az","be_BY","bn","bn_IN","bg","ca","zh_CN","zh_HK","zh_TW","hr","cs","da","nl","nl_BE","en","en_GB","en_US","en_AE","en_AU","en_CA","en_GH","en_IE","en_IN","en_JM","en_MY","en_NZ","en_QA","en_SG","en_UG","en_ZA","et","fil","fi","fr","fr_BE","fr_CA","fr_CH","fr_CI","fr_MA","ka","de","de_AT","de_CH","el","gu","ha","he","hi","hu","id","ga","it","ja","kn","kk","rw_RW","ko","ky_KG","lo","lv","lt","mk","ms","ml","mr","nb","fa","pl","pt_BR","pt_PT","pa","ps_AF","prs_AF","ro","ru","sr","si_LK","sk","sl","es","es_AR","es_CO","es_ES","es_MX","es_CL","es_CR","es_DO","es_EC","es_HN","es_PA","es_PE","es_UY","sw","sv","ta","te","th","tr","uk","ur","uz","vi","zu"],"description":"Template language short code."},"name":{"type":"string","minLength":1,"maxLength":512,"description":"Template name."},"external_id":{"type":"string","description":"Template id on Meta side."},"id":{"type":"string","description":"Template id on 360 side."},"namespace":{"type":"string","description":"Template namespace on Meta side"},"partner_id":{"type":"string","description":"Template's owner partner id."},"quality_score":{"description":"Template quality score.","allOf":[{"$ref":"#/components/schemas/QualityScore"}]},"rejected_reason":{"type":"string","description":"Reason of rejecting a template by Meta."},"status":{"type":"string","description":"Template status (synchronized with status on Meta side)."},"updated_external":{"type":"boolean","description":"[Deprecated] Is template synchronized with Meta (always `true`).","deprecated":true},"waba_account_id":{"type":"string","description":"WABA account id on 360 side."}},"additionalProperties":false},"TemplateComponent":{"type":"object","properties":{"text":{"type":"string","description":"Text. Can contain variables."},"type":{"type":"string","enum":["BODY","BUTTONS","CAROUSEL","FOOTER","HEADER","LIMITED_TIME_OFFER","CALL_PERMISSION_REQUEST"],"description":"Component type."},"format":{"type":"string","enum":["IMAGE","DOCUMENT","TEXT","LOCATION","VIDEO","PRODUCT","GIF"],"description":"Header format."},"buttons":{"type":"array","items":{"type":"object","description":"Button structure can be very different, depending on button type. Please see Meta documentation.","additionalProperties":{}}},"cards":{"type":"array","description":"List of cards in carousel.","items":{"$ref":"#/components/schemas/TemplateCardComponents"}},"limited_time_offer":{"description":"Limited time offer details.","allOf":[{"$ref":"#/components/schemas/LimitedTimeOffer"}]},"add_security_recommendation":{"type":"boolean","description":"Is security message is needed for Authentication template"},"code_expiration_minutes":{"type":"integer","minimum":1,"maximum":90,"description":"One-time code expiration minutes for Authentication template"}},"additionalProperties":false},"TemplateCardComponents":{"type":"object","properties":{"components":{"type":"array","description":"Card components.","items":{"$ref":"#/components/schemas/TemplateComponent"}}},"additionalProperties":false},"LimitedTimeOffer":{"type":"object","properties":{"text":{"type":"string","maxLength":16,"description":"Offer text."},"has_expiration":{"type":"boolean","description":"True to have offer expiration details in delivered message."}},"additionalProperties":false},"QualityScore":{"type":"object","properties":{"score":{"type":"string","enum":["RED","YELLOW","GREEN","UNKNOWN"],"description":"Template quality score on Meta side.","nullable":true},"reasons":{"type":"array","description":"Reasons of the last quality update.","items":{"type":"string"}}},"additionalProperties":false},"DefaultHttpError":{"type":"object","properties":{"meta":{"allOf":[{"$ref":"#/components/schemas/_MetaSchemaError"}]}},"required":["meta"],"additionalProperties":false},"_MetaSchemaError":{"type":"object","properties":{"developer_message":{"type":"string"},"http_code":{"type":"integer"},"success":{"type":"boolean"},"360dialog_trace_id":{"type":"string","description":"Trace ID for debugging purposes"}},"required":["developer_message","http_code","success"],"additionalProperties":false},"TemplateUpdateIn":{"type":"object","properties":{"category":{"type":"string","enum":["AUTHENTICATION","MARKETING","UTILITY"],"description":"Template category.","nullable":true},"components":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/TemplateComponent"}},"language":{"type":"string","enum":["af","sq","ar","ar_EG","ar_AE","ar_LB","ar_MA","ar_QA","az","be_BY","bn","bn_IN","bg","ca","zh_CN","zh_HK","zh_TW","hr","cs","da","nl","nl_BE","en","en_GB","en_US","en_AE","en_AU","en_CA","en_GH","en_IE","en_IN","en_JM","en_MY","en_NZ","en_QA","en_SG","en_UG","en_ZA","et","fil","fi","fr","fr_BE","fr_CA","fr_CH","fr_CI","fr_MA","ka","de","de_AT","de_CH","el","gu","ha","he","hi","hu","id","ga","it","ja","kn","kk","rw_RW","ko","ky_KG","lo","lv","lt","mk","ms","ml","mr","nb","fa","pl","pt_BR","pt_PT","pa","ps_AF","prs_AF","ro","ru","sr","si_LK","sk","sl","es","es_AR","es_CO","es_ES","es_MX","es_CL","es_CR","es_DO","es_EC","es_HN","es_PA","es_PE","es_UY","sw","sv","ta","te","th","tr","uk","ur","uz","vi","zu"],"description":"Template language short code."},"name":{"type":"string","minLength":1,"maxLength":512,"description":"Template name."},"message_send_ttl_seconds":{"type":"integer","description":"To override the default time-to-live when creating an authentication, utility and marketing templates"},"allow_category_change":{"type":"boolean","description":"Allow Meta to auto-update template category","deprecated":true},"cta_url_link_tracking_opted_out":{"type":"boolean","description":"Opt in or opt out of button click analytics for the template"}},"additionalProperties":false}}},"paths":{"/api/v2/partners/{partner_id}/waba_accounts/{waba_account_id}/waba_templates/{template_id}":{"post":{"parameters":[{"in":"path","name":"partner_id","description":"The ID of the partner.","schema":{"type":"string"},"required":true},{"in":"path","name":"waba_account_id","description":"Internal 360dialog ID of the waba account. This ID always have postfix WA.","schema":{"type":"string"},"required":true},{"in":"path","name":"template_id","description":"The ID of the template.","schema":{"type":"string"},"required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateOut"}}},"description":"Successful response","headers":{"RateLimit-Limit":{"schema":{"type":"integer"},"description":"The maximum quota units allowed in the current window (from the most critical policy).","required":true},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"The number of remaining quota units (from the most critical policy).","required":true},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"The time, in seconds, until the critical rate limit resets.","required":true},"RateLimit-Policy":{"schema":{"type":"string"},"description":"A Structured Field string listing all concurrent policies enforced by the server.","required":true}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultHttpError"}}},"description":"Wrong payload"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultHttpError"}}},"description":"Not found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultHttpError"}}},"description":"Client error"}},"tags":["Templates Management"],"summary":"Update a template","description":"Use this endpoint to update a template.\n**Rate limits:** This endpoint is subject to rate limits. A maximum of **60 total requests per minute per waba id** is allowed. Requests exceeding these limits will receive a `429 Too Many Requests` response.","operationId":"post_Partners_v2_api_update_template","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateUpdateIn"}}}}}}}}
```

## Delete a template

> Use this endpoint to delete a template by id.

```json
{"openapi":"3.1.0","info":{"title":"Partners V2 API","version":"2.0.0"},"tags":[{"name":"Templates Management","description":"Endpoints for managing WhatsApp message templates"}],"servers":[{"description":"Production Server","url":"https://hub.360dialog.io"}],"security":[{"PartnerApiKeyV2":[]},{"Bearer":[]}],"components":{"securitySchemes":{"PartnerApiKeyV2":{"type":"apiKey","name":"X-API-Key","in":"header","description":"API Key for V2 authentication. Send your Partner API key in the X-API-Key header. Preferred authentication method."},"Bearer":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer token authentication. Token obtained via /api/v2/token endpoint."}},"schemas":{"DefaultHttpOut":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/_Meta"},"status_code":{"type":"integer"}},"required":["meta","status_code"],"additionalProperties":false},"_Meta":{"type":"object","properties":{"developer_message":{"type":"string"},"http_code":{"type":"integer"},"success":{"type":"boolean"},"360dialog_trace_id":{"type":"string","description":"Trace ID for debugging purposes"}},"required":["developer_message","http_code","success"],"additionalProperties":false},"TemplateMetaError":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/MetaSchemaErrorWithDetailsAndErrorData"}},"required":["meta"],"additionalProperties":false},"MetaSchemaErrorWithDetailsAndErrorData":{"type":"object","properties":{"developer_message":{"type":"string"},"http_code":{"type":"integer"},"success":{"type":"boolean"},"360dialog_trace_id":{"type":"string","description":"Trace ID for debugging purposes"},"details":{"type":"string"},"error_data":{"$ref":"#/components/schemas/MetaSchemaErrorData"}},"required":["details","developer_message","error_data","http_code","success"],"additionalProperties":false},"MetaSchemaErrorData":{"type":"object","properties":{"error_user_msg":{"type":"string"},"error_user_title":{"type":"string"},"message":{"type":"string"}},"required":["error_user_msg","error_user_title","message"],"additionalProperties":false},"DefaultHttpError":{"type":"object","properties":{"meta":{"allOf":[{"$ref":"#/components/schemas/_MetaSchemaError"}]}},"required":["meta"],"additionalProperties":false},"_MetaSchemaError":{"type":"object","properties":{"developer_message":{"type":"string"},"http_code":{"type":"integer"},"success":{"type":"boolean"},"360dialog_trace_id":{"type":"string","description":"Trace ID for debugging purposes"}},"required":["developer_message","http_code","success"],"additionalProperties":false}}},"paths":{"/api/v2/partners/{partner_id}/waba_accounts/{waba_account_id}/waba_templates/{template_id}":{"delete":{"parameters":[{"in":"path","name":"partner_id","description":"The ID of the partner.","schema":{"type":"string"},"required":true},{"in":"path","name":"waba_account_id","description":"Internal 360dialog ID of the waba account. This ID always have postfix WA.","schema":{"type":"string"},"required":true},{"in":"path","name":"template_id","description":"The ID of the template.","schema":{"type":"string"},"required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultHttpOut"}}},"description":"Successful response"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateMetaError"}}},"description":"Wrong payload"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultHttpError"}}},"description":"Not found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultHttpError"}}},"description":"Conflict"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultHttpError"}}},"description":"Client error"}},"tags":["Templates Management"],"summary":"Delete a template","description":"Use this endpoint to delete a template by id.","operationId":"delete_Partners_v2_api_delete_template"}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.360dialog.com/partner/partner-api/api-reference/templates-management.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
