{"openapi":"3.1.0","info":{"title":"Praecise Scan","version":"0.1.0","description":"A clean answer is not proof of safety. 503 means no verdict: the caller decides."},"servers":[{"url":"https://scan.praecise.com"}],"tags":[{"name":"Scan","description":"Called by your server with the account key."},{"name":"Accounts","description":"Made by a Praecise product with the admin key."}],"components":{"securitySchemes":{"admin":{"type":"http","scheme":"bearer","description":"The admin key, held by a Praecise product."},"accountKey":{"type":"http","scheme":"bearer","description":"The account key (scn_…), shown once."}}},"paths":{"/scan":{"post":{"operationId":"scan","tags":["Scan"],"summary":"Check a file","security":[{"accountKey":[]}],"description":"The file is the raw request body, up to 26214400 bytes. It is streamed to the scanner and never kept.","requestBody":{"required":true,"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"responses":{"200":{"description":"A verdict","content":{"application/json":{"schema":{"type":"object","properties":{"clean":{"type":"boolean"},"name":{"type":"string","description":"The signature, when not clean."},"sha256":{"type":"string","description":""},"size":{"type":"integer"}},"required":["clean","sha256","size"]}}}},"413":{"description":"Larger than the ceiling"},"429":{"description":"Over the per-minute limit; see Retry-After"},"503":{"description":"The scanner cannot be reached: no verdict; the caller decides. Never clean."}}}},"/usage":{"get":{"operationId":"usage","tags":["Scan"],"summary":"The last seven days","security":[{"accountKey":[]}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"account":{"type":"string","description":""},"days":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string","description":""},"files":{"type":"integer"},"bytes":{"type":"integer"},"found":{"type":"integer"}},"required":[]}}},"required":[]}}}}}}},"/accounts":{"post":{"operationId":"accounts-create","tags":["Accounts"],"summary":"Add an account","security":[{"admin":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":""},"owner":{"type":"string","description":"The project or organisation id."}},"required":["name"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"account":{"type":"string","description":""},"key":{"type":"string","description":"Shown this once."},"name":{"type":"string","description":""}},"required":[]}}}}}},"get":{"operationId":"accounts-list","tags":["Accounts"],"summary":"List the accounts of an owner","security":[{"admin":[]}],"parameters":[{"name":"owner","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"accounts":{"type":"array","items":{"type":"object","properties":{"account":{"type":"string","description":""},"name":{"type":"string","description":""},"owner":{"type":"string","description":""},"createdAt":{"type":"string","description":""}},"required":[]}}},"required":[]}}}}}}},"/accounts/{account}":{"get":{"operationId":"accounts-read","tags":["Accounts"],"summary":"Read an account and its last seven days","security":[{"admin":[]}],"parameters":[{"name":"account","in":"path","required":true,"schema":{"type":"string"},"description":"The account id."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"account":{"type":"string","description":""},"name":{"type":"string","description":""},"owner":{"type":"string","description":""},"days":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string","description":""},"files":{"type":"integer"},"bytes":{"type":"integer"},"found":{"type":"integer"}},"required":[]}}},"required":[]}}}}}},"post":{"operationId":"accounts-rotate","tags":["Accounts"],"summary":"Rotate the key","security":[{"admin":[]}],"parameters":[{"name":"account","in":"path","required":true,"schema":{"type":"string"},"description":"The account id."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"rotate":{"type":"boolean","const":true}},"required":["rotate"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"account":{"type":"string","description":""},"key":{"type":"string","description":"The new key, shown this once."}},"required":[]}}}}}},"delete":{"operationId":"accounts-delete","tags":["Accounts"],"summary":"Remove an account","security":[{"admin":[]}],"parameters":[{"name":"account","in":"path","required":true,"schema":{"type":"string"},"description":"The account id."}],"responses":{"200":{"description":"Removed"}}}}}}