REST API

Authentication

Authentication is done via standard JIRA authentication methods. More details in the Authentication section of latest Jira Server platform REST API reference.

Data format

Data is exposed as XML or JSON. You can switch between JSON and XML by setting the “Accept” header of your request to “application/json“ or “application/xml” respectively.

Endpoints

GET /status

https://jira_base_url/rest/mailqueue/1.0/status

Use this endpoint for non-clustered nodes. For clustered instances, it will return data for the node currently selected by your load balancer.

This endpoint displays real-time data.

The response returns the size of the mail queue and mail error queue:

{
    "size": 26,
    "errorSize": 2
}

Or in XML:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mailQueue>
    <size>26</size>
    <errorSize>2</errorSize>
</mailQueue>

GET /clusterStatus

https://jira_base_url/rest/mailqueue/1.0/clusterStatus

Use this endpoint for clustered instances. On non-clustered nodes, it will always return an empty “nodes“ array, or an empty <clusterMailQueue/> tag in the XML.

Because the application polls nodes once per minute, the data provided by the endpoint has a latency of up to 60 seconds.

Since mail queues on different nodes are independent, the endpoint returns an array of nodes with some basic information about the node, as well as the size of the mail queue and mail error queue for each node:

{
    "nodes": [
        {
            "nodeId": "node_2",
            "nodeState": "OFFLINE",
            "isClustered": true,
            "mailQueue": {
                "size": 0,
                "errorSize": 0
            }
        },
        {
            "nodeId": "node_1",
            "nodeState": "ACTIVE",
            "isClustered": true,
            "mailQueue": {
                "size": 63,
                "errorSize": 14
            }
        }
    ]
}

Or in XML:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<clusterMailQueue>
    <node>
        <nodeId>node_2</nodeId>
        <nodeState>OFFLINE</nodeState>
        <isClustered>true</isClustered>
        <mailQueue>
            <size>0</size>
            <errorSize>0</errorSize>
        </mailQueue>
    </node>
    <node>
        <nodeId>node_1</nodeId>
        <nodeState>ACTIVE</nodeState>
        <isClustered>true</isClustered>
        <mailQueue>
            <size>63</size>
            <errorSize>14</errorSize>
        </mailQueue>
    </node>
</clusterMailQueue>