{"openapi":"3.1.0","info":{"title":"Disband API","description":"Development documentation","version":"1"},"servers":[{"url":"/v1"}],"components":{"securitySchemes":{"key":{"type":"http","scheme":"bearer","description":"An API key, `disband_…`"},"session":{"type":"apiKey","in":"cookie","name":"__Host-session","description":"Session cookie of the web app"}}},"security":[{"key":[]},{"session":[]}],"paths":{"/catalog":{"get":{"operationId":"getCatalog","tags":["separations"],"summary":"Get the catalog","description":"Lists every stem with its parent, which is `mix` for top-level stems. Any stem can be requested on its own.","security":[],"responses":{"200":{"description":"The stems","content":{"application/json":{"schema":{"type":"object","properties":{"stems":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"parent":{"anyOf":[{"const":"mix"},{"type":"string"}]}},"required":["id","name","parent"]}}},"required":["stems"]}}}},"default":{"description":"Problem details (RFC 9457)","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"request_id":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status","instance","request_id"]}}}}}}},"/separations":{"post":{"operationId":"postSeparations","tags":["separations"],"summary":"Create a separation","description":"Send the audio file as the raw request body, up to 95 MB. The response returns once the job is submitted. For files up to 2 GB, set `bytes` and send no body. The response then contains `upload.url`, where the file must be uploaded with PUT at exactly that size, and the separation starts once the upload is complete. Files can be up to 10 minutes long, or 60 minutes while the account holds bought credits, which uploads with `bytes` also require. Poll the `Location` URL, with `Prefer: wait` to wait for changes. The separation and its files are deleted at `expires_at`.","requestBody":{"required":false,"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary","description":"MP3, WAV, FLAC, M4A, Ogg or Opus audio"}}}},"responses":{"202":{"description":"Submitted","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"created_at":{"type":"string"},"expires_at":{"type":"string"},"status":{"const":"uploading"},"upload":{"type":"object","properties":{"url":{"type":"string"},"expires_at":{"type":"string"}},"required":["url","expires_at"]}},"required":["id","created_at","expires_at","status","upload"],"title":"Uploading"},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"created_at":{"type":"string"},"expires_at":{"type":"string"},"status":{"enum":["queued","separating"],"type":"string"},"charge":{"type":"number"}},"required":["id","created_at","expires_at","status"],"title":"Running"},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"created_at":{"type":"string"},"expires_at":{"type":"string"},"status":{"const":"ready"},"charge":{"type":"number"},"duration":{"type":"number"},"stems":{"type":"object","propertyNames":{"enum":["vocals","vocals.lead","vocals.backing","instrumental","instrumental.drums","instrumental.drums.kick","instrumental.drums.snare","instrumental.drums.toms","instrumental.drums.hihat","instrumental.drums.cymbals","instrumental.bass","instrumental.guitar","instrumental.piano","instrumental.other"],"type":"string"},"additionalProperties":{"anyOf":[{"type":"object","propertyNames":{"enum":["wav","mp3"],"type":"string"},"additionalProperties":{"type":"object","properties":{"url":{"type":"string"},"bytes":{"type":"number"}},"required":["url","bytes"]},"title":"Files"},{"type":"object","properties":{"silent":{"const":true}},"required":["silent"],"title":"Silent"}]}}},"required":["id","created_at","expires_at","status","charge","duration","stems"],"title":"Ready"},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"created_at":{"type":"string"},"expires_at":{"type":"string"},"status":{"const":"failed"},"charge":{"type":"number"},"problem":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"request_id":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status","instance","request_id"]}},"required":["id","created_at","expires_at","status","charge","problem"],"title":"Failed"}]}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"array","items":{}},"data":{}},"required":["success","error","data"]}}}},"default":{"description":"Problem details (RFC 9457)","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"request_id":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status","instance","request_id"]}}}}},"parameters":[{"in":"query","name":"stems","schema":{"type":"array","items":{"enum":["vocals","vocals.lead","vocals.backing","instrumental","instrumental.drums","instrumental.drums.kick","instrumental.drums.snare","instrumental.drums.toms","instrumental.drums.hihat","instrumental.drums.cymbals","instrumental.bass","instrumental.guitar","instrumental.piano","instrumental.other"],"type":"string"},"minItems":1},"required":true,"description":"Stem ids from the catalog, repeated as `stems=a&stems=b`"},{"in":"query","name":"formats","schema":{"type":"array","items":{"enum":["wav","mp3"],"type":"string"},"minItems":1,"default":["wav","mp3"]},"description":"File formats to deliver each stem in, repeated like `stems`"},{"in":"query","name":"name","schema":{"type":"string","minLength":1,"maxLength":255},"description":"The file's name, for the list and the download file names"},{"in":"query","name":"bytes","schema":{"type":"integer","minimum":1,"maximum":2000000000},"description":"Size in bytes of a file to upload separately instead of sending it as the request body"}]},"get":{"operationId":"getSeparations","tags":["separations"],"summary":"List separations","responses":{"200":{"description":"Newest first","content":{"application/json":{"schema":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"created_at":{"type":"string"},"expires_at":{"type":"string"},"status":{"const":"uploading"},"upload":{"type":"object","properties":{"url":{"type":"string"},"expires_at":{"type":"string"}},"required":["url","expires_at"]}},"required":["id","created_at","expires_at","status","upload"],"title":"Uploading"},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"created_at":{"type":"string"},"expires_at":{"type":"string"},"status":{"enum":["queued","separating"],"type":"string"},"charge":{"type":"number"}},"required":["id","created_at","expires_at","status"],"title":"Running"},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"created_at":{"type":"string"},"expires_at":{"type":"string"},"status":{"const":"ready"},"charge":{"type":"number"},"duration":{"type":"number"},"stems":{"type":"object","propertyNames":{"enum":["vocals","vocals.lead","vocals.backing","instrumental","instrumental.drums","instrumental.drums.kick","instrumental.drums.snare","instrumental.drums.toms","instrumental.drums.hihat","instrumental.drums.cymbals","instrumental.bass","instrumental.guitar","instrumental.piano","instrumental.other"],"type":"string"},"additionalProperties":{"anyOf":[{"type":"object","propertyNames":{"enum":["wav","mp3"],"type":"string"},"additionalProperties":{"type":"object","properties":{"url":{"type":"string"},"bytes":{"type":"number"}},"required":["url","bytes"]},"title":"Files"},{"type":"object","properties":{"silent":{"const":true}},"required":["silent"],"title":"Silent"}]}}},"required":["id","created_at","expires_at","status","charge","duration","stems"],"title":"Ready"},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"created_at":{"type":"string"},"expires_at":{"type":"string"},"status":{"const":"failed"},"charge":{"type":"number"},"problem":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"request_id":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status","instance","request_id"]}},"required":["id","created_at","expires_at","status","charge","problem"],"title":"Failed"}]}}}}},"default":{"description":"Problem details (RFC 9457)","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"request_id":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status","instance","request_id"]}}}}}}},"/separations/{id}":{"get":{"operationId":"getSeparationsById","tags":["separations"],"summary":"Get a separation","description":"Ready and failed separations return immediately, whatever `Prefer` asks.","parameters":[{"name":"prefer","in":"header","required":false,"description":"`wait=N` holds the response until the next status change, at most N seconds, up to 60","schema":{"type":"string","example":"wait=60"}},{"in":"path","name":"id","schema":{"type":"string"},"required":true,"description":"Separation id"}],"responses":{"200":{"description":"The separation","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"created_at":{"type":"string"},"expires_at":{"type":"string"},"status":{"const":"uploading"},"upload":{"type":"object","properties":{"url":{"type":"string"},"expires_at":{"type":"string"}},"required":["url","expires_at"]}},"required":["id","created_at","expires_at","status","upload"],"title":"Uploading"},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"created_at":{"type":"string"},"expires_at":{"type":"string"},"status":{"enum":["queued","separating"],"type":"string"},"charge":{"type":"number"}},"required":["id","created_at","expires_at","status"],"title":"Running"},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"created_at":{"type":"string"},"expires_at":{"type":"string"},"status":{"const":"ready"},"charge":{"type":"number"},"duration":{"type":"number"},"stems":{"type":"object","propertyNames":{"enum":["vocals","vocals.lead","vocals.backing","instrumental","instrumental.drums","instrumental.drums.kick","instrumental.drums.snare","instrumental.drums.toms","instrumental.drums.hihat","instrumental.drums.cymbals","instrumental.bass","instrumental.guitar","instrumental.piano","instrumental.other"],"type":"string"},"additionalProperties":{"anyOf":[{"type":"object","propertyNames":{"enum":["wav","mp3"],"type":"string"},"additionalProperties":{"type":"object","properties":{"url":{"type":"string"},"bytes":{"type":"number"}},"required":["url","bytes"]},"title":"Files"},{"type":"object","properties":{"silent":{"const":true}},"required":["silent"],"title":"Silent"}]}}},"required":["id","created_at","expires_at","status","charge","duration","stems"],"title":"Ready"},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"created_at":{"type":"string"},"expires_at":{"type":"string"},"status":{"const":"failed"},"charge":{"type":"number"},"problem":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"request_id":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status","instance","request_id"]}},"required":["id","created_at","expires_at","status","charge","problem"],"title":"Failed"}]}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"array","items":{}},"data":{}},"required":["success","error","data"]}}}},"default":{"description":"Problem details (RFC 9457)","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"request_id":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status","instance","request_id"]}}}}}},"delete":{"operationId":"deleteSeparationsById","tags":["separations"],"summary":"Delete a separation","description":"Cancels the separation if it is running, and its charge is kept. Returns 204 even if the separation doesn't exist.","responses":{"204":{"description":"Deleted"},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"array","items":{}},"data":{}},"required":["success","error","data"]}}}},"default":{"description":"Problem details (RFC 9457)","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"request_id":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status","instance","request_id"]}}}}},"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true,"description":"Separation id"}]}},"/separations/{id}/stems/{stem}/{format}":{"get":{"operationId":"getSeparationsByIdStemsByStemByFormat","tags":["separations"],"summary":"Download a stem","description":"Returns 16-bit WAV or MP3 at about 200 kbps. A single byte range returns 206 with that range, multiple ranges return the whole file.","responses":{"200":{"description":"The stem","content":{"audio/wav":{"schema":{"type":"string","format":"binary"}},"audio/mpeg":{"schema":{"type":"string","format":"binary"}}}},"206":{"description":"The requested range"},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"array","items":{}},"data":{}},"required":["success","error","data"]}}}},"default":{"description":"Problem details (RFC 9457)","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"request_id":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status","instance","request_id"]}}}}},"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true,"description":"Separation id"},{"in":"path","name":"stem","schema":{"enum":["vocals","vocals.lead","vocals.backing","instrumental","instrumental.drums","instrumental.drums.kick","instrumental.drums.snare","instrumental.drums.toms","instrumental.drums.hihat","instrumental.drums.cymbals","instrumental.bass","instrumental.guitar","instrumental.piano","instrumental.other"],"type":"string"},"required":true,"description":"Stem id from the catalog"},{"in":"path","name":"format","schema":{"enum":["wav","mp3"],"type":"string"},"required":true,"description":"`wav` or `mp3`, one of the separation's formats"}]}},"/usage":{"get":{"operationId":"getUsage","tags":["usage"],"summary":"Get usage","description":"Free credits are used before bought credits and reset at midnight UTC. Bought credits don't expire. `balance.bought` is negative if credits were refunded after being spent, and the next purchase pays that off first. `limits.daily` is the daily free allowance. It is 0 for API keys, which only use bought credits, and while free use is paused. `seconds`, `bytes` and `jobs` are the maximum file duration, file size and concurrent jobs, which are higher while the account holds bought credits.","responses":{"200":{"description":"Current balance and limits","content":{"application/json":{"schema":{"type":"object","properties":{"balance":{"type":"object","properties":{"free":{"type":"number"},"bought":{"type":"number"}},"required":["free","bought"]},"limits":{"type":"object","properties":{"daily":{"type":"number"},"seconds":{"type":"number"},"bytes":{"type":"number"},"jobs":{"type":"number"}},"required":["daily","seconds","bytes","jobs"]}},"required":["balance","limits"]}}}},"default":{"description":"Problem details (RFC 9457)","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"request_id":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status","instance","request_id"]}}}}}}},"/usage/history":{"get":{"operationId":"getUsageHistory","tags":["usage"],"summary":"Get usage history","description":"Returns the credits spent per UTC day, minus credits returned for failed separations, and the bought credits added or removed by grants, purchases and refunds. `source` filters the days to the web app (`web`) or a single API key and omits grants, purchases and refunds.","responses":{"200":{"description":"Days and changes to bought credits, newest first","content":{"application/json":{"schema":{"type":"object","properties":{"since":{"type":"string","format":"date"},"days":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string","format":"date"},"separations":{"type":"number"},"spent":{"type":"object","properties":{"free":{"type":"number"},"bought":{"type":"number"}},"required":["free","bought"]}},"required":["day","separations","spent"]}},"additions":{"type":"array","items":{"type":"object","properties":{"kind":{"enum":["grant","purchase","refund"],"type":"string"},"created_at":{"type":"string"},"credits":{"type":"number"},"note":{"type":"string"}},"required":["kind","created_at","credits"]}}},"required":["since","days","additions"]}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"array","items":{}},"data":{}},"required":["success","error","data"]}}}},"default":{"description":"Problem details (RFC 9457)","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"request_id":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status","instance","request_id"]}}}}},"parameters":[{"in":"query","name":"source","schema":{"anyOf":[{"const":"web"},{"type":"string","pattern":"^key_"}]},"description":"`web` or an API key's id, for that source's spending only"}]}},"/auth/providers":{"get":{"operationId":"getAuthProviders","tags":["account"],"summary":"List sign-in providers","security":[],"responses":{"200":{"description":"Provider ids","content":{"application/json":{"schema":{"type":"array","items":{"enum":["google","github","dev"],"type":"string"}}}}}}}},"/auth/{provider}":{"get":{"operationId":"getAuthByProvider","tags":["account"],"summary":"Sign in","description":"Creates an account if the identity has never signed in before.","security":[],"responses":{"303":{"description":"Redirects to the provider's sign-in page"},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"array","items":{}},"data":{}},"required":["success","error","data"]}}}},"default":{"description":"Problem details (RFC 9457)","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"request_id":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status","instance","request_id"]}}}}},"parameters":[{"in":"path","name":"provider","schema":{"enum":["google","github"],"type":"string"},"required":true},{"in":"query","name":"next","schema":{"type":"string","pattern":"^/","default":"/"},"description":"A path on the UI to come back to, with `?problem=` added when it failed"}]}},"/account/providers/{provider}":{"post":{"operationId":"postAccountProvidersByProvider","tags":["account"],"summary":"Link a sign-in provider","description":"Adds the provider's identity to this account as another way to sign in.","security":[{"session":[]}],"responses":{"303":{"description":"Redirects to the provider's sign-in page"},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"array","items":{}},"data":{}},"required":["success","error","data"]}}}},"default":{"description":"Problem details (RFC 9457)","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"request_id":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status","instance","request_id"]}}}}},"parameters":[{"in":"path","name":"provider","schema":{"enum":["google","github"],"type":"string"},"required":true},{"in":"query","name":"next","schema":{"type":"string","pattern":"^/","default":"/"},"description":"A path on the UI to come back to, with `?problem=` added when it failed"}]},"delete":{"operationId":"deleteAccountProvidersByProvider","tags":["account"],"summary":"Unlink a sign-in provider","description":"Fails with 409 for the account's last provider.","security":[{"session":[]}],"responses":{"204":{"description":"Unlinked"},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"array","items":{}},"data":{}},"required":["success","error","data"]}}}},"default":{"description":"Problem details (RFC 9457)","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"request_id":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status","instance","request_id"]}}}}},"parameters":[{"in":"path","name":"provider","schema":{"enum":["google","github"],"type":"string"},"required":true}]}},"/account":{"get":{"operationId":"getAccount","tags":["account"],"summary":"Get the account","description":"A suspended account can only read itself and its usage, and sign out. Every other call answers 403 `account-suspended`.","security":[{"session":[]}],"responses":{"200":{"description":"The account","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"providers":{"type":"array","items":{"enum":["google","github"],"type":"string"}},"suspended":{"type":"boolean"}},"required":["id","providers","suspended"]}}}},"default":{"description":"Problem details (RFC 9457)","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"request_id":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status","instance","request_id"]}}}}}},"delete":{"operationId":"deleteAccount","tags":["account"],"summary":"Delete the account","description":"Refunds the unused bought credits through Polar, then deletes the account with its separations, identities, sessions and keys. A suspended account can't delete itself.","security":[{"session":[]}],"responses":{"204":{"description":"Deleted"},"default":{"description":"Problem details (RFC 9457)","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"request_id":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status","instance","request_id"]}}}}}}},"/account/refund":{"get":{"operationId":"getAccountRefund","tags":["account"],"summary":"Get the deletion refund","description":"Returns the unused bought credits that deleting the account would refund, and the refund `amount` in US cents.","security":[{"session":[]}],"responses":{"200":{"description":"The refund","content":{"application/json":{"schema":{"type":"object","properties":{"credits":{"type":"number"},"amount":{"type":"number"}},"required":["credits","amount"]}}}},"default":{"description":"Problem details (RFC 9457)","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"request_id":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status","instance","request_id"]}}}}}}},"/keys":{"get":{"operationId":"getKeys","tags":["keys"],"summary":"List API keys","security":[{"session":[]}],"responses":{"200":{"description":"Oldest first","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"hint":{"type":"string"},"last_used_at":{"type":"string"}},"required":["id","name","hint"]}}}}},"default":{"description":"Problem details (RFC 9457)","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"request_id":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status","instance","request_id"]}}}}}},"post":{"operationId":"postKeys","tags":["keys"],"summary":"Create an API key","description":"The secret key is only returned in this response. An account can have up to 20 keys.","security":[{"session":[]}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"hint":{"type":"string"},"last_used_at":{"type":"string"},"secret":{"type":"string"}},"required":["id","name","hint","secret"]}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"array","items":{}},"data":{}},"required":["success","error","data"]}}}},"default":{"description":"Problem details (RFC 9457)","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"request_id":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status","instance","request_id"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100}},"required":["name"]}}}}}},"/keys/{id}":{"delete":{"operationId":"deleteKeysById","tags":["keys"],"summary":"Revoke an API key","security":[{"session":[]}],"responses":{"204":{"description":"Revoked"},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"array","items":{}},"data":{}},"required":["success","error","data"]}}}},"default":{"description":"Problem details (RFC 9457)","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"request_id":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status","instance","request_id"]}}}}},"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}]}},"/session":{"delete":{"operationId":"deleteSession","tags":["account"],"summary":"Sign out","security":[{"session":[]}],"responses":{"204":{"description":"Signed out"},"default":{"description":"Problem details (RFC 9457)","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"request_id":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status","instance","request_id"]}}}}}}},"/sessions":{"delete":{"operationId":"deleteSessions","tags":["account"],"summary":"Sign out everywhere","security":[{"session":[]}],"responses":{"204":{"description":"Signed out everywhere"},"default":{"description":"Problem details (RFC 9457)","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"request_id":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status","instance","request_id"]}}}}}}},"/checkouts":{"post":{"operationId":"postCheckouts","tags":["credits"],"summary":"Create a checkout","description":"Starts a purchase of a credit pack. Returns the URL of Polar's checkout page, which redirects to the credits page after payment.","security":[{"session":[]}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"}},"required":["id","url"]}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"array","items":{}},"data":{}},"required":["success","error","data"]}}}},"default":{"description":"Problem details (RFC 9457)","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"request_id":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status","instance","request_id"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"pack":{"enum":[2500,7000,20000,48000,110000],"type":"number"}},"required":["pack"]}}}}}},"/checkouts/{id}":{"get":{"operationId":"getCheckoutsById","tags":["credits"],"summary":"Get a checkout's status","description":"Returns the status of a purchase: paid with the credits added, refunded, or pending. With `Prefer: wait=N` (up to 60), the response waits up to N seconds while the purchase is pending.","security":[{"session":[]}],"responses":{"200":{"description":"The checkout","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"status":{"const":"paid"},"credits":{"type":"number"}},"required":["status","credits"],"title":"Paid"},{"type":"object","properties":{"status":{"const":"refunded"}},"required":["status"],"title":"Refunded"},{"type":"object","properties":{"status":{"const":"pending"}},"required":["status"],"title":"Pending"}]}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"array","items":{}},"data":{}},"required":["success","error","data"]}}}},"default":{"description":"Problem details (RFC 9457)","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"request_id":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status","instance","request_id"]}}}}},"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}]}}}}