{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/medianfi-com/json-schema/medianfi-com-service-api-key-list-response-schema.json",
  "title": "ServiceApiKeyListResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/medianfi-com-admin-api-openapi.yml#/components/schemas/ServiceApiKeyListResponse",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "success",
    "data"
  ],
  "properties": {
    "success": {
      "type": "boolean",
      "const": true
    },
    "data": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "items",
        "nextCursor",
        "hasMore"
      ],
      "properties": {
        "items": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ServiceApiKey"
          }
        },
        "nextCursor": {
          "type": [
            "string",
            "null"
          ]
        },
        "hasMore": {
          "type": "boolean"
        }
      }
    }
  },
  "$defs": {
    "ServiceApiKey": {
      "type": "object",
      "required": [
        "id",
        "companyId",
        "name",
        "prefix",
        "scopes",
        "createdByUserId",
        "lastUsedAt",
        "expiresAt",
        "revokedAt",
        "createdAt"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "companyId": {
          "type": "string",
          "format": "uuid",
          "description": "Configured service-key home company; not caller-selectable."
        },
        "name": {
          "type": "string"
        },
        "prefix": {
          "type": "string",
          "description": "Non-secret lookup prefix; never the complete credential."
        },
        "scopes": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Newly issued service keys receive exactly accountant:*."
        },
        "createdByUserId": {
          "type": "string",
          "format": "uuid",
          "description": "Configured non-human service-principal user id."
        },
        "issuedByUserId": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid",
          "description": "Human allowlisted super-admin who issued the key."
        },
        "lastUsedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "expiresAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "revokedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "revokedByUserId": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "usageCountLast24h": {
          "type": "integer",
          "minimum": 0
        },
        "usageCountLast7d": {
          "type": "integer",
          "minimum": 0
        }
      }
    }
  }
}