{ "code": "insufficientPermissions", "message": "User is not authorized to read logs", "status": 403, "type": "error" }
Within the company my role is Member. Will I need to request for User Admin or Content Admin to be able to make the Audit log API request?
Best answer by Horea Porutiu
Just to confirm, the app MUST be installed by a Company Admin, then generate an access_token from the app (I'm assuming anyone with the access to the app will be able to request the access_token?) and I will be able to call the audit log endpoint?
Hi @Thyme that is correct. Since you are team owner, that permission is not enough. Someone which is company owner must install the app (and therefore generate the access token themselves).
Once they generate the access token, that token should be able to call the audit log endpoint successfully.
A Company Admin must install the app in order for you to generate an access token which will work to call the audit log endpoint. You can read the full steps needed to access audit logs on our docs.
To access audit logs:
Create an application and set it to use the read:audit-logs scope.
Install the application on any team in the organisation. Important: The installer must be a Company Admin in this organisation.
Use the access_token you received from the installation to retrieve audit logs via the audit logs endpoint.
❗️
Apps that use audit logs must be installed by the Company Admin.
In addition, the app I created was approved by a Company Admin. Within the app permission page, I selected
auditlogs:read
under "Enterprise plan only".
After submitted (Install app and get OAuth token), I received the access token. This access token doesn't allow me to call the audit log API.
Just to confirm, the app MUST be installed by a Company Admin, then generate an access_token from the app (I'm assuming anyone with the access to the app will be able to request the access_token?) and I will be able to call the audit log endpoint?
Just to confirm, the app MUST be installed by a Company Admin, then generate an access_token from the app (I'm assuming anyone with the access to the app will be able to request the access_token?) and I will be able to call the audit log endpoint?
Hi @Thyme that is correct. Since you are team owner, that permission is not enough. Someone which is company owner must install the app (and therefore generate the access token themselves).
Once they generate the access token, that token should be able to call the audit log endpoint successfully.