---
updatedAt: 2026-08-26T17:36:42.000Z
agentTools:
  projectIndex: https://docs.mesh.complyadvantage.com/llms.txt
---

# Get audit log for a role

Returns the audit log trail for a role.


You need the "View roles in account" permission to use this endpoint.

# OpenAPI definition

```json
{
  "components": {
    "schemas": {
      "audit_ActionedBy": {
        "properties": {
          "identifier": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "type": {
            "enum": [
              "SYSTEM",
              "USER"
            ],
            "type": "string"
          }
        },
        "required": [
          "type"
        ],
        "type": "object"
      },
      "audit_ProblemDetailErrorResponse": {
        "additionalProperties": true,
        "properties": {
          "detail": {
            "nullable": true,
            "type": "string"
          },
          "identifier": {
            "format": "uuid",
            "type": "string"
          },
          "instance": {
            "format": "uri",
            "nullable": true,
            "type": "string"
          },
          "status": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "timestamp": {
            "format": "date-time",
            "type": "string"
          },
          "title": {
            "nullable": true,
            "type": "string"
          },
          "type": {
            "format": "uri",
            "nullable": true,
            "type": "string"
          }
        },
        "required": [
          "identifier",
          "timestamp"
        ],
        "type": "object"
      },
      "audit_RoleArchivedDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/audit_RoleAuditLogDetail"
          }
        ],
        "title": "Role archived",
        "type": "object"
      },
      "audit_RoleAuditLog": {
        "properties": {
          "actioned_by": {
            "$ref": "#/components/schemas/audit_ActionedBy"
          },
          "detail": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/audit_RoleArchivedDetail"
              },
              {
                "$ref": "#/components/schemas/audit_RoleCreatedDetail"
              },
              {
                "$ref": "#/components/schemas/audit_RoleDescriptionUpdatedDetail"
              },
              {
                "$ref": "#/components/schemas/audit_RoleNameUpdatedDetail"
              },
              {
                "$ref": "#/components/schemas/audit_RolePermissionsUpdatedDetail"
              }
            ]
          },
          "grouping_key": {
            "nullable": true,
            "type": "string"
          },
          "identifier": {
            "format": "uuid",
            "type": "string"
          },
          "occurred_at": {
            "format": "date-time",
            "type": "string"
          },
          "type": {
            "enum": [
              "ROLE_CREATED",
              "ROLE_NAME_UPDATED",
              "ROLE_DESCRIPTION_UPDATED",
              "ROLE_PERMISSIONS_UPDATED",
              "ROLE_ARCHIVED"
            ],
            "type": "string"
          }
        },
        "required": [
          "actioned_by",
          "detail",
          "identifier",
          "occurred_at",
          "type"
        ],
        "type": "object"
      },
      "audit_RoleAuditLogDetail": {
        "type": "object"
      },
      "audit_RoleAuditLogsPage": {
        "properties": {
          "audit_logs": {
            "items": {
              "$ref": "#/components/schemas/audit_RoleAuditLog"
            },
            "type": "array"
          },
          "first": {
            "description": "The URL path to the first page.",
            "example": "/v1/resource?page_number=1",
            "type": "string"
          },
          "next": {
            "description": "The URL path to the next page.",
            "example": "/v1/resource?page_number=4",
            "nullable": true,
            "type": "string"
          },
          "prev": {
            "description": "The URL path to the previous page.",
            "example": "/v1/resource?page_number=2",
            "nullable": true,
            "type": "string"
          },
          "self": {
            "description": "The URL path to the current page.",
            "example": "/v1/resource?page_number=3",
            "type": "string"
          },
          "total_count": {
            "description": "Total number of items.",
            "example": 60,
            "format": "int64",
            "nullable": true,
            "type": "integer"
          }
        },
        "required": [
          "audit_logs",
          "first",
          "self"
        ],
        "type": "object"
      },
      "audit_RoleCreatedDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/audit_RoleAuditLogDetail"
          },
          {
            "properties": {
              "description": {
                "nullable": true,
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "type": "object"
          }
        ],
        "required": [
          "name"
        ],
        "title": "Role created",
        "type": "object"
      },
      "audit_RoleDescriptionUpdatedDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/audit_RoleAuditLogDetail"
          },
          {
            "properties": {
              "description": {
                "nullable": true,
                "type": "string"
              },
              "previous_description": {
                "nullable": true,
                "type": "string"
              }
            },
            "type": "object"
          }
        ],
        "title": "Role description updated",
        "type": "object"
      },
      "audit_RoleNameUpdatedDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/audit_RoleAuditLogDetail"
          },
          {
            "properties": {
              "name": {
                "type": "string"
              },
              "previous_name": {
                "type": "string"
              }
            },
            "type": "object"
          }
        ],
        "required": [
          "name",
          "previous_name"
        ],
        "title": "Role name updated",
        "type": "object"
      },
      "audit_RolePermissionsUpdatedDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/audit_RoleAuditLogDetail"
          },
          {
            "properties": {
              "added_permission_identifiers": {
                "items": {
                  "format": "int32",
                  "type": "integer"
                },
                "type": "array"
              },
              "removed_permission_identifiers": {
                "items": {
                  "format": "int32",
                  "type": "integer"
                },
                "type": "array"
              }
            },
            "type": "object"
          }
        ],
        "required": [
          "added_permission_identifiers",
          "removed_permission_identifiers"
        ],
        "title": "Role permissions updated",
        "type": "object"
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "description": "HTTP Bearer Token Authentication",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "title": "Mesh API",
    "version": "v2.0"
  },
  "openapi": "3.0.3",
  "paths": {
    "/v2/audit/roles/{role_identifier}": {
      "get": {
        "description": "Returns the audit log trail for a role.\n\n\nYou need the \"View roles in account\" permission to use this endpoint.",
        "operationId": "auditGetRoleAuditTrailV2",
        "parameters": [
          {
            "description": "The role identifier",
            "example": "018d0dd4-9b7c-7537-aaac-13f2f48877af",
            "in": "path",
            "name": "role_identifier",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "Page index",
            "example": 1,
            "in": "query",
            "name": "page_number",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "The size of the page to be returned",
            "example": 50,
            "in": "query",
            "name": "page_size",
            "schema": {
              "default": 50,
              "type": "integer"
            }
          },
          {
            "description": "Sorting criteria in the format (-)?[parameter]. Default sort order is ascending. for descending prefix the parameter with `-` Multiple sort criteria are supported.",
            "example": [
              "-occurred_at"
            ],
            "in": "query",
            "name": "sort",
            "schema": {
              "items": {
                "type": "string"
              },
              "type": "array"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/audit_RoleAuditLogsPage"
                }
              }
            },
            "description": "Returns the audit log trail for the role."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/audit_ProblemDetailErrorResponse"
                }
              }
            },
            "description": "Invalid role uuid identifier."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/audit_ProblemDetailErrorResponse"
                }
              }
            },
            "description": "Missing ACCOUNTS_ROLES_VIEW permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/audit_ProblemDetailErrorResponse"
                }
              }
            },
            "description": "No logs found for role."
          }
        },
        "summary": "Get audit log for a role",
        "tags": [
          "Audit"
        ]
      }
    }
  },
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "servers": [
    {
      "description": "ComplyAdvantage Mesh API",
      "url": "https://api.mesh.complyadvantage.com"
    }
  ],
  "tags": [
    {
      "name": "Audit"
    }
  ]
}
```