Skip to main content

White Labeling - Upload Assets

Enterprise

This endpoint is part of Countly Enterprise. To get access, contact sales or compare versions. Existing customers can reach the support portal with questions.

Endpoint

/i/whitelabeling/upload

Overview

Uploads branding images used by White Labeling settings (pre-login logo, sidebar logo, favicon).

Authentication

Pass api_key or auth_token as a query parameter, or send countly-token as a header. See Authentication.

Permissions

  • Global Plugins: Update permission (global-level).

Request Parameters

Multipart form-data with one file field:

ParameterTypeRequiredDescription
api_keyStringYes (or auth_token)API key authentication
auth_tokenStringYes (or api_key)Auth token authentication
prelogoFileConditionalPre-login logo (png, gif, jpeg)
stopleftlogoFileConditionalSidebar logo (png, gif, jpeg)
faviconFileConditionalFavicon (png, gif, x-icon)

Examples

curl -X POST "https://your-server.com/i/whitelabeling/upload?api_key=YOUR_API_KEY" \
-F "prelogo=@./brand-login.png"
curl -X POST "https://your-server.com/i/whitelabeling/upload?api_key=YOUR_API_KEY" \
-F "favicon=@./favicon.ico"

Response

Success Response

{
"result": "Success"
}

Response Fields

FieldTypeDescription
resultStringUpload status

Error Responses

  • HTTP 400 - Invalid file type:
{
"result": "white-labeling.imagef-error"
}
  • HTTP 400 - Invalid image file:
{
"result": "white-labeling.imagefico-error"
}
  • HTTP 400 - File too large:
{
"result": "white-labeling.image-error"
}

Behavior

  • Accepts only the first matching file in this order: prelogo, stopleftlogo, favicon.
  • Enforces max file size of 1.5 MB.
  • Converts uploaded file to base64 data URI and stores in GridFS bucket white-labeling.

Limitations

  • Max file size: 1.5 MB.
  • One image is processed per request.
Implementation details

Database Collections

CollectionUsed forData touched by this endpoint
countly_fs.white-labeling.filesEndpoint data sourceStores endpoint-related records this endpoint reads or modifies.
countly_fs.white-labeling.chunksEndpoint data sourceStores endpoint-related records this endpoint reads or modifies.