Skip to content

Update tenant branding

Request to update the branding configuration of a tenant:

PUT /api/v2/tenants/<tenant-id>/branding.json

HTTP body should contain a JSON document with the branding attributes to update.

For example:

{
    "branding": {
        "enabled": true,
        "color": "#123456",
        "header_menu": {
            "logo_type": "text",
            "logo_text": "ACME"
        }
    }
}

This is a partial update. Attributes that are not included in the request keep their current values, including the attributes inside login_page and header_menu. Unknown attributes and the read-only logo attribute are ignored.

The response body contains the complete branding configuration after the update, in the same format as View tenant branding.

See Branding object fields for a description of all attributes.

Validation rules

  • color and color2 must match the format #rrggbb or be an empty string.
  • logo_text is required when logo_type is text, and is limited to 32 characters.
  • Setting logo_type of a location to text removes the logo image stored for that location.
  • Logo images cannot be set through this endpoint. Use Upload tenant logo instead. Uploading an image sets logo_type of the location to logo automatically.
  • custom_css is limited to 4 KB and is checked by the same CSS sanitizer as the branding form in the web portal. CSS that contains suspicious constructs (for example, url(...), @import, or script vectors) is rejected with 400 Bad Request and nothing is saved. Accepted CSS is stored and returned exactly as submitted. The web portal renders a sanitized version (for example, with comments stripped).

Response contains HTTP status code as shown in the following table.

Response Description
200 OK Branding configuration has been successfully updated
400 Bad Request

The request cannot be completed because supplied JSON object has invalid data.

The response has content type application/json and contains more detailed description of error, like:

{"error": "InvalidRecord", "explanation": "Record Validation errors", "details": {"color": "Invalid format for a color. Expected format: #rrggbb"}}
403 Forbidden The request cannot be completed because API user has no permission to edit branding
404 Not Found Tenant with such ID does not exist, or it is not visible to the API user (a tenant administrator can edit their own tenant only)