{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pricklymails-com/json-schema/pricklymails-com-api-key-response-schema.json",
  "title": "ApiKeyResponse",
  "description": "Metadata of an API key, returned when listing, reading, updating or revoking keys.",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/pricklymails-com-openapi.json#/components/schemas/ApiKeyResponse",
  "type": "object",
  "required": [
    "uuid",
    "prefix",
    "name",
    "environment",
    "scopes",
    "enabled_checks",
    "rate_limit",
    "is_active",
    "request_count",
    "created_at"
  ],
  "properties": {
    "created_at": {
      "type": "string",
      "description": "RFC 3339 creation timestamp."
    },
    "enabled_checks": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Verification checks enabled for the key."
    },
    "environment": {
      "type": "string",
      "description": "Environment of the key: `\"live\"` or `\"test\"`."
    },
    "expires_at": {
      "type": [
        "string",
        "null"
      ],
      "description": "RFC 3339 expiry timestamp, or `null` when the key does not expire."
    },
    "is_active": {
      "type": "boolean",
      "description": "Whether the key can currently authenticate (not revoked and not expired)."
    },
    "last_used_at": {
      "type": [
        "string",
        "null"
      ],
      "description": "RFC 3339 timestamp of the last request made with the key, or `null` when it was never used."
    },
    "name": {
      "type": "string",
      "description": "Display name of the key."
    },
    "prefix": {
      "type": "string",
      "description": "Visible prefix of the key (for example `pm_live_abc12345`)."
    },
    "rate_limit": {
      "$ref": "#/$defs/RateLimitDto",
      "description": "Request budget of the key."
    },
    "request_count": {
      "type": "integer",
      "format": "int64",
      "description": "Total number of requests made with the key.",
      "minimum": 0
    },
    "revoked_at": {
      "type": [
        "string",
        "null"
      ],
      "description": "RFC 3339 timestamp of the revocation, or `null` when the key is not revoked."
    },
    "scopes": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Scopes granted to the key."
    },
    "uuid": {
      "type": "string",
      "description": "Public UUID of the key."
    }
  },
  "$defs": {
    "RateLimitDto": {
      "type": "object",
      "description": "Request budget of an API key.",
      "required": [
        "per_minute"
      ],
      "properties": {
        "per_minute": {
          "type": "integer",
          "format": "int32",
          "description": "Maximum number of requests the key may make per minute.",
          "minimum": 0
        }
      }
    }
  }
}