API Tokens

 

General information

Available since v. 1.70.*

Available ONLY for JIRA administrators

You can read more about Tokens here REST API Tokens

Get all Tokens

Method type: GET

URL: {JIRA_URL}/rest/extender/1.0/tokenTools/get

Respons format: JSON

Example response:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 { "tokens": [ { "label": "Token name", "user": "admin", "token": "ip9ul19f8jenb92tji8lo34qt7tb1meo", "limitTo": "[post].*/rest/api/2/issue/KANBAN-100/comment.*<br>.*/rest/api/2/issue/SCRUM-[1-2]{1}/comment.*", "ip": "", "validUntil": 1630476718964, "dateCreated": 1622700718964, "counter": 100 }, { "label": "Token name two", "user": "jankowalski", "token": "okf8a73basc74nasc9n32", "limitTo": "", "ip": "192.168.1.1", "validUntil": 1630476718964, "dateCreated": 1622700718964, "counter": 123456 } ], "status": "ok" }

 


Create Token

Method type: POST

URL: {JIRA_URL}/rest/extender/1.0/tokenTools/set

Request format: JSON

Example request:

1 2 3 4 5 6 7 { "label": "Token name", "daysUntilExpiry": 90 "userName": "admin", "limitTo": "[post].*/rest/api/2/issue/KANBAN-100/comment.*\n.*/rest/api/2/issue/SCRUM-[1-2]{1}/comment.*" "token": "ip9ul19f8jenb92tji8lo34qt7tb1meo" }
1 2 3 4 5 { "label": "Token name", "daysUntilExpiry": 0 "token": "ip9ul19f8jenb92tji8lo34qt7tb1meo" }
1 2 3 4 { "label": "Token name", "userName": "admin" }

label - required - token name

daysUntilExpiry - optional - for security reasons, you can set this token to automatically expire. You can't change the expiry date once the token is created.

userName - optional - a user who will be able to use token, leave this field empty so that anyone can use the token.

limitTo - optional - you can limit the token to specific urls and methods, you can add new line sign using \n, \\n or <br>

token - optional - token, leave this field empty and the system will generate a random string


Delete Token

Method type: DELETE

URL: {JIRA_URL}/rest/extender/1.0/tokenTools/delete

Request format: JSON

Example request:

1 2 3 { "token": "ip9ul19f8jenb92tji8lo34qt7tb1meo" }