Styles

A Style is a custom set of branding that can be applied on a per-folder basis. Currently these support a logo per folder and an optional click-through URL for public visitors. In the future we may extend these to also support colors. If you want to see that, please let us know so we can add your vote to the list.

Show Style

Endpoint

GET/styles/{path}

Return Object

Style

Authorization Requirement

Available to all authenticated keys or sessions.

Request Parameters

ParameterDescription
path
string
Required
Style path.

Example Request

curl https://app.files.com/api/rest/v1/styles/{path} \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

Example Response

{
  "id": 1,
  "path": "example",
  "logo": "https://mysite.files.com/...",
  "logo_click_href": "https://www.example.com",
  "thumbnail": {
    "name": "My logo",
    "uri": "https://mysite.files.com/.../my_image.png"
  }
}

Update Style

Endpoint

PATCH/styles/{path}

Return Object

Style

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Folder Admin permissions.

Request Parameters

ParameterDescription
path
string
Required
Style path.
file
file
Logo for custom branding. Required when creating a new style. See Attaching Files to API Requests.
logo_click_href
string
URL to open when a public visitor clicks the logo.

Example Request

curl https://app.files.com/api/rest/v1/styles/{path} \
  -X PATCH \
  -H 'Content-Type: application/json' \
  -d '{"logo_click_href":"https://www.example.com"}' \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

Example Response

{
  "id": 1,
  "path": "example",
  "logo": "https://mysite.files.com/...",
  "logo_click_href": "https://www.example.com",
  "thumbnail": {
    "name": "My logo",
    "uri": "https://mysite.files.com/.../my_image.png"
  }
}

Delete Style

Endpoint

DELETE/styles/{path}

Return Object

No return value.

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Folder Admin permissions.

Request Parameters

ParameterDescription
path
string
Required
Style path.

Example Request

curl https://app.files.com/api/rest/v1/styles/{path} \
  -X DELETE \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

The Style Object

Some of the endpoints above return a Style object. The attributes of this object are listed below.

AttributeDescription
id
int64
Style ID
path
string
Folder path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
logo
Image
Logo
logo_click_href
string
URL to open when a public visitor clicks the logo
thumbnail
Image
Logo thumbnail

Example Style Object

{
  "id": 1,
  "path": "example",
  "logo": "https://mysite.files.com/...",
  "logo_click_href": "https://www.example.com",
  "thumbnail": {
    "name": "My logo",
    "uri": "https://mysite.files.com/.../my_image.png"
  }
}