Skip to content

Upload tenant logo

Request to upload the logo image for a logo location of a tenant:

PUT /api/v2/tenants/<tenant-id>/branding/logo/<location>

<location> is one of:

  • login_page - the logo of the Sign-In page
  • header_menu - the logo of the top navigation bar

The HTTP body is the raw image data (not multipart, not base64). Set the Content-Type request header to the image type. The image format is detected from the content.

Requirements:

  • Supported formats: GIF, JPEG, PNG, and SVG.
  • Maximum file size: 64 KB.
  • An SVG image must be a well-formed XML document.

The original filename can be passed in the optional filename query parameter (maximum 255 characters, extension gif, jpg, jpeg, png, or svg). When omitted, a filename is synthesized from the detected image format, for example, logo.png.

Example with curl:

curl -u {login}:{password} -X PUT \
    -H "Content-Type: image/png" \
    --data-binary @acme-logo.png \
    "https://{your-miarec-server}/api/v2/tenants/<tenant-id>/branding/logo/login_page?filename=acme-logo.png"

Uploading a logo replaces the image stored for that location and sets the location's logo_type to logo, so the uploaded image is displayed at this location. The logo_text value is preserved for a later switch back to text.

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

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

Response Description
200 OK Image has been successfully uploaded
400 Bad Request

The request cannot be completed because the image data or the filename parameter is invalid: the body is empty, the file is larger than 64 KB, the format is not supported, the SVG is not well-formed, or the filename is too long or has an unsupported extension.

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

{"error": "InvalidRecord", "explanation": "File is too large (>64KB)", "details": null}
403 Forbidden The request cannot be completed because API user has no permission to edit branding
404 Not Found The location is unknown, or the tenant does not exist or is not visible to the API user