Submit a ticket My Tickets
Login  Sign up

How to use API for “View Audit Logs” via Swagger?

This document provides information about the “View audit logs” section and its use, particularly via the Swagger tool.

“View Audit logs” gives an opportunity to get audit log details of the current user. 

In order to start getting information the API feature should be active on the user account and a token should be generated. 

Steps to generate a token in an account that already has an active API feature 

1. Navigate to the “API settings” section

2. Click on the “click here” link to navigate to the “Personal Access Tokens” section

3. Click on the “Generate new token” button

4. Input token name and check permissions


5. Click on the “Save token” button

The Generated token must be used for further authorization in the Swagger tool. It is possible to edit, revoke and delete generated tokens. 


How to use the API for the “View Audit logs” section? 


  • API feature is active for the account
  • Generated token
  • Checked permission for the generated token - user: audit logs
  • Bearer token for Authorization

Steps to authorize a user to further use the API for “View Audit logs” via Swagger

1. Navigate to the “API settings” section

2. Click on the “API Documentation” link to navigate to the Swagger section


3. Click on the “Authorize” button 

4. Type Bearer on the opened modal and leave a space after it (see screenshot below)

5. Copy the generated token from the “Personal Access Tokens” section (API settings >” click here link”> Personal Access Tokens section>Copy token) 

6. Paste the copied token to the opened modal after Bearer 

7. Click on the “Authorize” button

8. Click on the “Close” button

9. After successful authorization, the button will look like in the screenshot below


10. Now the user is successfully authorized and can start using the API via the Swagger tool!

Steps for using API for “View Audit logs” via Swagger

PowerDMARC API documentation provides API instructions for different sections of the platform. 


  • Generated token
  •  Authorized user (see steps above) on the Swagger 

Steps to start using API for “View Audit logs” via Swagger

1. Enter “View audit logs” in the search field


2. Expand information 

3. Click on the “Try it out” button


4. View Audit logs can be filtered only by date (from/to, the date format is year/month/day), except for that the page number and number of items per page can be specified in parameters 

5. Specify the number of items per page, Page number, and filter by date (see screenshot below)


6. Click on the “Execute” button

7. Verify request (Curl, Request URL) and response information (Status code, Response body, Response headers)

Possible response status codes:

  • Status code 200 in response means the request has been successfully handled and response information is available for the user. 
  • 401 means that the user is not authorized (token not provided, or it is invalid)
  • 403 means that a user has no permission to get the requested resource (permissions are not specified while generating a new token)

Hope this knowledge session was useful for you. To enjoy a safer email experience start authenticating your emails with DMARC today!

PowerDMARC is the author of this solution article.

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.