Skip to main content
Version: 25.03

License - Upload License

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/license/upload

Overview​

Installs a Countly license file on the server. The request is a multipart file upload.

Authentication​

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

Permissions​

  • Update permission on the license feature.
  • The member must be a global admin; other members get 403.

Request Parameters​

ParameterTypeRequiredDescription
api_keyStringYes (or auth_token)API key authentication
auth_tokenStringYes (or api_key)Auth token authentication
app_idStringYesApp ID used for permission validation
licenseFileYesThe license file, sent as a multipart form field named license.

Examples​

curl -X POST "https://your-countly-server.com/i/license/upload?api_key=YOUR_API_KEY&app_id=YOUR_APP_ID" \
-F "license=@countly.license"

Response​

Success Response​

"Success"

Error Responses​

HTTP StatusResponse
403Forbidden (the member is not a global admin)
403not_applicable_on_flex (the deployment does not use license files)
500License already exists (this license was installed before)
500Error in license activation (the file is missing, unreadable or its signature is not valid)

Standard authentication/authorization errors from update validation can also be returned.

Behavior​

  • Reads the uploaded file and verifies its signature with the license public key.
  • Rejects a license whose ID is already stored.
  • Keeps the active tier of the license being replaced, if one can be read, as the previous tier.
  • Saves the new license as the active license, clears license state kept from the previous license, and stores a record of it in the list of installed licenses.
  • Deletes the uploaded file from the server when done.
Implementation details

Database Collections

CollectionUsed forData touched by this endpoint
countly.pluginsActive license and plugin settingsReplaces the license document; clears stored license state.
countly.licensesInstalled licensesReads and inserts the license record.