/me/api-keys/audit - List current user's API key audit trail

Add MCP server to your AI tool

Allow AI tools and LLMs to interact with the API documentation portal through MCP.

MCP server URL

https://api.my.nethesis.it/mcp

Standard setup for AI tools providing an mcp.json file

mcp.json
{
  "my.nethesis.it MCP server": {
    "url": "https://api.my.nethesis.it/mcp"
  }
}

Close
GET /me/api-keys/audit

Audit trail for the current user's API keys: lifecycle events (created, revoked) and security failures (use of a revoked/expired key, suspended owner, wrong secret, rate limiting). Successful per-request use is not recorded here. Interactive-session only — cannot be called with an API key.

Query parameters

  • page integer

    Default value is 1.

  • page_size integer

    Default value is 20.

  • event string

    Filter by event type

    Values are created, revoked, auth_failed, or rate_limited.

  • api_key_id string

    Filter by a specific key id

Responses

  • 200 application/json

    Audit trail retrieved successfully

    Hide response attributes Show response attributes object
    • code integer
    • message string
    • data object
      Hide data attributes Show data attributes object
      • audit array[object]

        One API key audit event (lifecycle or security failure).

        Hide audit attributes Show audit attributes object

        One API key audit event (lifecycle or security failure).

        • id string
        • api_key_id string | null
        • user_id string | null
        • organization_id string | null
        • event string

          Values are created, revoked, auth_failed, or rate_limited.

        • reason string | null

          Present for auth_failed events

          Values are revoked, expired, user_inactive, invalid_secret, or null.

        • key_name string | null
        • key_mode string | null
        • ip string | null
        • method string | null
        • path string | null
        • created_at string(date-time)
      • pagination object
        Hide pagination attributes Show pagination attributes object
        • page integer

          Current page number

          Minimum value is 1.

        • page_size integer

          Number of items per page

          Minimum value is 1, maximum value is 200.

        • total_count integer

          Total number of items

          Minimum value is 0.

        • total_pages integer

          Total number of pages

          Minimum value is 0.

        • has_next boolean

          Whether there is a next page

        • has_prev boolean

          Whether there is a previous page

        • next_page integer | null

          Next page number if available

        • prev_page integer | null

          Previous page number if available

        • sort_by string | null

          Field used for sorting

        • sort_direction string | null

          Sort direction

          Values are asc or desc.

  • 401 application/json

    Unauthorized - invalid or missing token

    Hide response attributes Show response attributes object
    • code integer
    • message string
    • data object | null
  • 403 application/json

    Forbidden - insufficient permissions

    Hide response attributes Show response attributes object
    • code integer
    • message string
    • data object | null
  • 500 application/json

    Internal server error

    Hide response attributes Show response attributes object
    • code integer
    • message string
    • data object | null
GET /me/api-keys/audit
curl \
 --request GET 'https://api.your-domain.com/api/me/api-keys/audit' \
 --header "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
  "code": 200,
  "message": "api key audit retrieved successfully",
  "data": {
    "audit": [
      {
        "id": "string",
        "api_key_id": "string",
        "user_id": "string",
        "organization_id": "string",
        "event": "created",
        "reason": "revoked",
        "key_name": "string",
        "key_mode": "string",
        "ip": "string",
        "method": "string",
        "path": "string",
        "created_at": "2026-05-04T09:42:00Z"
      }
    ],
    "pagination": {
      "page": 1,
      "page_size": 20,
      "total_count": 156,
      "total_pages": 8,
      "has_next": true,
      "has_prev": false,
      "next_page": 2,
      "prev_page": 42,
      "sort_by": "name",
      "sort_direction": "asc"
    }
  }
}
Response examples (401)
{
  "code": 401,
  "message": "invalid token",
  "data": {}
}
Response examples (403)
{
  "code": 403,
  "message": "insufficient permissions",
  "data": {}
}
Response examples (500)
{
  "code": 500,
  "message": "internal server error",
  "data": {}
}