importGoogleFont
POST
/api/v1/fonts/google
const url = 'https://example.com/api/v1/fonts/google';const options = { method: 'POST', headers: {'X-CSRF-Token': 'example', 'Content-Type': 'application/json'}, body: '{"sourceId":"example","subsets":["example"],"styles":["normal"],"weights":[1]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v1/fonts/google \ --header 'Content-Type: application/json' \ --header 'X-CSRF-Token: example' \ --data '{ "sourceId": "example", "subsets": [ "example" ], "styles": [ "normal" ], "weights": [ 1 ] }'Copy the chosen files of one Google Fonts family into the font library. The server downloads the files once; Players and Studio never contact the catalog. Requires the settings.manage capability. Cookie-authenticated unsafe requests require X-CSRF-Token.
Parameters
Section titled “ Parameters ”Header Parameters
Section titled “Header Parameters”X-CSRF-Token
required
string
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
sourceId
required
string
subsets
Array<string>
styles
Array<string>
weights
Array<integer>
Responses
Section titled “ Responses ”Font family added
Media typeapplication/json
object
data
required
object
id
required
string format: uuid
family
required
string
source
required
string
sourceId
required
string
sourceVersion
required
string
category
required
string
license
required
string
subsets
required
Array<string>
faces
required
Array<object>
object
id
required
string format: uuid
assetId
required
string format: uuid
variantId
required
string format: uuid
style
required
string
weightMin
required
integer
weightMax
required
integer
subset
required
string
unicodeRange
required
string
mimeType
required
string
fileSize
required
integer
fileUrl
required
string
totalBytes
required
integer
createdAt
required
string format: date-time
updatedAt
required
string format: date-time
Example
{ "data": { "source": "google", "faces": [ { "style": "normal", "mimeType": "font/woff2" } ] }}Invalid request body
Dashboard authentication required
Insufficient capability
A family with this name is already in the library
The selection exceeds the import size limit
The selection is not available for this family
The catalog could not be reached
The catalog is disabled on this server