{
  "openapi": "3.1.0",
  "info": {"title": "SkyRoblox Partner API", "version": "1.0.0", "description": "Server-scoped, consent-gated read-only verification API. Set server to your deployed Cloudflare Worker endpoint."},
  "servers": [{"url":"https://your-worker.your-subdomain.workers.dev","description":"Replace with WORKER_BASE_URL"}],
  "security": [{"partnerKey":[]}],
  "components": {
    "securitySchemes": {"partnerKey": {"type":"http", "scheme":"bearer", "description":"Private server-side partner key. Each request requires consent from the linked member."}},
    "schemas": {
      "Verification": {"type":"object","required":["verified"],"properties":{"verified":{"type":"boolean"}}},
      "Account": {"type":"object","required":["discord_id","sub","status","verified_at"],"properties":{"discord_id":{"type":"string"},"sub":{"type":"string"},"status":{"type":"string"},"verified_at":{"type":"integer"}}},
      "Profile": {"type":"object","properties":{"sub":{"type":"string"},"name":{"type":"string"},"display_name":{"type":"string"},"description":{"type":["string","null"]},"created":{"type":"string"},"profile":{"type":"string","format":"uri"}}},
      "Error": {"type":"object","properties":{"error":{"type":"string"}}}
    }
  },
  "paths": {
    "/v1/verification/discord/{discordId}": {"get":{"summary":"Check member verification","description":"Requires verification:check scope and the member's partner consent.","parameters":[{"name":"discordId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Verification status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Verification"}}}},"403":{"description":"Missing scope or consent"}}}},
    "/v1/accounts/discord/{discordId}": {"get":{"summary":"Read linked Roblox ID","description":"Requires accounts:read scope and member consent.","parameters":[{"name":"discordId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Linked account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}}},"403":{"description":"Missing scope or consent"}}}},
    "/v1/profiles/discord/{discordId}": {"get":{"summary":"Read live public Roblox profile","description":"Requires profiles:read scope and member consent; fetched from Roblox on demand.","parameters":[{"name":"discordId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Live public profile","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Profile"}}}},"403":{"description":"Missing scope or consent"}}}}
  }
}
