{
  "openapi": "3.1.0",
  "info": {
    "title": "FillVisuals Project API",
    "version": "1.1.0",
    "description": "Subscription keys and more for FillVisuals partner projects. Guide: https://fillvisuals.pro/developers. Scopes: keys:issue (issue keys), keys:read (read own keys and their status), keys:revoke (revoke own unused keys), guard:read (read FV Guard reports of players on own server), guard:events (send FVGuard plugin flags and kicks)."
  },
  "servers": [
    {
      "url": "https://euapi.fillvisuals.pro/api/project/v1"
    }
  ],
  "tags": [
    {
      "name": "account",
      "description": "Check the token, its scopes and your server address."
    },
    {
      "name": "keys",
      "description": "Issue keys without a quota, check whether they were redeemed and revoke unused ones. A player enters the key on the FillVisuals website, Account, Subscription."
    },
    {
      "name": "guard",
      "description": "FillVisuals client checks on your server: API-signed reports and FVGuard plugin flags. Available once FV Guard is enabled for the project."
    }
  ],
  "paths": {
    "/me": {
      "get": {
        "operationId": "me",
        "tags": [
          "account"
        ],
        "summary": "Check the connection",
        "description": "Returns the token owner, its scopes, the available key durations and whether the allowlist accepts your server address.\n\nThe only method that works from any address: use it to find the IP the API sees and add it to the allowlist.",
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          }
        ],
        "x-ip-allowlist": false,
        "parameters": [],
        "responses": {
          "200": {
            "description": "Project, token and request address.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request id, also in error bodies and the project log."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectMe"
                },
                "example": {
                  "project": {
                    "id": "cmh2k8a1c0000",
                    "name": "MyServer"
                  },
                  "token": {
                    "id": "cmh2k8q4e0002",
                    "name": "Магазин",
                    "prefix": "a1B2c3D4",
                    "scopes": [
                      "keys:issue",
                      "keys:read"
                    ]
                  },
                  "keys": {
                    "days": [
                      30,
                      90,
                      null
                    ]
                  },
                  "ip": "203.0.113.7",
                  "ipAllowed": true
                }
              }
            }
          },
          "401": {
            "description": "token_invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "project_disabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/keys": {
      "post": {
        "operationId": "keys-issue",
        "tags": [
          "keys"
        ],
        "summary": "Issue keys",
        "description": "Creates new subscription keys. There is no quota: issue as many as you need, up to 100 per request. Every issue is logged.\n\nSend an Idempotency-Key (an order number, for example): if the response is lost, retry with the same key and get the same codes, no new ones.",
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          }
        ],
        "x-scope": "keys:issue",
        "x-ip-allowlist": true,
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Retry key, up to 64 characters. Kept forever within the project.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [],
                "properties": {
                  "days": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 1,
                    "maximum": 3650,
                    "description": "A duration enabled for the project: days or null (lifetime). Omitted: the first one."
                  },
                  "count": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100,
                    "default": 1,
                    "description": "How many keys, 1 to 100."
                  },
                  "ref": {
                    "type": "string",
                    "maxLength": 128,
                    "description": "Your label: order number, buyer nickname. Keys and log entries can be filtered by it."
                  }
                }
              },
              "example": {
                "days": 30,
                "count": 1,
                "ref": "order-1042"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Issued keys. Codes are returned only here: store them on your side.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request id, also in error bodies and the project log."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectKeyIssued"
                },
                "example": {
                  "issueId": "cmh2kb7z10004",
                  "days": 30,
                  "ref": "order-1042",
                  "replayed": false,
                  "keys": [
                    {
                      "id": "cmh2k9x0f0001",
                      "code": "K7MQX-4RTZP-9WHNC-3VBJE",
                      "last4": "VBJE"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "validation_failed, duration_not_allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "token_invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "project_disabled, ip_not_allowed, scope_missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "idempotency_conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "keys-list",
        "tags": [
          "keys"
        ],
        "summary": "List keys",
        "description": "Project keys, newest first. No codes and no player nicknames.",
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          }
        ],
        "x-scope": "keys:read",
        "x-ip-allowlist": true,
        "parameters": [
          {
            "name": "ref",
            "in": "query",
            "required": false,
            "description": "Only keys with this ref.",
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only keys with this status.",
            "schema": {
              "type": "string",
              "enum": [
                "free",
                "redeemed",
                "revoked",
                "expired"
              ]
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page from 1.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, up to 100.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of keys.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request id, also in error bodies and the project log."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectKeyPage"
                },
                "example": {
                  "items": [
                    {
                      "id": "cmh2k9x0f0001",
                      "last4": "VBJE",
                      "days": 30,
                      "status": "redeemed",
                      "ref": "order-1042",
                      "issueId": "cmh2kb7z10004",
                      "createdAt": "2026-11-03T12:00:00.000Z",
                      "redeemedAt": "2026-11-03T12:04:31.000Z"
                    }
                  ],
                  "total": 1,
                  "page": 1,
                  "limit": 20
                }
              }
            }
          },
          "400": {
            "description": "validation_failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "token_invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "project_disabled, ip_not_allowed, scope_missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/keys/{id}": {
      "get": {
        "operationId": "keys-get",
        "tags": [
          "keys"
        ],
        "summary": "Get a key",
        "description": "The status of one project key: for example, whether the buyer redeemed it.",
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          }
        ],
        "x-scope": "keys:read",
        "x-ip-allowlist": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Key id from the issue response.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Project key without its code.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request id, also in error bodies and the project log."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectKey"
                },
                "example": {
                  "id": "cmh2k9x0f0001",
                  "last4": "VBJE",
                  "days": 30,
                  "status": "free",
                  "ref": "order-1042",
                  "issueId": "cmh2kb7z10004",
                  "createdAt": "2026-11-03T12:00:00.000Z",
                  "redeemedAt": null
                }
              }
            }
          },
          "401": {
            "description": "token_invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "project_disabled, ip_not_allowed, scope_missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "key_not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/keys/{id}/revoke": {
      "post": {
        "operationId": "keys-revoke",
        "tags": [
          "keys"
        ],
        "summary": "Revoke a key",
        "description": "Disables an unused project key, for example after a refund. A redeemed key cannot be revoked.",
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          }
        ],
        "x-scope": "keys:revoke",
        "x-ip-allowlist": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Key id from the issue response.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Project key without its code.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request id, also in error bodies and the project log."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectKey"
                },
                "example": {
                  "id": "cmh2k9x0f0001",
                  "last4": "VBJE",
                  "days": 30,
                  "status": "revoked",
                  "ref": "order-1042",
                  "issueId": "cmh2kb7z10004",
                  "createdAt": "2026-11-03T12:00:00.000Z",
                  "redeemedAt": null
                }
              }
            }
          },
          "401": {
            "description": "token_invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "project_disabled, ip_not_allowed, scope_missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "key_not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "key_used",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/guard/players/{name}": {
      "get": {
        "operationId": "guard-player",
        "tags": [
          "guard"
        ],
        "summary": "Player",
        "description": "The latest signed FillVisuals client report of this player on your server and the latest plugin flags.",
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          }
        ],
        "x-scope": "guard:read",
        "x-ip-allowlist": true,
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "Nickname, case-insensitive.",
            "schema": {
              "type": "string",
              "maxLength": 16
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Player on your server.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request id, also in error bodies and the project log."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GuardPlayer"
                },
                "example": {
                  "name": "Steve",
                  "uuid": "8667ba71-b85a-4004-af54-457a9734eed7",
                  "last": {
                    "id": "cmh9a1b2c0001",
                    "name": "Steve",
                    "uuid": "8667ba71-b85a-4004-af54-457a9734eed7",
                    "verdict": "tampered",
                    "codes": [
                      {
                        "code": "combat.reach",
                        "severity": "high",
                        "text": "Дальность удара больше ванильной"
                      }
                    ],
                    "version": "0.1.80",
                    "createdAt": "2026-11-12T12:00:00.000Z"
                  },
                  "reports30d": {
                    "total": 14,
                    "flagged": 1
                  },
                  "events": [
                    {
                      "code": "server.reach",
                      "detail": "3.92 при 3.51",
                      "createdAt": "2026-11-12T12:01:10.000Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "token_invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "project_disabled, ip_not_allowed, scope_missing, guard_not_enabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "player_not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/guard/reports": {
      "get": {
        "operationId": "guard-reports",
        "tags": [
          "guard"
        ],
        "summary": "Reports",
        "description": "Client reports on your server, newest first.",
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          }
        ],
        "x-scope": "guard:read",
        "x-ip-allowlist": true,
        "parameters": [
          {
            "name": "verdict",
            "in": "query",
            "required": false,
            "description": "Only this verdict.",
            "schema": {
              "type": "string",
              "enum": [
                "clean",
                "suspicious",
                "tampered"
              ]
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page from 1.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, up to 100.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Report page.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request id, also in error bodies and the project log."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GuardReportPage"
                },
                "example": {
                  "items": [],
                  "total": 0,
                  "page": 1,
                  "limit": 20
                }
              }
            }
          },
          "400": {
            "description": "validation_failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "token_invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "project_disabled, ip_not_allowed, scope_missing, guard_not_enabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/guard/events": {
      "post": {
        "operationId": "guard-events",
        "tags": [
          "guard"
        ],
        "summary": "Plugin flags",
        "description": "The FVGuard plugin sends server flags and kicks here itself when api-token is set in config.yml. Up to 50 per request.",
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          }
        ],
        "x-scope": "guard:events",
        "x-ip-allowlist": true,
        "parameters": [],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "events"
                ],
                "properties": {
                  "events": {
                    "type": "array",
                    "description": "name, uuid, code, detail."
                  }
                }
              },
              "example": {
                "events": [
                  {
                    "name": "Steve",
                    "uuid": "8667ba71-b85a-4004-af54-457a9734eed7",
                    "code": "server.reach",
                    "detail": "3.92 при 3.51"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "How many flags were accepted.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request id, also in error bodies and the project log."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GuardEventsAccepted"
                },
                "example": {
                  "accepted": 1
                }
              }
            }
          },
          "400": {
            "description": "validation_failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "token_invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "project_disabled, ip_not_allowed, scope_missing, guard_not_enabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "Project token fvp_..."
      },
      "apiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Api-Key"
      }
    },
    "schemas": {
      "GuardCode": {
        "type": "object",
        "description": "Client finding.",
        "required": [
          "code",
          "severity",
          "text"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "Code: combat.reach, inject.dll and others. A code never changes meaning."
          },
          "severity": {
            "type": "string",
            "enum": [
              "info",
              "medium",
              "high"
            ],
            "description": "Severity: high makes the verdict tampered."
          },
          "text": {
            "type": "string",
            "description": "Description in Russian."
          }
        }
      },
      "GuardReport": {
        "type": "object",
        "description": "API-signed client report.",
        "required": [
          "id",
          "name",
          "uuid",
          "verdict",
          "codes",
          "version",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Report id."
          },
          "name": {
            "type": "string",
            "description": "Nickname."
          },
          "uuid": {
            "type": "string",
            "description": "Connection UUID."
          },
          "verdict": {
            "type": "string",
            "enum": [
              "clean",
              "suspicious",
              "tampered"
            ],
            "description": "Verdict."
          },
          "codes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GuardCode"
            },
            "description": "Findings."
          },
          "version": {
            "type": [
              "string",
              "null"
            ],
            "description": "Client version."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "Signed at."
          }
        }
      },
      "GuardEvent": {
        "type": "object",
        "description": "Plugin flag or kick.",
        "required": [
          "code",
          "detail",
          "createdAt"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "server.reach, server.angle, server.cps or kick.*"
          },
          "detail": {
            "type": [
              "string",
              "null"
            ],
            "description": "Details."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "When."
          }
        }
      },
      "GuardPlayer": {
        "type": "object",
        "description": "Player on your server.",
        "required": [
          "name",
          "uuid",
          "last",
          "reports30d",
          "events"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Nickname."
          },
          "uuid": {
            "type": [
              "string",
              "null"
            ],
            "description": "Last connection UUID."
          },
          "last": {
            "$ref": "#/components/schemas/GuardReport",
            "description": "Last report or null."
          },
          "reports30d": {
            "type": "object",
            "description": "total and flagged over 30 days."
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GuardEvent"
            },
            "description": "Last 20 plugin flags."
          }
        }
      },
      "GuardReportPage": {
        "type": "object",
        "description": "Report page.",
        "required": [
          "items",
          "total",
          "page",
          "limit"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GuardReport"
            },
            "description": "Reports, newest first."
          },
          "total": {
            "type": "integer",
            "description": "Total."
          },
          "page": {
            "type": "integer",
            "description": "Page."
          },
          "limit": {
            "type": "integer",
            "description": "Page size."
          }
        }
      },
      "GuardEventsAccepted": {
        "type": "object",
        "description": "How many flags were accepted.",
        "required": [
          "accepted"
        ],
        "properties": {
          "accepted": {
            "type": "integer",
            "description": "Accepted."
          }
        }
      },
      "ProjectMe": {
        "type": "object",
        "description": "Project, token and request address.",
        "required": [
          "project",
          "token",
          "keys",
          "ip",
          "ipAllowed"
        ],
        "properties": {
          "project": {
            "$ref": "#/components/schemas/ProjectRef",
            "description": "Token project."
          },
          "token": {
            "$ref": "#/components/schemas/TokenRef",
            "description": "The token and its scopes."
          },
          "keys": {
            "$ref": "#/components/schemas/KeySettings",
            "description": "Project key settings."
          },
          "ip": {
            "type": [
              "string",
              "null"
            ],
            "description": "The request address as the API sees it."
          },
          "ipAllowed": {
            "type": "boolean",
            "description": "Whether the allowlist accepts this address."
          }
        }
      },
      "ProjectRef": {
        "type": "object",
        "description": "Project.",
        "required": [
          "id",
          "name"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Project id."
          },
          "name": {
            "type": "string",
            "description": "Name."
          }
        }
      },
      "TokenRef": {
        "type": "object",
        "description": "Token.",
        "required": [
          "id",
          "name",
          "prefix",
          "scopes"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Token id."
          },
          "name": {
            "type": "string",
            "description": "Token name."
          },
          "prefix": {
            "type": "string",
            "description": "First 8 characters after fvp_."
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "keys:issue",
                "keys:read",
                "keys:revoke"
              ]
            },
            "description": "Token scopes."
          }
        }
      },
      "KeySettings": {
        "type": "object",
        "description": "Project key settings.",
        "required": [
          "days"
        ],
        "properties": {
          "days": {
            "type": "array",
            "items": {
              "type": [
                "integer",
                "null"
              ],
              "minimum": 1,
              "maximum": 3650
            },
            "description": "Allowed durations: days or null (lifetime). The first one is the default."
          }
        }
      },
      "ProjectKeyIssued": {
        "type": "object",
        "description": "Issued keys. Codes are returned only here: store them on your side.",
        "required": [
          "issueId",
          "days",
          "ref",
          "replayed",
          "keys"
        ],
        "properties": {
          "issueId": {
            "type": "string",
            "description": "Issue id: one log entry."
          },
          "days": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "maximum": 3650,
            "description": "Days each key grants; null: lifetime."
          },
          "ref": {
            "type": [
              "string",
              "null"
            ],
            "description": "The ref from the request."
          },
          "replayed": {
            "type": "boolean",
            "description": "true: an Idempotency-Key replay, no new keys were issued."
          },
          "keys": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IssuedKey"
            },
            "description": "Keys."
          }
        }
      },
      "IssuedKey": {
        "type": "object",
        "description": "Key with its code.",
        "required": [
          "id",
          "code",
          "last4"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Key id: for GET /keys/{id} and revoke."
          },
          "code": {
            "type": "string",
            "description": "The key itself, XXXXX-XXXXX-XXXXX-XXXXX."
          },
          "last4": {
            "type": "string",
            "description": "Last 4 characters: for players or support."
          }
        }
      },
      "ProjectKey": {
        "type": "object",
        "description": "Project key without its code.",
        "required": [
          "id",
          "last4",
          "days",
          "status",
          "ref",
          "issueId",
          "createdAt",
          "redeemedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Key id."
          },
          "last4": {
            "type": "string",
            "description": "Last 4 characters."
          },
          "days": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "maximum": 3650,
            "description": "Days; null: lifetime."
          },
          "status": {
            "type": "string",
            "enum": [
              "free",
              "redeemed",
              "revoked",
              "expired"
            ],
            "description": "free, redeemed, revoked or expired."
          },
          "ref": {
            "type": [
              "string",
              "null"
            ],
            "description": "Issue ref."
          },
          "issueId": {
            "type": [
              "string",
              "null"
            ],
            "description": "The issue the key came from."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "Issued at."
          },
          "redeemedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Redeemed at; null: not yet."
          }
        }
      },
      "ProjectKeyPage": {
        "type": "object",
        "description": "A page of keys.",
        "required": [
          "items",
          "total",
          "page",
          "limit"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProjectKey"
            },
            "description": "Keys, newest first."
          },
          "total": {
            "type": "integer",
            "description": "Total matching."
          },
          "page": {
            "type": "integer",
            "description": "Page number from 1."
          },
          "limit": {
            "type": "integer",
            "description": "Page size."
          }
        }
      },
      "Error": {
        "type": "object",
        "description": "An error. Branch on code, message may change.",
        "required": [
          "statusCode",
          "code",
          "message",
          "requestId"
        ],
        "properties": {
          "statusCode": {
            "type": "integer",
            "description": "HTTP status."
          },
          "code": {
            "type": "string",
            "enum": [
              "token_invalid",
              "project_disabled",
              "ip_not_allowed",
              "scope_missing",
              "validation_failed",
              "duration_not_allowed",
              "idempotency_conflict",
              "key_not_found",
              "key_used",
              "guard_not_enabled",
              "player_not_found",
              "rate_limited",
              "internal_error"
            ],
            "description": "Error code"
          },
          "message": {
            "type": "string",
            "description": "Human readable text, in Russian."
          },
          "requestId": {
            "type": "string",
            "description": "Same as X-Request-Id: quote it to support."
          }
        }
      }
    }
  }
}