Rate this page:
GET /wiki/rest/api/audit
Returns all records in the audit log, optionally for a certain date range. This contains information about events like space exports, group membership changes, app installations, etc. For more information, see Audit log in the Confluence administrator's guide.
Permissions required: 'Confluence Administrator' global permission.
Connect apps cannot access this REST resource.
read:audit-log:confluence
string
Filters the results to the records on or after the startDate
.
The startDate
must be specified as a timestamp.
string
Filters the results to the records on or before the endDate
.
The endDate
must be specified as a timestamp.
string
Filters the results to records that have string property values
matching the searchString
.
integer
The starting index of the returned records.
0
, Minimum: 0
, Format: int32
integer
The maximum number of records to return per page. Note, this may be restricted by fixed system limits.
1000
, Minimum: 0
, Format: int32
1 2 3 4 5 6 7 8 9 10 11 12
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
import api, { route } from "@forge/api";
const response = await api.asApp().requestConfluence(route`/wiki/rest/api/audit`, {
headers: {
'Accept': 'application/json'
}
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.json());
Returned if the requested records are returned.
Content type | Value |
---|---|
application/json |
POST /wiki/rest/api/audit
Creates a record in the audit log.
Permissions required: 'Confluence Administrator' global permission.
Connect apps cannot access this REST resource.
read:audit-log:confluence
, write:audit-log:confluence
The user that actioned the event. If author
is not specified, then all
author
properties will be set to null/empty, except for type
which
will be set to 'user'.
string
The IP address of the computer where the event was initiated from.
integer
The creation date-time of the audit record, as a timestamp. This is converted
to a date-time display in the Confluence UI. If the creationDate
is not
specified, then it will be set to the timestamp for the current date-time.
int64
string
The summary of the event, which is displayed in the 'Change' column on the audit log in the Confluence UI.
string
A long description of the event, which is displayed in the 'Description' field on the audit log in the Confluence UI.
string
The category of the event, which is displayed in the 'Event type' column on the audit log in the Confluence UI.
boolean
Indicates whether the event was actioned by a system administrator.
false
Array<ChangedValue>
The values that were changed in the event.
Array<AffectedObject>
Objects that were associated with the event. For example, if the event was a space permission change then the associated object would be the space.
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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
import api, { route } from "@forge/api";
var bodyData = `{
"author": {
"type": "user",
"displayName": "<string>",
"operations": {},
"username": "<string>",
"userKey": "<string>"
},
"remoteAddress": "<string>",
"creationDate": 226,
"summary": "<string>",
"description": "<string>",
"category": "<string>",
"sysAdmin": true,
"affectedObject": {
"name": "<string>",
"objectType": "<string>"
},
"changedValues": [
{
"name": "<string>",
"oldValue": "<string>",
"hiddenOldValue": "<string>",
"newValue": "<string>",
"hiddenNewValue": "<string>"
}
],
"associatedObjects": [
{
"name": "<string>",
"objectType": "<string>"
}
]
}`;
const response = await api.asApp().requestConfluence(route`/wiki/rest/api/audit`, {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: bodyData
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.json());
Returned if the record is created in the audit log.
Content type | Value |
---|---|
application/json |
GET /wiki/rest/api/audit/export
Exports audit records as a CSV file or ZIP file.
Permissions required: 'Confluence Administrator' global permission.
Connect apps cannot access this REST resource.
read:audit-log:confluence
string
Filters the exported results to the records on or after the startDate
.
The startDate
must be specified as a timestamp.
string
Filters the exported results to the records on or before the endDate
.
The endDate
must be specified as a timestamp.
string
Filters the exported results to records that have string property values
matching the searchString
.
string
The format of the export file for the audit records.
csv
Valid values: csv
, zip
1 2 3 4 5 6 7 8 9 10 11 12
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
import api, { route } from "@forge/api";
const response = await api.asApp().requestConfluence(route`/wiki/rest/api/audit/export`, {
headers: {
'Accept': 'application/zip'
}
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.text());
Returned if the requested export of the audit records is returned.
Content type | Value |
---|---|
application/zip | string |
text/csv | string |
GET /wiki/rest/api/audit/retention
Returns the retention period for records in the audit log. The retention period is how long an audit record is kept for, from creation date until it is deleted.
Permissions required: 'Confluence Administrator' global permission.
Connect apps cannot access this REST resource.
read:audit-log:confluence
1 2 3 4 5 6 7 8 9 10 11 12
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
import api, { route } from "@forge/api";
const response = await api.asApp().requestConfluence(route`/wiki/rest/api/audit/retention`, {
headers: {
'Accept': 'application/json'
}
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.json());
Returned if the requested retention period is returned.
Content type | Value |
---|---|
application/json |
PUT /wiki/rest/api/audit/retention
Sets the retention period for records in the audit log. The retention period can be set to a maximum of 20 years.
Permissions required: 'Confluence Administrator' global permission.
Connect apps cannot access this REST resource.
write:audit-log:confluence
integer
The number of units for the retention period.
int32
string
The unit of time that the retention period is measured in.
Valid values: NANOS
, MICROS
, MILLIS
, SECONDS
, MINUTES
, HOURS
, HALF_DAYS
, DAYS
, WEEKS
, MONTHS
...(Show more)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
import api, { route } from "@forge/api";
var bodyData = `{
"number": 45,
"units": "NANOS"
}`;
const response = await api.asApp().requestConfluence(route`/wiki/rest/api/audit/retention`, {
method: 'PUT',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: bodyData
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.json());
Returned if the retention period is updated.
Content type | Value |
---|---|
application/json |
GET /wiki/rest/api/audit/since
Returns records from the audit log, for a time period back from the current date. For example, you can use this method to get the last 3 months of records.
This contains information about events like space exports, group membership changes, app installations, etc. For more information, see Audit log in the Confluence administrator's guide.
Permissions required: 'Confluence Administrator' global permission.
Connect apps cannot access this REST resource.
read:audit-log:confluence
integer
The number of units for the time period.
3
, Format: int64
string
The unit of time that the time period is measured in.
MONTHS
Valid values: NANOS
, MICROS
, MILLIS
, SECONDS
, MINUTES
, HOURS
, HALF_DAYS
, DAYS
, WEEKS
, MONTHS
...(Show more)
string
Filters the results to records that have string property values
matching the searchString
.
integer
The starting index of the returned records.
0
, Minimum: 0
, Format: int32
integer
The maximum number of records to return per page. Note, this may be restricted by fixed system limits.
1000
, Minimum: 0
, Format: int32
1 2 3 4 5 6 7 8 9 10 11 12
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
import api, { route } from "@forge/api";
const response = await api.asApp().requestConfluence(route`/wiki/rest/api/audit/since`, {
headers: {
'Accept': 'application/json'
}
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.json());
Returned if the requested records are returned.
Content type | Value |
---|---|
application/json |
Rate this page: