How to retrieve application license details or set the license via private REST API in Jira 7+

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Purpose

This document is for System Administrators who would like to use the private REST API to:

  • either retrieve their application license details
  • or update/set the application license key 

(warning) Please note that these are private endpoints and may change without notice. Please refer to JRASERVER-65774 - Getting issue details... STATUS for an official public endpoint.

Solution to retrieve the license details:

The following endpoints will return the license details for the respective application

  • Jira Software

    /rest/plugins/applications/1.0/installed/jira-software/license
  • Jira Service Management

    /rest/plugins/applications/1.0/installed/jira-servicedesk/license
  • Jira Core

    /rest/plugins/applications/1.0/installed/jira-core/license

Here is an example response:

{
    "valid": true,
    "evaluation": false,
    "maximumNumberOfUsers": 10000,
    "licenseType": "Commercial",
    "creationDateString": "07/Dec/15",
    "expiryDate": 4100331600000,
    "expiryDateString": "07/Dec/17",
    "organizationName": "Atlassian",
    "dataCenter": false,
    "subscription": false,
    "rawLicense": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "maintenanceExpired": false,
    "enterprise": false,
    "active": true,
    "autoRenewal": false
}


(info) As an additional information, you can use api/2/applicationrole to identify number of used/remaining licenses in the application. More information here: GET /rest/api/2/applicationrole/{key}

Solution to set the license:

To set the license details, you will need to use the following API call using:

  • the POST method
  • the following body where <LICENSE_KEY> needs to be replaced with the license key of the application you are trying set the license for

    {"licenseKey": "<LICENSE_KEY>"}
  • the following endpoints for the respective application:
    • Jira Software

      /rest/plugins/applications/1.0/installed/jira-software/license
    • Jira Service Management

      /rest/plugins/applications/1.0/installed/jira-servicedesk/license
    • Jira Core

      /rest/plugins/applications/1.0/installed/jira-core/license

An example of how the cURL command would look like to set the value for jira-software (replace admin username, password, JIRA_BASE_URL and the actual license):

curl -v -u adminusername:adminpassword -X POST <JIRA_BASE_URL>/rest/plugins/applications/1.0/installed/jira-software/license/ -H "Content-Type: application/vnd.atl.plugins+json" -d '{"licenseKey":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}'


If not familiar with REST API, you can refer to the following documentation:

For add-ons, you can refer to the following article instead:


Last modified on Nov 29, 2022

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.