{"openapi":"3.0.3","info":{"title":"Angel Live Plugin Upload API","version":"1.0.0","description":"Create an API key in the GitHub admin web panel. Default workflow: upload raw Zip bytes to the test workspace, verify SHA-256 and sourceURL, then distribute only when ready. Keys cannot manage other keys or delete production packages."},"servers":[{"url":"https://plugins.xcliu.me"}],"externalDocs":{"description":"AI upload guide and curl examples","url":"https://plugins.xcliu.me/api/agent-guide"},"security":[{"bearerAuth":[]}],"paths":{"/api/admin/test-plugins":{"get":{"operationId":"listTestPlugins","summary":"List test plugins and stable install links","description":"Requires the test API key permission.","x-api-key-scope":"test","responses":{"200":{"description":"Test records","content":{"application/json":{"schema":{"type":"object","properties":{"records":{"type":"array","items":{"$ref":"#/components/schemas/TestRecord"}}}}}}},"400":{"description":"Invalid request or manifest","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or deleted key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error; inspect current state before retrying a write","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/admin/test-zips":{"post":{"operationId":"uploadTestZip","summary":"Upload or replace the test Zip for a pluginId","description":"Requires the test API key permission.","x-api-key-scope":"test","requestBody":{"required":true,"content":{"application/zip":{"schema":{"type":"string","format":"binary"}}}},"responses":{"200":{"description":"Replaced; existing sourceURL remains stable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestRecord"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestRecord"}}}},"400":{"description":"Invalid request or manifest","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or deleted key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error; inspect current state before retrying a write","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/admin/test-sources":{"post":{"operationId":"createTestBundle","summary":"Create one install link for multiple test plugins","description":"Requires the test API key permission.","x-api-key-scope":"test","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["keys"],"properties":{"keys":{"type":"array","minItems":2,"uniqueItems":true,"items":{"type":"string"}}}}}}},"responses":{"201":{"description":"Bundle source","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Source"}}}},"400":{"description":"Invalid request or manifest","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or deleted key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error; inspect current state before retrying a write","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/admin/test-plugins/{key}":{"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-zA-Z0-9_-]{6,64}$"}}],"delete":{"operationId":"deleteTestPlugin","summary":"Delete a test record and invalidate its install links","description":"Requires the test API key permission.","x-api-key-scope":"test","responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"Invalid request or manifest","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or deleted key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Test record not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error; inspect current state before retrying a write","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/admin/test-plugins/{key}/distribute":{"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-zA-Z0-9_-]{6,64}$"}}],"post":{"operationId":"distributeTestPlugin","summary":"Publish a test Zip and remove its test record on success","description":"Requires the publish API key permission.","x-api-key-scope":"publish","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["visibility"],"properties":{"visibility":{"type":"string","enum":["public","hidden","private"]},"overwrite":{"type":"boolean","default":false}}}}}},"responses":{"201":{"description":"Published; former test links now return 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Upload"}}}},"400":{"description":"Invalid request or manifest","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or deleted key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Test record not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Exact production version exists; no changes made","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error; inspect current state before retrying a write","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/admin/plugins":{"get":{"operationId":"listProductionPlugins","summary":"List every production version and visibility","description":"Requires the publish API key permission.","x-api-key-scope":"publish","responses":{"200":{"description":"Production catalog","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"Invalid request or manifest","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or deleted key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error; inspect current state before retrying a write","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/admin/zips":{"post":{"operationId":"uploadProductionZip","summary":"Upload a Zip directly to the production catalog","description":"Requires the publish API key permission.","x-api-key-scope":"publish","parameters":[{"name":"visibility","in":"query","required":true,"schema":{"type":"string","enum":["public","hidden","private"]}},{"name":"overwrite","in":"query","schema":{"type":"string","enum":["0","1"],"default":"0"},"description":"Only set 1 when replacing the same pluginId + version + visibility is intended."}],"requestBody":{"required":true,"content":{"application/zip":{"schema":{"type":"string","format":"binary"}}}},"responses":{"201":{"description":"Uploaded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Upload"}}}},"400":{"description":"Invalid request or manifest","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or deleted key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Exact production version exists; no changes made","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error; inspect current state before retrying a write","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/sources":{"post":{"operationId":"createProductionSource","summary":"Create a live administrator install source for selected plugin IDs","description":"Requires publish permission. The admin view prefers private versions; otherwise the latest visible version is selected. The returned link is a capability URL.","x-api-key-scope":"publish","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["pluginIds"],"properties":{"pluginIds":{"type":"array","minItems":1,"items":{"type":"string"}}}}}}},"responses":{"201":{"description":"Live source","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Source"}}}},"400":{"description":"Invalid request or manifest","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or deleted key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error; inspect current state before retrying a write","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API key created in the web admin panel; send only over HTTPS or an SSH tunnel."}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}},"Source":{"type":"object","properties":{"key":{"type":"string"},"sourceURL":{"type":"string","format":"uri"},"deepLink":{"type":"string"},"count":{"type":"integer"}}},"Upload":{"type":"object","properties":{"ok":{"type":"boolean"},"pluginId":{"type":"string"},"version":{"type":"string"},"sha256":{"type":"string"},"bytes":{"type":"integer"},"visibility":{"type":"string","enum":["public","hidden","private"]}}},"TestRecord":{"allOf":[{"$ref":"#/components/schemas/Source"},{"$ref":"#/components/schemas/Upload"},{"type":"object","properties":{"replaced":{"type":"boolean"},"previousVersion":{"type":"string","nullable":true},"removedVersions":{"type":"array","items":{"type":"string"}}}}]}}}}