Permit.io Audit Logs API

The Audit Logs API from Permit.io, for audit logs.

GitHub OpenAPI
Pull this API's OpenAPI, operations, scores and pricing into your own code or AI agent with a free APIs.io key — sign in with GitHub, Google or LinkedIn. No form to fill in; signing in shares your email address with us (Privacy).

Operations 2

GET /v2/pdps/{proj_id}/{env_id}/audit_logs List Audit Logs #
GET /v2/pdps/{proj_id}/{env_id}/audit_logs/{log_id} Get detailed audit log #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/permitio:permitio-audit-logs-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

permitio-audit-logs-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Permit.io Audit Logs API
  description: Authorization as a service
  version: 2.0.0
tags:
- name: Audit Logs
paths:
  /v2/pdps/{proj_id}/{env_id}/audit_logs:
    get:
      tags:
      - Audit Logs
      summary: List Audit Logs
      operationId: list_audit_logs
      security:
      - HTTPBearer: []
      parameters:
      - name: proj_id
        in: path
        required: true
        schema:
          type: string
          description: 'Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug").'
          title: Proj Id
        description: 'Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug").'
        example: my_project
      - name: env_id
        in: path
        required: true
        schema:
          type: string
          description: 'Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug").'
          title: Env Id
        description: 'Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug").'
        example: my_environment
      - name: pdp_id
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          description: Filter by pdp config id
          title: Pdp Id
        description: Filter by pdp config id
      - name: users
        in: query
        required: false
        schema:
          anyOf:
          - type: array
            items:
              type: string
              maxLength: 500
          - type: 'null'
          description: List of user keys or emails to filter by
          title: Users
        description: List of user keys or emails to filter by
      - name: decision
        in: query
        required: false
        schema:
          anyOf:
          - type: boolean
          - type: 'null'
          description: Filter by decision result
          title: Decision
        description: Filter by decision result
      - name: resources
        in: query
        required: false
        schema:
          anyOf:
          - type: array
            items:
              type: string
          - type: 'null'
          description: Filter by resources
          title: Resources
        description: Filter by resources
      - name: tenant
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Filter by tenant
          title: Tenant
        description: Filter by tenant
      - name: action
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Filter by action
          title: Action
        description: Filter by action
      - name: timestamp_from
        in: query
        required: false
        schema:
          anyOf:
          - type: integer
          - type: 'null'
          description: Filter by timestamp from
          title: Timestamp From
        description: Filter by timestamp from
      - name: timestamp_to
        in: query
        required: false
        schema:
          anyOf:
          - type: integer
          - type: 'null'
          description: Filter by timestamp to
          title: Timestamp To
        description: Filter by timestamp to
      - name: sort_by
        in: query
        required: false
        schema:
          $ref: '#/components/schemas/AuditLogSortKey'
          description: Sort by column
          default: timestamp
        description: Sort by column
      - name: query
        in: query
        required: false
        schema:
          $ref: '#/components/schemas/AuditLogQueryType'
          description: Filter by the type of query that generated the audit log.<br />'check' - permit/root, permit/check, permit/bulk<br />'get_user_permissions' - permit/user_permissions<br />'get_authorized_users' - permit/authorized_users, permit/authorized_users_new<br />'none' - All queries
          default: check
        description: Filter by the type of query that generated the audit log.<br />'check' - permit/root, permit/check, permit/bulk<br />'get_user_permissions' - permit/user_permissions<br />'get_authorized_users' - permit/authorized_users, permit/authorized_users_new<br />'none' - All queries
      - name: page
        in: query
        required: false
        schema:
          type: integer
          minimum: 1
          description: Page number of the results to fetch, starting at 1.
          default: 1
          title: Page
        description: Page number of the results to fetch, starting at 1.
      - name: per_page
        in: query
        required: false
        schema:
          type: integer
          maximum: 100
          minimum: 1
          description: The number of results per page (max 100).
          default: 30
          title: Per Page
        description: The number of results per page (max 100).
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LimitedPaginatedResult_AuditLogModel_'
        '400':
          description: Overreach of pagination limits
          content:
            application/json:
              example:
                id: e59461261fba4c88a41cc4fdb06d8c32
                title: The request was invalid
                error_code: PAGINATION_SIZE_OVERREACHED
                message: 'We are sorry for the inconvenience, Max number of results for this API is 10000. To obtain additional results readjust the query''s time window, or apply additional filters.. Please check the request and try again.

                  If the issue keeps happening, contact our support on Slack for further guidance.'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v2/pdps/{proj_id}/{env_id}/audit_logs/{log_id}:
    get:
      tags:
      - Audit Logs
      summary: Get detailed audit log
      operationId: get_detailed_audit_log
      security:
      - HTTPBearer: []
      parameters:
      - name: log_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          description: The unique id of the audit log
          title: Log Id
        description: The unique id of the audit log
        example: 42f0e113-219b-4bb9-ba90-e2c904761be1
      - name: proj_id
        in: path
        required: true
        schema:
          type: string
          description: 'Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug").'
          title: Proj Id
        description: 'Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug").'
        example: my_project
      - name: env_id
        in: path
        required: true
        schema:
          type: string
          description: 'Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug").'
          title: Env Id
        description: 'Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug").'
        example: my_environment
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DetailedAuditLogModel'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    AuditLogObjectsModel:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        organization_object:
          anyOf:
          - $ref: '#/components/schemas/OrganizationObj'
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Organization Object
        project_object:
          anyOf:
          - $ref: '#/components/schemas/ProjectObj'
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Project Object
        environment_object:
          anyOf:
          - $ref: '#/components/schemas/EnvironmentObj'
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Environment Object
        pdp_config_object:
          anyOf:
          - $ref: '#/components/schemas/PdpConfigObj'
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Pdp Config Object
        user_object:
          anyOf:
          - $ref: '#/components/schemas/UserObj'
          - type: 'null'
        action_object:
          anyOf:
          - $ref: '#/components/schemas/ActionObj'
          - type: 'null'
        resource_type_object:
          anyOf:
          - $ref: '#/components/schemas/ResourceTypeObj'
          - type: 'null'
        tenant_object:
          anyOf:
          - $ref: '#/components/schemas/TenantObj'
          - type: 'null'
        created_at:
          type: string
          format: date-time
          title: Created At
      additionalProperties: false
      type: object
      title: AuditLogObjectsModel
    OPAEngineDecisionLog:
      properties:
        engine:
          type: string
          title: Engine
          default: OPA
          enum:
          - OPA
        decision_id:
          type: string
          format: uuid
          title: Decision Id
        labels:
          $ref: '#/components/schemas/OPALabels'
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        path:
          type: string
          title: Path
        input:
          title: Input
        result:
          title: Result
        metrics:
          $ref: '#/components/schemas/OPAMetrics'
      additionalProperties: true
      type: object
      required:
      - decision_id
      - labels
      - timestamp
      - path
      - metrics
      title: OPAEngineDecisionLog
    AuditLogSortKey:
      type: string
      enum:
      - None
      - timestamp
      title: AuditLogSortKey
    ActionObj:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        key:
          type: string
          title: Key
        name:
          anyOf:
          - type: string
          - type: 'null'
          title: Name
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
      - id
      - key
      - created_at
      - updated_at
      title: ActionObj
    TenantObj:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        key:
          type: string
          title: Key
        name:
          anyOf:
          - type: string
          - type: 'null'
          title: Name
        attributes:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Attributes
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
      - id
      - key
      - created_at
      - updated_at
      title: TenantObj
    RelationshipTupleObj:
      properties:
        subject_str:
          type: string
          title: Subject Str
        relation_str:
          type: string
          title: Relation Str
        object_str:
          type: string
          title: Object Str
      type: object
      required:
      - subject_str
      - relation_str
      - object_str
      title: RelationshipTupleObj
    ProjectObj:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        key:
          type: string
          title: Key
        name:
          anyOf:
          - type: string
          - type: 'null'
          title: Name
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
      - id
      - key
      - created_at
      - updated_at
      title: ProjectObj
    ResourceAttributes:
      properties:
        type:
          $ref: '#/components/schemas/AttributeType'
        key:
          type: string
          title: Key
      type: object
      required:
      - type
      - key
      title: ResourceAttributes
    AuditLogModel:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        raw_data:
          anyOf:
          - $ref: '#/components/schemas/OPAEngineDecisionLog'
          - $ref: '#/components/schemas/AVPEngineDecisionLog'
          - $ref: '#/components/schemas/GenericEngineDecisionLog'
          - $ref: '#/components/schemas/DummyEngineModel'
          title: Raw Data
          hidden_from_schema: true
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        created_at:
          type: string
          format: date-time
          title: Created At
          hidden_from_schema: true
        query:
          anyOf:
          - type: string
          - type: 'null'
          title: Query
        user_key:
          anyOf:
          - type: string
          - type: 'null'
          title: User Key
        user_email:
          anyOf:
          - type: string
          - type: 'null'
          title: User Email
        user_name:
          anyOf:
          - type: string
          - type: 'null'
          title: User Name
        resource_type:
          anyOf:
          - type: string
          - type: 'null'
          title: Resource Type
        tenant:
          anyOf:
          - type: string
          - type: 'null'
          title: Tenant
        action:
          anyOf:
          - type: string
          - type: 'null'
          title: Action
        decision:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Decision
        reason:
          anyOf:
          - type: string
          - type: 'null'
          title: Reason
        org_id:
          type: string
          format: uuid
          title: Org Id
        project_id:
          type: string
          format: uuid
          title: Project Id
        env_id:
          type: string
          format: uuid
          title: Env Id
        pdp_config_id:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: Pdp Config Id
        input:
          title: Input
        result:
          title: Result
        context:
          title: Context
      additionalProperties: false
      type: object
      required:
      - id
      - timestamp
      - org_id
      - project_id
      - env_id
      title: AuditLogModel
    AVPEngineDecisionLog:
      properties:
        engine:
          type: string
          title: Engine
          default: AVP
          enum:
          - AVP
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        tenant:
          type: string
          title: Tenant
        process_time_ms:
          anyOf:
          - type: integer
          - type: 'null'
          title: Process Time Ms
        input:
          additionalProperties: true
          type: object
          title: Input
        result:
          additionalProperties: true
          type: object
          title: Result
      additionalProperties: true
      type: object
      required:
      - timestamp
      - tenant
      - input
      - result
      title: AVPEngineDecisionLog
    OPAMetrics:
      properties:
        timer_rego_input_parse_ns:
          anyOf:
          - type: integer
          - type: 'null'
          title: Timer Rego Input Parse Ns
        timer_rego_query_parse_ns:
          anyOf:
          - type: integer
          - type: 'null'
          title: Timer Rego Query Parse Ns
        timer_rego_query_compile_ns:
          anyOf:
          - type: integer
          - type: 'null'
          title: Timer Rego Query Compile Ns
        timer_rego_query_eval_ns:
          anyOf:
          - type: integer
          - type: 'null'
          title: Timer Rego Query Eval Ns
        timer_rego_module_parse_ns:
          anyOf:
          - type: integer
          - type: 'null'
          title: Timer Rego Module Parse Ns
        timer_rego_module_compile_ns:
          anyOf:
          - type: integer
          - type: 'null'
          title: Timer Rego Module Compile Ns
        timer_server_handler_ns:
          anyOf:
          - type: integer
          - type: 'null'
          title: Timer Server Handler Ns
      additionalProperties: true
      type: object
      title: OPAMetrics
    UserObj:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        key:
          type: string
          title: Key
        email:
          anyOf:
          - type: string
          - type: 'null'
          title: Email
        first_name:
          anyOf:
          - type: string
          - type: 'null'
          title: First Name
        last_name:
          anyOf:
          - type: string
          - type: 'null'
          title: Last Name
        attributes:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Attributes
        roles:
          anyOf:
          - items:
              $ref: '#/components/schemas/RelationshipTupleObj'
            type: array
          - type: 'null'
          title: Roles
          hidden_from_schema: true
        assigned_roles:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Assigned Roles
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
      - id
      - key
      - created_at
      - updated_at
      title: UserObj
    DetailedAuditLogModel:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        raw_data:
          anyOf:
          - $ref: '#/components/schemas/OPAEngineDecisionLog'
          - $ref: '#/components/schemas/AVPEngineDecisionLog'
          - $ref: '#/components/schemas/GenericEngineDecisionLog'
          - $ref: '#/components/schemas/DummyEngineModel'
          title: Raw Data
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        created_at:
          type: string
          format: date-time
          title: Created At
          hidden_from_schema: true
        query:
          anyOf:
          - type: string
          - type: 'null'
          title: Query
        user_key:
          anyOf:
          - type: string
          - type: 'null'
          title: User Key
        user_email:
          anyOf:
          - type: string
          - type: 'null'
          title: User Email
        user_name:
          anyOf:
          - type: string
          - type: 'null'
          title: User Name
        resource_type:
          anyOf:
          - type: string
          - type: 'null'
          title: Resource Type
        tenant:
          anyOf:
          - type: string
          - type: 'null'
          title: Tenant
        action:
          anyOf:
          - type: string
          - type: 'null'
          title: Action
        decision:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Decision
        reason:
          anyOf:
          - type: string
          - type: 'null'
          title: Reason
        org_id:
          type: string
          format: uuid
          title: Org Id
        project_id:
          type: string
          format: uuid
          title: Project Id
        env_id:
          type: string
          format: uuid
          title: Env Id
        pdp_config_id:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: Pdp Config Id
        input:
          title: Input
        result:
          title: Result
        context:
          title: Context
        objects:
          $ref: '#/components/schemas/AuditLogObjectsModel'
          default: {}
      type: object
      required:
      - id
      - raw_data
      - timestamp
      - org_id
      - project_id
      - env_id
      title: DetailedAuditLogModel
    OPALabels:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        version:
          type: string
          title: Version
      additionalProperties: true
      type: object
      required:
      - id
      - version
      title: OPALabels
    EnvironmentObj:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        key:
          type: string
          title: Key
        name:
          anyOf:
          - type: string
          - type: 'null'
          title: Name
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
      - id
      - key
      - created_at
      - updated_at
      title: EnvironmentObj
    DummyEngineModel:
      properties:
        engine:
          anyOf:
          - $ref: '#/components/schemas/Engine'
          - type: 'null'
        timestamp:
          type: string
          format: date-time
          title: Timestamp
      additionalProperties: true
      type: object
      title: DummyEngineModel
      description: dummy engine class in case we couldn't parse the log but we didn't want to drop it
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    Engine:
      type: string
      enum:
      - OPA
      - AVP
      - GENERIC
      title: Engine
    OrganizationObj:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        key:
          type: string
          title: Key
        name:
          anyOf:
          - type: string
          - type: 'null'
          title: Name
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
      - id
      - key
      - created_at
      - updated_at
      title: OrganizationObj
    GenericEngineDecisionLog:
      properties:
        engine:
          type: string
          title: Engine
          default: GENERIC
          enum:
          - GENERIC
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        decision:
          type: boolean
          title: Decision
        decision_id:
          type: string
          format: uuid
          title: Decision Id
        process_time_ms:
          type: integer
          title: Process Time Ms
          default: 0
        query:
          anyOf:
          - type: string
          - type: 'null'
          title: Query
        user_key:
          anyOf:
          - type: string
          - type: 'null'
          title: User Key
        user_email:
          anyOf:
          - type: string
          - type: 'null'
          title: User Email
        user_name:
          anyOf:
          - type: string
          - type: 'null'
          title: User Name
        action:
          anyOf:
          - type: string
          - type: 'null'
          title: Action
        resource_type:
          anyOf:
          - type: string
          - type: 'null'
          title: Resource Type
        tenant:
          anyOf:
          - type: string
          - type: 'null'
          title: Tenant
        input:
          title: Input
        result:
          title: Result
        context:
          title: Context
      additionalProperties: false
      type: object
      required:
      - timestamp
      - decision
      title: GenericEngineDecisionLog
      description: 'Generic decision log format for external or custom integrations.


        Accepts a flat JSON payload with explicit fields rather than requiring

        engine-specific nested structures. Unknown fields are rejected to prevent

        unbounded storage growth.'
    AuditLogQueryType:
      type: string
      enum:
      - check
      - get_user_permissions
      - get_authorized_users
      - none
      title: AuditLogQueryType
      description: Filter audit logs by the type of query that generated them.
    PdpConfigObj:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        name:
          type: string
          title: Name
      type: object
      required:
      - id
      - name
      title: PdpConfigObj
    ResourceTypeObj:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        key:
          type: string
          title: Key
        name:
          anyOf:
          - type: string
          - type: 'null'
          title: Name
        attributes:
          anyOf:
          - items:
              $ref: '#/components/schemas/ResourceAttributes'
            type: array
          - type: 'null'
          title: Attributes
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
      - id
      - key
      - created_at
      - updated_at
      title: ResourceTypeObj
    AttributeType:
      type: string
      enum:
      - bool
      - number
      - string
      - time
      - array
      - json
      - object
      - object_array
      title: AttributeType
      description: supported attribute primitives
    LimitedPaginatedResult_AuditLogModel_:
      properties:
        data:
          items:
            $ref: '#/components/schemas/AuditLogModel'
          type: array
          title: Data
          description: List of Audit Log Models
        total_count:
          type: integer
          minimum: 0.0
          title: Total Count
          description: The number of matching results, including those past the first 10,000.
        page_count:
          type: integer
          minimum: 0.0
          title: Page Count
          description: The number of pages you can fetch at the requested `per_page`. Only pages that end within the first 10,000 results can be fetched, so this can be less than `ceil(total_count / per_page)`. It is 0 when there are no results, and on a page past the last one.
          default: 0
        pagination_count:
          type: integer
          minimum: 0.0
          title: Pagination Count
          description: The number of matching results, capped at 10,000. Use `page_count` for the number of pages you can fetch.
      additionalProperties: false
      type: object
      required:
      - data
      - total_count
      - pagination_count
      title: LimitedPaginatedResult[AuditLogModel]
  securitySchemes:
    HTTPBearer:
      type: http
      description: 'Authorization header, we support the bearer authentication scheme (see: RFC 6750)'
      scheme: bearer
      bearerFormat: JWT