Manage Custom Fonts in Marketing Cloud Next
To add an external font file to your Marketing Cloud Next content workspace, upload it from your computer or specify the URL. Use custom fonts in emails, landing pages, forms, and content blocks without depending on a publicly available content delivery network (CDN) URL.
Retrieve the ID of the folder or workspace where you want to add the font. See Manage Content Workspaces and Manage Content Folders.
There are two ways to add a font to your content workspace. The easiest method is to specify an external URL where the font is hosted. Alternatively, you can upload a font file from your computer by creating a multipart POST request that includes the encoded binary data for the font.
To add a font hosted at an external URL, issue a POST request to the /services/data/{apiVersion}/connect/cms/contents endpoint. The body of the request uses an application/json Content-Type value.
| Property | Data Type | Description |
|---|---|---|
contentBody.sfdc_cms:media.source.type | string | Required. The source of the content item. For externally hosted fonts, use url. |
contentBody.sfdc_cms:media.source.url | string | Required. The URL of the externally hosted font. |
contentSpaceOrFolderId | string | Required. The ID of the workspace or folder to add the font to. |
contentType | string | Required. The type of the content item. For custom fonts, use sfdc_cms__customFont. |
title | string | Required. A name that identifies the font in your content workspace. |
The API doesn’t validate that the URL resolves to a valid font file. Double-check the URL that you provide.
To upload a font file, issue a multipart/form-data POST request to the /services/data/{apiVersion}/connect/cms/contents endpoint.
Include a JSON part named ManagedContentInputParam and a binary part named contentData. Set the contentData part’s content type to font/woff2, font/ttf, or font/otf, depending on the type of font. Include the font file as a base64-encoded string.
The API returns 201 Created, and the response body includes metadata about the font content. The response contains the uploaded file’s Salesforce record ID in contentBody.sfdc_cms:media.source.ref and a CMS delivery path in contentBody.sfdc_cms:media.url.
To retrieve a Custom Font content item, issue a GET request to the /services/data/{apiVersion}/connect/cms/contents/{contentId} endpoint. Replace {contentId} with the ID of the font content item.
If the request is successful, the response includes the font source and the content item metadata.
For a URL source, contentBody.sfdc_cms:media.url matches the source URL. For a file source, it contains the CMS delivery path. The response also provides the managedContentId that you use to publish the content item.