For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Dev Portal
DocsAPI ReferenceLearnCommunityChangelog
DocsAPI ReferenceLearnCommunityChangelog
    • About Our APIs
  • REST
    • Overview
      • Overview
        • Abandoned Cart Emails
        • Custom Template Associations
            • GETList Custom Template Associations
            • PUTUpsert Custom Template Associations
            • DELDelete Custom Template Associations
        • Email Templates
        • Pages
        • Marketing
        • Store Content
        • Themes
        • Widgets
        • Page Widgets
      • Payments
  • GraphQL
    • Overview
  • MCP
    • Overview
Dev Portal
LogoLogo
RESTAdminContentCustom Template Associations

Upsert Custom Template Associations

PUT
https://api.bigcommerce.com/stores/:store_hash/v3/storefront/custom-template-associations
PUT
/stores/:store_hash/v3/storefront/custom-template-associations
$curl -X PUT https://api.bigcommerce.com/stores/store_hash/v3/storefront/custom-template-associations \
> -H "Accept: application/json" \
> -H "X-Auth-Token: <apiKey>" \
> -H "Content-Type: application/json" \
> -d '[
> {
> "channel_id": 1,
> "entity_type": "brand",
> "entity_id": 123,
> "file_name": "custom-brand-1.html"
> },
> {
> "channel_id": 12345,
> "entity_type": "page",
> "entity_id": 123,
> "file_name": "custom-page.html"
> },
> {
> "channel_id": 67543,
> "entity_type": "product",
> "entity_id": 12,
> "file_name": "custom-product-1.html"
> }
>]'
1{}
Upsert new custom template associations data across all storefronts. If an existing record is found for the combination of channel ID, entity ID, and type, the existing record will be overwritten with the new template.
Was this page helpful?
Previous

List Custom Template Associations

Next

Delete Custom Template Associations

Built with

Authentication

X-Auth-Tokenstring
### OAuth scopes | UI Name | Permission | Parameter | |:--------|:-----------|:----------| | Themes |Read-only|`store_themes_read_only`| | Themes |Manage|`store_themes_manage`| ### Authentication header | Header | Argument | Description | |:-------|:---------|:------------| | `X-Auth-Token` | `access_token` | For more about API accounts that generate `access_token`s, see our [Guide to API Accounts](/developer/docs/overview/api-fundamentals/api-accounts#api-accounts). | ### Further reading For example requests and more information about authenticating BigCommerce APIs, see [Authentication and Example Requests](/developer/docs/overview/api-fundamentals/api-accounts#x-auth-token-header-example-requests). For more about BigCommerce OAuth scopes, see our [Guide to API Accounts](/developer/docs/overview/api-fundamentals/api-accounts#oauth-scopes). For a list of API status codes, see [API Status Codes](/developer/api-reference/rest/overview#rest-http-status-codes).

Path parameters

store_hashstringRequired
Permanent ID of the BigCommerce store.

Headers

AcceptstringRequiredDefaults to application/json

The MIME type of the response body.

Request

channel_idintegerRequired
entity_typeenumRequired
Allowed values:
entity_idintegerRequired
file_namestringRequired

Response

Success response for batch upsert of custom template associations

Errors

422
Unprocessable Entity Error

OAuth scopes

UI NamePermissionParameter
ThemesRead-onlystore_themes_read_only
ThemesManagestore_themes_manage

Authentication header

HeaderArgumentDescription
X-Auth-Tokenaccess_tokenFor more about API accounts that generate access_tokens, see our Guide to API Accounts.

Further reading

For example requests and more information about authenticating BigCommerce APIs, see Authentication and Example Requests.

For more about BigCommerce OAuth scopes, see our Guide to API Accounts.

For a list of API status codes, see API Status Codes.