Confluence Cloud Developer

Confluence Cloud Developer

Rate this page:

Audit

Get audit records

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.

Apps cannot access this REST resource.

Request

Query parameters
startDate

string

Filters the results to the records on or after the startDate. The startDate must be specified as a timestamp.

endDate

string

Filters the results to the records on or before the endDate. The endDate must be specified as a timestamp.

searchString

string

Filters the results to records that have string property values matching the searchString.

start

integer

The starting index of the returned records.

Default: 0, Minimum: 0, Format: int32
limit

integer

The maximum number of records to return per page. Note, this may be restricted by fixed system limits.

Default: 1000, Minimum: 0, Format: int32

Example

1
2
3
curl --request GET \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/audit' \
  --header 'Accept: application/json'

Responses

Returned if the requested records are returned.

Content typeValue
application/json

AuditRecordArray

Create audit record

POST /wiki/rest/api/audit

Creates a record in the audit log.

Permissions required: 'Confluence Administrator' global permission.

Apps cannot access this REST resource.

Request

Body parameters
author

object

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'.

remoteAddress Required

string

The IP address of the computer where the event was initiated from.

creationDate

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.

Format: int64
summary

string

The summary of the event, which is displayed in the 'Change' column on the audit log in the Confluence UI.

description

string

A long description of the event, which is displayed in the 'Description' field on the audit log in the Confluence UI.

category

string

The category of the event, which is displayed in the 'Event type' column on the audit log in the Confluence UI.

sysAdmin

boolean

Indicates whether the event was actioned by a system administrator.

Default: false
affectedObject

AffectedObject

changedValues

Array<ChangedValue>

The values that were changed in the event.

associatedObjects

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.

Example

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
curl --request POST \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/audit' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
  "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>",
      "newValue": "<string>"
    }
  ],
  "associatedObjects": [
    {
      "name": "<string>",
      "objectType": "<string>"
    }
  ]
}'

Responses

Returned if the record is created in the audit log.

Content typeValue
application/json

AuditRecord

Export audit records

GET /wiki/rest/api/audit/export

Exports audit records as a CSV file or ZIP file.

Permissions required: 'Confluence Administrator' global permission.

Apps cannot access this REST resource.

Request

Query parameters
startDate

string

Filters the exported results to the records on or after the startDate. The startDate must be specified as a timestamp.

endDate

string

Filters the exported results to the records on or before the endDate. The endDate must be specified as a timestamp.

searchString

string

Filters the exported results to records that have string property values matching the searchString.

format

string

The format of the export file for the audit records.

Default: csv

Valid values: csv, zip

Example

1
2
3
curl --request GET \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/audit/export' \
  --header 'Accept: application/zip'

Responses

Returned if the requested export of the audit records is returned.

Content typeValue
application/zip

string

text/csv

string

Get retention period

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.

Apps cannot access this REST resource.

Request

There are no parameters for this request.

Example

1
2
3
curl --request GET \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/audit/retention' \
  --header 'Accept: application/json'

Responses

Returned if the requested retention period is returned.

Content typeValue
application/json

RetentionPeriod

Set retention period

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.

Apps cannot access this REST resource.

Request

Body parameters
number Required

integer

The number of units for the retention period.

Format: int32
units Required

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)

Example

1
2
3
4
5
6
7
8
curl --request PUT \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/audit/retention' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
  "number": 45,
  "units": "NANOS"
}'

Responses

Returned if the retention period is updated.

Content typeValue
application/json

RetentionPeriod

Get audit records for time period

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.

Apps cannot access this REST resource.

Request

Query parameters
number

integer

The number of units for the time period.

Default: 3, Format: int64
units

string

The unit of time that the time period is measured in.

Default: MONTHS

Valid values: NANOS, MICROS, MILLIS, SECONDS, MINUTES, HOURS, HALF_DAYS, DAYS, WEEKS, MONTHS ...(Show more)

searchString

string

Filters the results to records that have string property values matching the searchString.

start

integer

The starting index of the returned records.

Default: 0, Minimum: 0, Format: int32
limit

integer

The maximum number of records to return per page. Note, this may be restricted by fixed system limits.

Default: 1000, Minimum: 0, Format: int32

Example

1
2
3
curl --request GET \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/audit/since' \
  --header 'Accept: application/json'

Responses

Returned if the requested records are returned.

Content typeValue
application/json

AuditRecordArray

Rate this page: