How to get the space permission changes through CQL (or by any other event if possible)

Hi All,

I would like to know if there are any modifications to the space permissions via the REST API, but can’t seem to find any.

Is there a way to know the changes (CQL’s lastModified is not returning any results here)?

Thanks
Ravi

Hi @Ravi90,

You won’t find updates to Space permissions via CQL because they aren’t content updates.

You can use the Audit API

I just did a test with updates from 1/Feb/2022

curl --silent --user <email>:<token> --request GET --url 'https://<sitename>/wiki/rest/api/audit?startDate=1643634000&limit=2

and (with some editing) I got the 2 changes I made yesterday when we talked about Confluence REST API to remove anonymous access to a space/page

{
  "results": [
    {
      "author": {
        "type": "user",
        "displayName": "James Richards",
        "operations": null,
        "isExternalCollaborator": false,
        "username": "<hidden>",
        "userKey": "<hidden>",
        "accountId": "<hidden>",
        "accountType": "",
        "publicName": "Unknown user",
        "externalCollaborator": false
      },
      "remoteAddress": "",
      "creationDate": 1643692779333,
      "summary": "Space permission removed",
      "description": "",
      "category": "Permissions",
      "sysAdmin": false,
      "superAdmin": false,
      "affectedObject": {
        "name": "anonymous",
        "objectType": "User"
      },
      "changedValues": [
        {
          "name": "Type",
          "oldValue": "VIEWSPACE",
          "newValue": "",
          "hiddenOldValue": "",
          "hiddenNewValue": ""
        }
      ],
      "associatedObjects": [
        {
          "name": "MySpace",
          "objectType": "Space"
        }
      ]
    },
   {
      "author": {
        "type": "user",
        "displayName": "James Richards",
        "operations": null,
        "isExternalCollaborator": false,
        "username": "<hidden>",
        "userKey": "<hidden>",
        "accountId": "<hidden>",
        "accountType": "",
        "publicName": "Unknown user",
        "externalCollaborator": false
      },
      "remoteAddress": "",
      "creationDate": 1643692129108,
      "summary": "Space permission added",
      "description": "",
      "category": "Permissions",
      "sysAdmin": false,
      "superAdmin": false,
      "affectedObject": {
        "name": "anonymous",
        "objectType": "User"
      },
      "changedValues": [
        {
          "name": "Type",
          "oldValue": "",
          "newValue": "VIEWSPACE",
          "hiddenOldValue": "",
          "hiddenNewValue": ""
        },
        {
          "name": "Space",
          "oldValue": "",
          "newValue": "KEY",
          "hiddenOldValue": "",
          "hiddenNewValue": ""
        }
      ],
      "associatedObjects": [
        {
          "name": "MySpace",
          "objectType": "Space"
        }
      ]
    }
  ]

Hope this helps.

Regards,
James.

Thanks again for the prompt response @jrichards. I also guess that we cannot access this API with oAuth. Am I correct?

Thanks
Ravi

Hi @Ravi90,

Looking at the documentation, you are correct. Connect apps and OAuth2 requests won’t connect.

Regards,
James.

Thanks for confirming @jrichards