uploadFont
POST
/api/v1/fonts/uploads
const url = 'https://example.com/api/v1/fonts/uploads';const form = new FormData();form.append('file', 'file');form.append('rightsConfirmed', 'true');
const options = {method: 'POST', headers: {'X-CSRF-Token': 'example'}};
options.body = form;
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/uploads \ --header 'Content-Type: multipart/form-data' \ --header 'X-CSRF-Token: example' \ --form file=@file \ --form rightsConfirmed=trueUpload one TrueType or OpenType face. The server reads the family name, weight, and style from the file. A face whose family matches an uploaded family joins it. Requires the settings.manage capability and a confirmation that the organization may use the font on its displays. 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 typemultipart/form-data
object
file
required
string format: binary
rightsConfirmed
required
boolean
Responses
Section titled “ Responses ”Font face stored
Media typeapplication/json
object
data
required
object
family
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
embeddingRestricted
required
boolean
Example
{ "data": { "family": { "source": "google", "faces": [ { "style": "normal", "mimeType": "font/woff2" } ] } }}Malformed upload
Dashboard authentication required
Insufficient capability
The face or family name already exists
The file exceeds 15 MB
The file is not a supported font or rights were not confirmed