Get Started
Configure your Org
Manage Content Workspaces
Manage Content Folders
Search for Content
Manage Emails
Manage Email Templates
Manage Custom Fonts
Publish Content Items
Integrate Form Submissions
Security
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. |
1POST /services/data/{apiVersion}/connect/cms/contents HTTP/1.1
2Host: {subdomain}.my.salesforce.com
3Content-Type: application/json
4Authorization: Bearer YOUR_BEARER_TOKEN
5
6{
7 "contentSpaceOrFolderId": "0ZuQZ0000004YSv0AM",
8 "contentType": "sfdc_cms__customFont",
9 "title": "Brand Sans Regular",
10 "contentBody": {
11 "sfdc_cms:media": {
12 "source": {
13 "type": "url",
14 "url": "https://fonts.example.com/brand-sans-regular.woff2"
15 }
16 }
17 }
18}The API doesn’t validate that the URL resolves to a valid font file. Double-check the URL that you provide.
Note
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.
1POST /services/data/{apiVersion}/connect/cms/contents HTTP/1.1
2Host: {subdomain}.my.salesforce.com
3Content-Type: multipart/form-data; boundary=BOUNDARY
4Authorization: Bearer YOUR_BEARER_TOKEN
5
6--BOUNDARY
7Content-Disposition: form-data; name="ManagedContentInputParam"
8Content-Type: application/json; charset=UTF-8
9
10{
11 "contentSpaceOrFolderId": "0ZuQZ0000004YSv0AM",
12 "contentType": "sfdc_cms__customFont",
13 "title": "Brand Sans Regular",
14 "contentBody": {
15 "sfdc_cms:media": {
16 "source": {
17 "type": "file"
18 }
19 }
20 }
21}
22--BOUNDARY
23Content-Disposition: form-data; name="contentData"; filename="BrandFont.woff2"
24Content-Type: font/woff2
25
26<binary font data>
27--BOUNDARY--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.
1GET /services/data/{apiVersion}/connect/cms/contents/MCYONP3DRPAVGRHJ5HOREVW47SZI HTTP/1.1
2Host: {subdomain}.my.salesforce.com
3Authorization: Bearer YOUR_BEARER_TOKENIf the request is successful, the response includes the font source and the content item metadata.
1{
2 "apiName": "MCYONP3DRPAVGRHJ5HOREVW47SZI",
3 "contentBody": {
4 "sfdc_cms:media": {
5 "source": {
6 "fileSize": null,
7 "mimeType": null,
8 "type": "url",
9 "url": "https://fonts.example.com/brand-sans-regular.woff2"
10 },
11 "url": "https://fonts.example.com/brand-sans-regular.woff2"
12 }
13 },
14 "contentFqn": "marketing--Default_Content_Workspace.sfdc_cms__customFont--MCYONP3DRPAVGRHJ5HOREVW47SZI",
15 "contentKey": "MCYONP3DRPAVGRHJ5HOREVW47SZI",
16 "contentType": {
17 "fullyQualifiedName": "sfdc_cms__customFont",
18 "name": "Custom Font"
19 },
20 "contentVersion": 1,
21 "isPublished": false,
22 "managedContentId": "20YRZ000000eurV2AQ",
23 "managedContentVariantId": "9PsRZ000000e2W90AI",
24 "status": {
25 "label": "Draft",
26 "status": "Draft"
27 },
28 "title": "Brand Sans WOFF2 Regular",
29 "urlName": "brand-sans-woff2-regular",
30 "variantVersion": "1.1"
31}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.