The Admin Key feature is only offered with Confluence Cloud Premium and Enterprise to organization or site admins.
Returns information about the admin key if one is currently enabled for the calling user within the site.
Permissions required: User must be an organization or site admin.
Connect apps cannot access this REST resource.
This request has no parameters.
Returned if an admin key is currently enabled for the calling user.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
//
// This API resource doesn't support Oauth2 (3LO). See alternate authorization methods:
// https://developer.atlassian.com/cloud/confluence/rest/#auth
import api, { route } from "@forge/api";
const response = await api.requestConfluence(route`/wiki/api/v2/admin-key`, {
headers: {
'Accept': 'application/json'
}
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.json());
1
2
3
4
{
"accountId": "<string>",
"expirationTime": "<string>"
}
Enables admin key access for the calling user within the site. If an admin key already exists for the user, a new one will be issued with an updated expiration time.
Note: The durationInMinutes
field within the request body is optional. If the request body is empty or if the durationInMinutes
is set to 0 minutes, a new admin key will be issued to the calling user with a default duration of 10 minutes.
Permissions required: User must be an organization or site admin.
Connect apps cannot access this REST resource.
integer
Returned if a new admin key is successfully issued for the calling user.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
//
// This API resource doesn't support Oauth2 (3LO). See alternate authorization methods:
// https://developer.atlassian.com/cloud/confluence/rest/#auth
import api, { route } from "@forge/api";
var bodyData = `{
"durationInMinutes": 145
}`;
const response = await api.requestConfluence(route`/wiki/api/v2/admin-key`, {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: bodyData
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.json());
1
2
3
4
{
"accountId": "<string>",
"expirationTime": "<string>"
}
Disables admin key access for the calling user within the site.
Permissions required: User must be an organization or site admin.
Connect apps cannot access this REST resource.
This request has no parameters.
Returned if admin key access was successfully disabled for the calling user or if the user did not have an admin key in the first place.
1
2
3
4
5
6
7
8
9
10
11
12
13
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
//
// This API resource doesn't support Oauth2 (3LO). See alternate authorization methods:
// https://developer.atlassian.com/cloud/confluence/rest/#auth
import api, { route } from "@forge/api";
const response = await api.requestConfluence(route`/wiki/api/v2/admin-key`, {
method: 'DELETE'
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.text());
Rate this page: