{
  "openapi": "3.1.0",
  "info": {
    "title": "台灣工具人 · Implemented REST API",
    "version": "0.1.0",
    "description": "Current implemented subset only. Extended planned contract is docs/openapi.yaml. MCP is deployed as a separate sidecar."
  },
  "servers": [
    {
      "url": "/"
    }
  ],
  "paths": {
    "/api/v1/projects": {
      "get": {
        "tags": [
          "Projects"
        ],
        "operationId": "projects_list",
        "summary": "List published and visible projects",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "parameters": [
          {
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "kind",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "sort",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/api/v1/search": {
      "get": {
        "tags": [
          "Search"
        ],
        "operationId": "search_projects",
        "summary": "Alias of project search",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "parameters": [
          {
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/v1/projects/{id}": {
      "get": {
        "tags": [
          "Projects"
        ],
        "operationId": "projects_get",
        "summary": "Read published project metadata",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Project"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/v1/tags": {
      "get": {
        "tags": [
          "Tags"
        ],
        "operationId": "tags_list",
        "summary": "List all discoverable tags",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        }
      }
    },
    "/api/v1/rankings/{period}": {
      "get": {
        "tags": [
          "Rankings"
        ],
        "operationId": "rankings_list",
        "summary": "Rank projects by unique votes and reviews",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "period",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/v1/auth/register": {
      "post": {
        "tags": [
          "Auth"
        ],
        "operationId": "auth_register",
        "summary": "Create local account",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        }
      }
    },
    "/api/v1/auth/login": {
      "post": {
        "tags": [
          "Auth"
        ],
        "operationId": "auth_login",
        "summary": "Log in with local account",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        }
      }
    },
    "/api/v1/auth/logout": {
      "post": {
        "tags": [
          "Auth"
        ],
        "operationId": "auth_logout",
        "summary": "Log out and revoke current session",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "cookieSession": []
          }
        ]
      }
    },
    "/api/v1/me": {
      "get": {
        "tags": [
          "Auth"
        ],
        "operationId": "auth_current",
        "summary": "Current user or null",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        }
      }
    },
    "/api/v1/suggestions": {
      "post": {
        "tags": [
          "Suggestions"
        ],
        "operationId": "suggestions_create",
        "summary": "Submit an unauthenticated candidate URL for moderation",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        }
      }
    },
    "/api/v1/submissions": {
      "post": {
        "tags": [
          "Submissions"
        ],
        "operationId": "submissions_create",
        "summary": "Submit a project for review; returns 202, not publication",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubmissionCreate"
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "cookieSession": []
          }
        ]
      }
    },
    "/api/v1/submissions/{id}": {
      "get": {
        "tags": [
          "Submissions"
        ],
        "operationId": "submissions_get",
        "summary": "Check own submission status",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerToken": []
          },
          {
            "cookieSession": []
          }
        ]
      }
    },
    "/api/v1/claims": {
      "post": {
        "tags": [
          "Claims"
        ],
        "operationId": "claims_create",
        "summary": "Request project management claim; does not immediately grant ownership",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClaimCreate"
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "cookieSession": []
          }
        ]
      }
    },
    "/api/v1/claims/{id}": {
      "get": {
        "tags": [
          "Claims"
        ],
        "operationId": "claims_get",
        "summary": "Check own claim status",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerToken": []
          },
          {
            "cookieSession": []
          }
        ]
      }
    },
    "/api/v1/me/projects": {
      "get": {
        "tags": [
          "Projects"
        ],
        "operationId": "projects_managed",
        "summary": "List projects under current ACL",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "cookieSession": []
          }
        ]
      }
    },
    "/api/v1/me/projects/{id}": {
      "patch": {
        "tags": [
          "Projects"
        ],
        "operationId": "projects_revision",
        "summary": "Request protected project summary/description revision",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerToken": []
          },
          {
            "cookieSession": []
          }
        ]
      }
    },
    "/api/v1/projects/{id}/reviews": {
      "get": {
        "tags": [
          "Reviews"
        ],
        "operationId": "reviews_list",
        "summary": "List visible user reviews",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "post": {
        "tags": [
          "Reviews"
        ],
        "operationId": "reviews_upsert",
        "summary": "Write or replace own review",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReviewCreate"
              }
            }
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerToken": []
          },
          {
            "cookieSession": []
          }
        ]
      }
    },
    "/api/v1/projects/{id}/votes": {
      "post": {
        "tags": [
          "Votes"
        ],
        "operationId": "votes_toggle",
        "summary": "Toggle own unique recommendation vote",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerToken": []
          },
          {
            "cookieSession": []
          }
        ]
      }
    },
    "/api/v1/agent/tokens": {
      "get": {
        "tags": [
          "Agent"
        ],
        "operationId": "agent_tokens_list",
        "summary": "List own API tokens, without secrets",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "cookieSession": []
          }
        ]
      },
      "post": {
        "tags": [
          "Agent"
        ],
        "operationId": "agent_tokens_create",
        "summary": "Create scoped bearer token (secret only shown once)",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TokenCreate"
              }
            }
          }
        },
        "security": [
          {
            "cookieSession": []
          }
        ]
      }
    },
    "/api/v1/agent/tokens/{id}": {
      "delete": {
        "tags": [
          "Agent"
        ],
        "operationId": "agent_tokens_revoke",
        "summary": "Revoke API token",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "cookieSession": []
          }
        ]
      }
    },
    "/api/v1/admin/submissions/{id}": {
      "post": {
        "tags": [
          "Admin"
        ],
        "operationId": "admin_submission_decide",
        "summary": "Approve, request changes or reject",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "cookieSession": []
          }
        ]
      },
      "patch": {
        "tags": [
          "Admin"
        ],
        "operationId": "admin_submission_edit",
        "summary": "Correct candidate metadata before approval",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "cookieSession": []
          }
        ]
      }
    },
    "/api/v1/admin/claims/{id}": {
      "post": {
        "tags": [
          "Admin"
        ],
        "operationId": "admin_claim_decide",
        "summary": "Verify evidence and decide claim",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "cookieSession": []
          }
        ]
      }
    },
    "/api/v1/admin/revisions": {
      "get": {
        "tags": [
          "Admin"
        ],
        "operationId": "admin_revisions_list",
        "summary": "List pending project changes",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "cookieSession": []
          }
        ]
      },
      "post": {
        "tags": [
          "Admin"
        ],
        "operationId": "admin_revisions_decide",
        "summary": "Approve or reject proposed project content changes",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "cookieSession": []
          }
        ]
      }
    },
    "/api/v1/admin/crawler-sources": {
      "get": {
        "tags": [
          "Admin"
        ],
        "operationId": "admin_crawler_list",
        "summary": "List registered crawler sources",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "cookieSession": []
          }
        ]
      },
      "patch": {
        "tags": [
          "Admin"
        ],
        "operationId": "admin_crawler_toggle",
        "summary": "Enable or disable GitHub discovery source",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "cookieSession": []
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerToken": {
        "type": "http",
        "scheme": "bearer",
        "description": "toolman_ API Token"
      },
      "cookieSession": {
        "type": "apiKey",
        "in": "cookie",
        "name": "toolman_session",
        "description": "Development cookie; production uses __Host-toolman_session"
      }
    },
    "schemas": {
      "ProjectLink": {
        "type": "object",
        "properties": {
          "platform": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          }
        },
        "required": [
          "platform",
          "url"
        ]
      },
      "Project": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "slug": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "author_display": {
            "type": [
              "string",
              "null"
            ]
          },
          "author_verified": {
            "type": "boolean"
          },
          "taiwan_basis": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "ai_made": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "ai_capability": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "age_rating": {
            "type": "string"
          },
          "ingestion_origin": {
            "type": "string"
          },
          "links": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProjectLink"
            }
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "votes": {
            "type": "integer"
          },
          "review_count": {
            "type": "integer"
          },
          "avg_rating": {
            "type": [
              "number",
              "null"
            ]
          },
          "listed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "status": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "slug",
          "title",
          "summary",
          "status",
          "links",
          "tags"
        ]
      },
      "SubmissionCreate": {
        "type": "object",
        "required": [
          "title",
          "summary",
          "taiwan_basis",
          "links"
        ],
        "properties": {
          "origin": {
            "type": "string",
            "enum": [
              "self",
              "community"
            ]
          },
          "title": {
            "type": "string",
            "minLength": 2,
            "maxLength": 150
          },
          "summary": {
            "type": "string",
            "minLength": 15,
            "maxLength": 500
          },
          "description": {
            "type": "string",
            "maxLength": 12000
          },
          "author_display": {
            "type": "string"
          },
          "taiwan_basis": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string",
              "enum": [
                "taiwan_creator",
                "taiwan_audience",
                "taiwan_setting",
                "taiwan_culture",
                "public_value",
                "taiwan_localized"
              ]
            }
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "links": {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/ProjectLink"
            }
          },
          "ai_made": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "ai_capability": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "age_rating": {
            "type": "string",
            "enum": [
              "all",
              "teen",
              "18plus"
            ]
          }
        }
      },
      "ClaimCreate": {
        "type": "object",
        "required": [
          "project_id",
          "method"
        ],
        "properties": {
          "project_id": {
            "type": "string",
            "format": "uuid"
          },
          "method": {
            "type": "string",
            "enum": [
              "dns",
              "well_known",
              "github",
              "store",
              "manual"
            ]
          },
          "evidence_url": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "ReviewCreate": {
        "type": "object",
        "required": [
          "stars"
        ],
        "properties": {
          "stars": {
            "type": "integer",
            "minimum": 1,
            "maximum": 5
          },
          "body": {
            "type": "string",
            "maxLength": 2000
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      },
      "TokenCreate": {
        "type": "object",
        "required": [
          "label",
          "scopes"
        ],
        "properties": {
          "label": {
            "type": "string"
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "projects:read",
                "submissions:write",
                "claims:request",
                "projects:write"
              ]
            }
          },
          "days": {
            "type": "integer",
            "minimum": 1,
            "maximum": 90
          }
        }
      }
    }
  }
}
