Skip to content

Upload fonts

POST
/v1/fonts
curl -H "X-Api-Key: $ADMIN_KEY" -F file=@brand-fonts.zip \
http://localhost:9027/v1/fonts

Stores fonts for every caller and every replica: a ZIP of TTF, OTF or TTC files, or one such file. Takes an admin. They are in use on this replica when this returns, and on the others within syncIntervalSeconds.

Media typemultipart/form-data

The multipart form POST /v1/fonts accepts.

object
file
required

A ZIP of TTF, OTF or TTC files, or one such file.

string format: binary

Stored

Media typeapplication/json

What an upload stored.

object
fonts
required
Array<object>

A stored font.

object
faces
required
Array<object>
object
family
required
string
style
required
string
weight
required
integer format: int32
file
required
string
id
required

The hex SHA-256 of the file, so storing it twice changes nothing.

string
size
required
integer format: int64
uploadedAt
required

RFC 3339.

string
skipped
required

Files in the ZIP that were left out, and why.

Array<object>
object
file
required
string
reason
required
string
syncIntervalSeconds
required

In use on this replica now, and on the others within this many seconds.

integer format: int64

Example generated

{
"fonts": [
{
"faces": [
{
"family": "example",
"style": "example",
"weight": 1
}
],
"file": "example",
"id": "example",
"size": 1,
"uploadedAt": "example"
}
],
"skipped": [
{
"file": "example",
"reason": "example"
}
],
"syncIntervalSeconds": 1
}

Not fonts, or too large

Media typeapplication/json

The JSON body of every error response.

object
error
required

A stable, machine-readable kind.

string
message
required

What went wrong, for a person.

string

Example

{
"error": "invalid_request",
"message": "unknown step 'teleport'"
}

Needs an admin, or the store is full

Media typeapplication/json

The JSON body of every error response.

object
error
required

A stable, machine-readable kind.

string
message
required

What went wrong, for a person.

string

Example

{
"error": "invalid_request",
"message": "unknown step 'teleport'"
}

RUSTICDOC_STORE is not set

Media typeapplication/json

The JSON body of every error response.

object
error
required

A stable, machine-readable kind.

string
message
required

What went wrong, for a person.

string

Example

{
"error": "invalid_request",
"message": "unknown step 'teleport'"
}

The store cannot be reached

Media typeapplication/json

The JSON body of every error response.

object
error
required

A stable, machine-readable kind.

string
message
required

What went wrong, for a person.

string

Example

{
"error": "invalid_request",
"message": "unknown step 'teleport'"
}