Upload a font file

Changed on

Upload a font file (woff2, woff, ttf, otf, eot; max 20MB) to the project's storage and get back the metadata needed for a file item in the project/quiz/paywall fonts config. Family, weight, style and variable-font flag are read from the font file itself when possible (detected: true), otherwise guessed from the filename. Files are stored in the fonts subfolder by default.

post/project-files/upload-font

Request

  • Base URL
    https://api.web2wave.com/api
  • URL
    https://api.web2wave.com/api/project-files/upload-font
  • Auth
    API key in header api_key

Headers

api_keystring required

API key for authentication

Request body multipart/form-data

filestring binary required

Font file (woff2, woff, ttf, otf, eot), max 20MB.

pathstring

Optional subfolder path within the project directory

Response

Font uploaded successfully

typestring

Always file - matches the fonts.items[].type value.

urlstring

Public URL of the uploaded font

filenamestring
pathstring
formatstring

Font format

css_formatstring

Value for the CSS format() function

family_suggestionstring

Font family name from the font metadata, or derived from the filename

weightstring

Font weight (e.g. 700) or range for variable fonts (e.g. 100 900)

style'normal' | 'italic'
variableboolean

Whether the font is a variable font

detectedboolean

True when metadata was read from the font file, false when guessed from the filename

Example response

{
  "type": "file",
  "url": "https://s3.amazonaws.com/bucket/projects/production/123/fonts/Inter-Bold.woff2",
  "filename": "Inter-Bold.woff2",
  "path": "projects/production/123/fonts/Inter-Bold.woff2",
  "format": "woff2",
  "css_format": "woff2",
  "family_suggestion": "Inter",
  "weight": "700",
  "style": "normal",
  "detected": true
}

Changes