{"openapi":"3.1.0","info":{"title":"PolyPack Team API","version":"1","description":"Manage a Team's Clients, Grants, Products given to Clients and Client Tokens, and read its Packs and download statistics (docs: https:\/\/polypack.io\/docs\/api). \/v1\/ is stable: fields and error codes are added, never changed or removed. Authenticate with an API key: `Authorization: Bearer polypack_key_\u2026`. A read key may only GET.","contact":{"url":"https:\/\/polypack.io\/docs\/api"}},"servers":[{"url":"https:\/\/api.polypack.io\/v1"}],"security":[{"apiKey":[]}],"tags":[{"name":"Team"},{"name":"Packs"},{"name":"Products"},{"name":"Clients"},{"name":"Meta"}],"paths":{"\/team":{"get":{"operationId":"getTeam","summary":"The API key's Team, its Plan and usage","tags":["Team"],"x-polypack-ability":"read","responses":{"200":{"description":"The Team","content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/Team"}}}}}},"401":{"description":"No active API key.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"},"description":"Bearer realm=\"PolyPack API\""}}},"403":{"description":"The key may not do this, is used from an address it does not allow (ip_not_allowed), or the Team is suspended.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"429":{"description":"Rate limited.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer"}}}}}}},"\/packs":{"get":{"operationId":"listPacks","summary":"The Team's Packs","tags":["Packs"],"x-polypack-ability":"read","responses":{"200":{"description":"A page of Packs","content":{"application\/json":{"schema":{"type":"object","required":["data","meta","links"],"properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Pack"}},"meta":{"$ref":"#\/components\/schemas\/PageMeta"},"links":{"$ref":"#\/components\/schemas\/PageLinks"}}}}}},"401":{"description":"No active API key.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"},"description":"Bearer realm=\"PolyPack API\""}}},"403":{"description":"The key may not do this, is used from an address it does not allow (ip_not_allowed), or the Team is suspended.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"429":{"description":"Rate limited.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer"}}}},"422":{"description":"Validation failed, or a Plan limit was reached.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}},"parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1}},{"name":"ecosystem","in":"query","schema":{"type":"string","enum":["composer","npm","oci"]}},{"name":"label","in":"query","description":"Only Packs with this label (step 82), compared as stored: lower case, spaces as -.","schema":{"type":"string"}}]}},"\/packs\/{pack}":{"get":{"operationId":"getPack","summary":"One Pack with its Versions","tags":["Packs"],"x-polypack-ability":"read","responses":{"200":{"description":"The Pack","content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/Pack"}}}}}},"401":{"description":"No active API key.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"},"description":"Bearer realm=\"PolyPack API\""}}},"403":{"description":"The key may not do this, or the Team is suspended.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"429":{"description":"Rate limited.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer"}}}},"404":{"description":"Not found, or another Team's.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}},"parameters":[{"name":"pack","in":"path","required":true,"description":"A Pack's id","schema":{"type":"integer"}}]}},"\/packs\/{pack}\/adoption":{"get":{"operationId":"getPackAdoption","summary":"Which Versions each Client is on","tags":["Packs"],"x-polypack-ability":"read","responses":{"200":{"description":"Adoption","content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/PackAdoption"}}}}}},"401":{"description":"No active API key.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"},"description":"Bearer realm=\"PolyPack API\""}}},"403":{"description":"The key may not do this, or the Team is suspended.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"429":{"description":"Rate limited.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer"}}}},"404":{"description":"Not found, or another Team's.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"422":{"description":"`days` is not 30, 90 or 365.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}},"parameters":[{"name":"pack","in":"path","required":true,"description":"A Pack's id","schema":{"type":"integer"}},{"name":"days","in":"query","schema":{"type":"integer","enum":[30,90,365],"default":90}}],"description":"From downloads: a Client is on a Version when one of its Client Tokens (revoked ones included) downloaded it in the window. Your Team's Member and Team Tokens are one caller, `team`; downloads without a Token are `anonymous`."}},"\/packs\/{pack}\/downloads":{"get":{"operationId":"getPackDownloads","summary":"A Pack's downloads per day, 30 days","tags":["Packs"],"x-polypack-ability":"read","responses":{"200":{"description":"Downloads","content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/PackDownloads"}}}}}},"401":{"description":"No active API key.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"},"description":"Bearer realm=\"PolyPack API\""}}},"403":{"description":"The key may not do this, or the Team is suspended.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"429":{"description":"Rate limited.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer"}}}},"404":{"description":"Not found, or another Team's.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}},"parameters":[{"name":"pack","in":"path","required":true,"description":"A Pack's id","schema":{"type":"integer"}}]}},"\/products":{"get":{"operationId":"listProducts","summary":"The Team's Products","tags":["Products"],"x-polypack-ability":"read","responses":{"200":{"description":"A page of Products","content":{"application\/json":{"schema":{"type":"object","required":["data","meta","links"],"properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Product"}},"meta":{"$ref":"#\/components\/schemas\/PageMeta"},"links":{"$ref":"#\/components\/schemas\/PageLinks"}}}}}},"401":{"description":"No active API key.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"},"description":"Bearer realm=\"PolyPack API\""}}},"403":{"description":"The key may not do this, or the Team is suspended.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"429":{"description":"Rate limited.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer"}}}},"404":{"description":"Not found, or another Team's.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}},"parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1}}]}},"\/products\/{product}":{"get":{"operationId":"getProduct","summary":"One Product with its Packs","tags":["Products"],"x-polypack-ability":"read","responses":{"200":{"description":"The Product","content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/Product"}}}}}},"401":{"description":"No active API key.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"},"description":"Bearer realm=\"PolyPack API\""}}},"403":{"description":"The key may not do this, or the Team is suspended.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"429":{"description":"Rate limited.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer"}}}},"404":{"description":"Not found, or another Team's.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}},"parameters":[{"name":"product","in":"path","required":true,"description":"A Product's id","schema":{"type":"integer"}}]}},"\/clients":{"get":{"operationId":"listClients","summary":"The Team's Clients","tags":["Clients"],"x-polypack-ability":"read","responses":{"200":{"description":"A page of Clients","content":{"application\/json":{"schema":{"type":"object","required":["data","meta","links"],"properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Client"}},"meta":{"$ref":"#\/components\/schemas\/PageMeta"},"links":{"$ref":"#\/components\/schemas\/PageLinks"}}}}}},"401":{"description":"No active API key.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"},"description":"Bearer realm=\"PolyPack API\""}}},"403":{"description":"The key may not do this, is used from an address it does not allow (ip_not_allowed), or the Team is suspended.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"429":{"description":"Rate limited.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer"}}}}},"parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1}}]},"post":{"operationId":"createClient","summary":"Create a Client","tags":["Clients"],"x-polypack-ability":"write","responses":{"201":{"description":"Created","content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/Client"}}}}}},"401":{"description":"No active API key.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"},"description":"Bearer realm=\"PolyPack API\""}}},"403":{"description":"The key may not do this, is used from an address it does not allow (ip_not_allowed), or the Team is suspended.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"429":{"description":"Rate limited.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer"}}}},"422":{"description":"Validation failed, or a Plan limit was reached.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ClientInput"}}}}}},"\/clients\/{client}":{"get":{"operationId":"getClient","summary":"One Client with its Grants and Tokens","tags":["Clients"],"x-polypack-ability":"read","responses":{"200":{"description":"The Client","content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/Client"}}}}}},"401":{"description":"No active API key.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"},"description":"Bearer realm=\"PolyPack API\""}}},"403":{"description":"The key may not do this, or the Team is suspended.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"429":{"description":"Rate limited.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer"}}}},"404":{"description":"Not found, or another Team's.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}},"parameters":[{"name":"client","in":"path","required":true,"description":"A Client's id","schema":{"type":"integer"}}]},"patch":{"operationId":"updateClient","summary":"Rename a Client or change its notes","tags":["Clients"],"x-polypack-ability":"write","responses":{"200":{"description":"Updated","content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/Client"}}}}}},"401":{"description":"No active API key.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"},"description":"Bearer realm=\"PolyPack API\""}}},"403":{"description":"The key may not do this, or the Team is suspended.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"429":{"description":"Rate limited.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer"}}}},"404":{"description":"Not found, or another Team's.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"422":{"description":"Validation failed, or a Plan limit was reached.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}},"parameters":[{"name":"client","in":"path","required":true,"description":"A Client's id","schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ClientPatch"}}}}},"delete":{"operationId":"deleteClient","summary":"Delete a Client; its Tokens stop working","tags":["Clients"],"x-polypack-ability":"write","responses":{"204":{"description":"Deleted"},"401":{"description":"No active API key.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"},"description":"Bearer realm=\"PolyPack API\""}}},"403":{"description":"The key may not do this, or the Team is suspended.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"429":{"description":"Rate limited.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer"}}}},"404":{"description":"Not found, or another Team's.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}},"parameters":[{"name":"client","in":"path","required":true,"description":"A Client's id","schema":{"type":"integer"}}]}},"\/clients\/{client}\/downloads":{"get":{"operationId":"getClientDownloads","summary":"A Client's downloads by Pack, 30 days","tags":["Clients"],"x-polypack-ability":"read","responses":{"200":{"description":"Downloads","content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/ClientDownloads"}}}}}},"401":{"description":"No active API key.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"},"description":"Bearer realm=\"PolyPack API\""}}},"403":{"description":"The key may not do this, or the Team is suspended.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"429":{"description":"Rate limited.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer"}}}},"404":{"description":"Not found, or another Team's.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}},"parameters":[{"name":"client","in":"path","required":true,"description":"A Client's id","schema":{"type":"integer"}}]}},"\/clients\/{client}\/grants":{"get":{"operationId":"listGrants","summary":"A Client's Grants","tags":["Clients"],"x-polypack-ability":"read","responses":{"200":{"description":"A page of Grants","content":{"application\/json":{"schema":{"type":"object","required":["data","meta","links"],"properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Grant"}},"meta":{"$ref":"#\/components\/schemas\/PageMeta"},"links":{"$ref":"#\/components\/schemas\/PageLinks"}}}}}},"401":{"description":"No active API key.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"},"description":"Bearer realm=\"PolyPack API\""}}},"403":{"description":"The key may not do this, or the Team is suspended.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"429":{"description":"Rate limited.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer"}}}},"404":{"description":"Not found, or another Team's.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}},"parameters":[{"name":"client","in":"path","required":true,"description":"A Client's id","schema":{"type":"integer"}},{"name":"page","in":"query","schema":{"type":"integer","minimum":1}}]},"post":{"operationId":"createGrant","summary":"Grant a Pack to a Client","tags":["Clients"],"x-polypack-ability":"write","responses":{"201":{"description":"Granted","content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/Grant"}}}}}},"401":{"description":"No active API key.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"},"description":"Bearer realm=\"PolyPack API\""}}},"403":{"description":"The key may not do this, or the Team is suspended.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"429":{"description":"Rate limited.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer"}}}},"404":{"description":"Not found, or another Team's.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"422":{"description":"Validation failed, or a Plan limit was reached.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}},"parameters":[{"name":"client","in":"path","required":true,"description":"A Client's id","schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/GrantInput"}}}},"description":"Granting a Pack the Client has through a Product makes that Grant direct, with these terms."}},"\/clients\/{client}\/grants\/{grant}":{"patch":{"operationId":"updateGrant","summary":"Change a Grant's terms","tags":["Clients"],"x-polypack-ability":"write","responses":{"200":{"description":"Updated","content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/Grant"}}}}}},"401":{"description":"No active API key.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"},"description":"Bearer realm=\"PolyPack API\""}}},"403":{"description":"The key may not do this, or the Team is suspended.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"429":{"description":"Rate limited.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer"}}}},"404":{"description":"Not found, or another Team's.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"422":{"description":"Validation failed, or the Grant comes from a Product (`refused`): change the Product Grant instead.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}},"parameters":[{"name":"client","in":"path","required":true,"description":"A Client's id","schema":{"type":"integer"}},{"name":"grant","in":"path","required":true,"description":"A Grant's id","schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/GrantPatch"}}}}},"delete":{"operationId":"deleteGrant","summary":"Withdraw a Grant","tags":["Clients"],"x-polypack-ability":"write","responses":{"204":{"description":"Withdrawn"},"401":{"description":"No active API key.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"},"description":"Bearer realm=\"PolyPack API\""}}},"403":{"description":"The key may not do this, or the Team is suspended.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"429":{"description":"Rate limited.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer"}}}},"404":{"description":"Not found, or another Team's.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"422":{"description":"The Grant comes from a Product (`refused`): withdraw the Product Grant instead.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}},"parameters":[{"name":"client","in":"path","required":true,"description":"A Client's id","schema":{"type":"integer"}},{"name":"grant","in":"path","required":true,"description":"A Grant's id","schema":{"type":"integer"}}]}},"\/clients\/{client}\/products":{"get":{"operationId":"listClientProducts","summary":"A Client's Products","tags":["Clients"],"x-polypack-ability":"read","responses":{"200":{"description":"A page of Product Grants","content":{"application\/json":{"schema":{"type":"object","required":["data","meta","links"],"properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/ProductGrant"}},"meta":{"$ref":"#\/components\/schemas\/PageMeta"},"links":{"$ref":"#\/components\/schemas\/PageLinks"}}}}}},"401":{"description":"No active API key.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"},"description":"Bearer realm=\"PolyPack API\""}}},"403":{"description":"The key may not do this, or the Team is suspended.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"429":{"description":"Rate limited.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer"}}}},"404":{"description":"Not found, or another Team's.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}},"parameters":[{"name":"client","in":"path","required":true,"description":"A Client's id","schema":{"type":"integer"}},{"name":"page","in":"query","schema":{"type":"integer","minimum":1}}]},"post":{"operationId":"createClientProduct","summary":"Give a Client a Product","tags":["Clients"],"x-polypack-ability":"write","responses":{"201":{"description":"Given","content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/ProductGrant"}}}}}},"401":{"description":"No active API key.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"},"description":"Bearer realm=\"PolyPack API\""}}},"403":{"description":"The key may not do this, or the Team is suspended.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"429":{"description":"Rate limited.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer"}}}},"404":{"description":"Not found, or another Team's.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"422":{"description":"Validation failed.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}},"parameters":[{"name":"client","in":"path","required":true,"description":"A Client's id","schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ProductGrantInput"}}}},"description":"Grants each of the Product's Packs the Client has no direct Grant of. Terms left out take the Product's defaults, from today. Giving a Product the Client already has returns its Product Grant."}},"\/clients\/{client}\/products\/{productGrant}":{"patch":{"operationId":"updateClientProduct","summary":"Change a Client's terms for a Product","tags":["Clients"],"x-polypack-ability":"write","responses":{"200":{"description":"Updated","content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/ProductGrant"}}}}}},"401":{"description":"No active API key.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"},"description":"Bearer realm=\"PolyPack API\""}}},"403":{"description":"The key may not do this, or the Team is suspended.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"429":{"description":"Rate limited.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer"}}}},"404":{"description":"Not found, or another Team's.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"422":{"description":"Validation failed.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}},"parameters":[{"name":"client","in":"path","required":true,"description":"A Client's id","schema":{"type":"integer"}},{"name":"productGrant","in":"path","required":true,"description":"A Product Grant's id","schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/GrantPatch"}}}},"description":"Every Grant the Product Grant keeps follows the new terms."},"delete":{"operationId":"deleteClientProduct","summary":"Withdraw a Client's Product","tags":["Clients"],"x-polypack-ability":"write","responses":{"204":{"description":"Withdrawn"},"401":{"description":"No active API key.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"},"description":"Bearer realm=\"PolyPack API\""}}},"403":{"description":"The key may not do this, or the Team is suspended.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"429":{"description":"Rate limited.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer"}}}},"404":{"description":"Not found, or another Team's.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}},"parameters":[{"name":"client","in":"path","required":true,"description":"A Client's id","schema":{"type":"integer"}},{"name":"productGrant","in":"path","required":true,"description":"A Product Grant's id","schema":{"type":"integer"}}],"description":"The Grants it kept go, unless another of the Client's Products covers the Pack. Direct Grants stay."}},"\/clients\/{client}\/tokens":{"get":{"operationId":"listTokens","summary":"A Client's Tokens (never their secrets)","tags":["Clients"],"x-polypack-ability":"read","responses":{"200":{"description":"A page of Tokens","content":{"application\/json":{"schema":{"type":"object","required":["data","meta","links"],"properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Token"}},"meta":{"$ref":"#\/components\/schemas\/PageMeta"},"links":{"$ref":"#\/components\/schemas\/PageLinks"}}}}}},"401":{"description":"No active API key.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"},"description":"Bearer realm=\"PolyPack API\""}}},"403":{"description":"The key may not do this, or the Team is suspended.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"429":{"description":"Rate limited.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer"}}}},"404":{"description":"Not found, or another Team's.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}},"parameters":[{"name":"client","in":"path","required":true,"description":"A Client's id","schema":{"type":"integer"}},{"name":"page","in":"query","schema":{"type":"integer","minimum":1}}]},"post":{"operationId":"createToken","summary":"Issue a Client Token; the secret is returned once","tags":["Clients"],"x-polypack-ability":"write","responses":{"201":{"description":"Issued","content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/IssuedToken"}}}}}},"401":{"description":"No active API key.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"},"description":"Bearer realm=\"PolyPack API\""}}},"403":{"description":"The key may not do this, or the Team is suspended.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"429":{"description":"Rate limited.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer"}}}},"404":{"description":"Not found, or another Team's.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"422":{"description":"Validation failed, or a Plan limit was reached.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}},"parameters":[{"name":"client","in":"path","required":true,"description":"A Client's id","schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/TokenInput"}}}}}},"\/clients\/{client}\/tokens\/{token}":{"delete":{"operationId":"deleteToken","summary":"Revoke a Client Token","tags":["Clients"],"x-polypack-ability":"write","responses":{"204":{"description":"Revoked"},"401":{"description":"No active API key.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"},"description":"Bearer realm=\"PolyPack API\""}}},"403":{"description":"The key may not do this, or the Team is suspended.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"429":{"description":"Rate limited.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer"}}}},"404":{"description":"Not found, or another Team's.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}},"parameters":[{"name":"client","in":"path","required":true,"description":"A Client's id","schema":{"type":"integer"}},{"name":"token","in":"path","required":true,"description":"A Token's id","schema":{"type":"integer"}}]}},"\/clients\/{client}\/download-links":{"get":{"operationId":"listDownloadLinks","summary":"A Client's Download links (never their URLs)","tags":["Clients"],"x-polypack-ability":"read","responses":{"200":{"description":"A page of Download links","content":{"application\/json":{"schema":{"type":"object","required":["data","meta","links"],"properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/DownloadLink"}},"meta":{"$ref":"#\/components\/schemas\/PageMeta"},"links":{"$ref":"#\/components\/schemas\/PageLinks"}}}}}},"401":{"description":"No active API key.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"},"description":"Bearer realm=\"PolyPack API\""}}},"403":{"description":"The key may not do this, or the Team is suspended.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"429":{"description":"Rate limited.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer"}}}},"404":{"description":"Not found, or another Team's.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}},"parameters":[{"name":"client","in":"path","required":true,"description":"A Client's id","schema":{"type":"integer"}},{"name":"page","in":"query","schema":{"type":"integer","minimum":1}}]},"post":{"operationId":"createDownloadLink","summary":"Make a Download link for one Version; its url is returned once","tags":["Clients"],"x-polypack-ability":"write","responses":{"201":{"description":"Made","content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/IssuedDownloadLink"}}}}}},"401":{"description":"No active API key.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"},"description":"Bearer realm=\"PolyPack API\""}}},"403":{"description":"The key may not do this, or the Team is suspended.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"429":{"description":"Rate limited.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer"}}}},"404":{"description":"Not found, or another Team's.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"422":{"description":"Validation failed, the Client cannot install that Version, or it is an image.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}},"parameters":[{"name":"client","in":"path","required":true,"description":"A Client's id","schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/DownloadLinkInput"}}}}}},"\/clients\/{client}\/download-links\/{downloadLink}":{"delete":{"operationId":"deleteDownloadLink","summary":"Revoke a Download link","tags":["Clients"],"x-polypack-ability":"write","responses":{"204":{"description":"Revoked"},"401":{"description":"No active API key.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"},"description":"Bearer realm=\"PolyPack API\""}}},"403":{"description":"The key may not do this, or the Team is suspended.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"429":{"description":"Rate limited.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer"}}}},"404":{"description":"Not found, or another Team's.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}},"parameters":[{"name":"client","in":"path","required":true,"description":"A Client's id","schema":{"type":"integer"}},{"name":"downloadLink","in":"path","required":true,"description":"A Download link's id","schema":{"type":"integer"}}]}},"\/openapi.json":{"get":{"operationId":"getOpenApi","summary":"This description","tags":["Meta"],"security":[],"x-polypack-ability":"none","responses":{"200":{"description":"OpenAPI 3.1"}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","bearerFormat":"polypack_key_\u2026","description":"An API key from the Team panel: Access \u2192 API keys."}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["unauthenticated","forbidden","team_suspended","ip_not_allowed","not_found","method_not_allowed","validation_failed","limit_reached","refused","rate_limited","server_error"],"description":"What scripts match on. More codes may be added."},"message":{"type":"string","description":"For people; may be reworded."},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}}}},"PageMeta":{"type":"object","properties":{"page":{"type":"integer"},"per_page":{"type":"integer"},"total":{"type":"integer"},"last_page":{"type":"integer"}}},"PageLinks":{"type":"object","properties":{"next":{"type":["string","null"]},"prev":{"type":["string","null"]}}},"Usage":{"type":"object","properties":{"used":{"type":"integer"},"limit":{"type":["integer","null"],"description":"null: unlimited"}}},"Team":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"},"suspended":{"type":"boolean"},"plan":{"type":"object","properties":{"name":{"type":"string"},"ecosystems":{"type":"array","items":{"type":"string","enum":["composer","npm","oci"]}},"single_sign_on":{"type":"boolean"},"branding":{"type":"boolean","description":"Whether the Plan includes branding Client handoffs (step 81)."}}},"usage":{"type":"object","properties":{"packs":{"$ref":"#\/components\/schemas\/Usage"},"clients":{"$ref":"#\/components\/schemas\/Usage"},"members":{"$ref":"#\/components\/schemas\/Usage"},"dist_bytes":{"$ref":"#\/components\/schemas\/Usage"},"image_bytes":{"$ref":"#\/components\/schemas\/Usage"}}}}},"Version":{"type":"object","properties":{"id":{"type":"integer"},"version":{"type":"string"},"released_at":{"type":["string","null"],"format":"date-time"},"deprecated":{"type":["string","null"]},"git_ref":{"type":["string","null"]}}},"Pack":{"type":"object","properties":{"id":{"type":"integer"},"ecosystem":{"type":"string","enum":["composer","npm","oci"]},"name":{"type":"string"},"visibility":{"type":"string","enum":["private","public"]},"description":{"type":["string","null"]},"abandoned":{"type":"boolean"},"labels":{"type":"array","items":{"type":"string"},"description":"Free-form labels set by the Team's Admins, sorted (step 82)."},"created_at":{"type":["string","null"],"format":"date-time"},"versions":{"type":"array","items":{"$ref":"#\/components\/schemas\/Version"},"description":"Only on GET \/packs\/{pack}."}}},"PackRef":{"type":"object","properties":{"id":{"type":"integer"},"ecosystem":{"type":"string"},"name":{"type":"string"}}},"Grant":{"type":"object","properties":{"id":{"type":"integer"},"client_id":{"type":"integer"},"product_grant_id":{"type":["integer","null"],"description":"Set on a Grant that comes from a Product: change it through that Product Grant."},"pack":{"$ref":"#\/components\/schemas\/PackRef"},"ends_on":{"type":["string","null"],"format":"date"},"updates_until":{"type":["string","null"],"format":"date"},"version_constraint":{"type":["string","null"]},"status":{"type":"string","enum":["active","ends_soon","ended"]},"created_at":{"type":["string","null"],"format":"date-time"}}},"Token":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"display":{"type":"string","description":"polypack_\u2026a1b2"},"abilities":{"type":"array","items":{"type":"string"}},"expires_at":{"type":["string","null"],"format":"date-time"},"last_used_at":{"type":["string","null"],"format":"date-time"},"revoked_at":{"type":["string","null"],"format":"date-time"},"active":{"type":"boolean"},"created_at":{"type":["string","null"],"format":"date-time"},"allowed_ips":{"type":["array","null"],"items":{"type":"string"},"description":"Where it may be used from: for a Client Token, its Client's list; null: anywhere."},"last_refused_at":{"type":["string","null"],"format":"date-time","description":"When it was last refused for its address."},"last_refused_ip":{"type":["string","null"]}}},"IssuedToken":{"allOf":[{"$ref":"#\/components\/schemas\/Token"},{"type":"object","properties":{"secret":{"type":"string","description":"Shown once."},"setup":{"type":["string","null"],"description":"The Client's setup instructions, with the secret filled in."}}}]},"Client":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"notes":{"type":["string","null"]},"created_at":{"type":["string","null"],"format":"date-time"},"grants":{"type":"array","items":{"$ref":"#\/components\/schemas\/Grant"}},"tokens":{"type":"array","items":{"$ref":"#\/components\/schemas\/Token"}},"allowed_ips":{"type":["array","null"],"items":{"type":"string"},"description":"The addresses all of this Client's Tokens may be used from; null: anywhere."}}},"PackDownloads":{"type":"object","properties":{"pack_id":{"type":"integer"},"days":{"type":"integer"},"total":{"type":"integer"},"total_kept":{"type":"integer"},"daily":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"count":{"type":"integer"}}}}}},"ClientDownloads":{"type":"object","properties":{"client_id":{"type":"integer"},"days":{"type":"integer"},"packs":{"type":"array","items":{"type":"object","properties":{"pack":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":["string","null"]}}},"total":{"type":"integer"},"last_download_on":{"type":"string","format":"date"}}}}}},"ClientInput":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"notes":{"type":["string","null"]},"allowed_ips":{"type":["array","null"],"items":{"type":"string"},"description":"Addresses or CIDR ranges, IPv4 or IPv6; null: anywhere (step 44)."}}},"ClientPatch":{"type":"object","properties":{"name":{"type":"string"},"notes":{"type":["string","null"]},"allowed_ips":{"type":["array","null"],"items":{"type":"string"},"description":"Addresses or CIDR ranges, IPv4 or IPv6; null: anywhere (step 44)."}}},"GrantInput":{"type":"object","required":["pack_id"],"properties":{"pack_id":{"type":"integer"},"ends_on":{"type":["string","null"],"format":"date"},"updates_until":{"type":["string","null"],"format":"date"},"version_constraint":{"type":["string","null"],"description":"Composer syntax, e.g. ^1.0"}}},"GrantPatch":{"type":"object","properties":{"ends_on":{"type":["string","null"],"format":"date"},"updates_until":{"type":["string","null"],"format":"date"},"version_constraint":{"type":["string","null"]}}},"TokenInput":{"type":"object","required":["name"],"properties":{"name":{"type":"string","maxLength":100},"expires_at":{"type":["string","null"],"format":"date-time"}}},"ProductRef":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"}}},"Product":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"description":{"type":["string","null"]},"default_terms":{"type":"object","properties":{"access_months":{"type":["integer","null"]},"updates_months":{"type":["integer","null"]},"version_constraint":{"type":["string","null"]}}},"packs":{"type":"array","items":{"$ref":"#\/components\/schemas\/PackRef"},"description":"On GET \/v1\/products\/{product} only."},"created_at":{"type":["string","null"],"format":"date-time"}}},"ProductGrant":{"type":"object","properties":{"id":{"type":"integer"},"client_id":{"type":"integer"},"product":{"$ref":"#\/components\/schemas\/ProductRef"},"ends_on":{"type":["string","null"],"format":"date"},"updates_until":{"type":["string","null"],"format":"date"},"version_constraint":{"type":["string","null"]},"status":{"type":"string","enum":["active","ends_soon","ended"]},"created_at":{"type":["string","null"],"format":"date-time"}}},"ProductGrantInput":{"type":"object","required":["product_id"],"properties":{"product_id":{"type":"integer"},"ends_on":{"type":["string","null"],"format":"date"},"updates_until":{"type":["string","null"],"format":"date"},"version_constraint":{"type":["string","null"],"description":"Composer syntax, e.g. ^1.0"}}},"PackAdoption":{"type":"object","properties":{"pack_id":{"type":"integer"},"days":{"type":"integer"},"callers":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["client","team","anonymous"]},"client":{"type":["object","null"],"properties":{"id":{"type":"integer"},"name":{"type":"string"}}},"newest":{"type":["string","null"]},"oldest":{"type":["string","null"]},"versions":{"type":"array","items":{"type":"object","properties":{"version":{"type":["string","null"],"description":"null: a removed Version"},"downloads":{"type":"integer"},"last_download":{"type":"string","format":"date"}}}},"last_download":{"type":"string","format":"date"}}}},"lines":{"type":"array","items":{"type":"object","properties":{"line":{"type":"string","description":"2.x, 0.3.x, or Other"},"clients":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"}}}}}}}}},"DownloadLink":{"type":"object","properties":{"id":{"type":"integer"},"pack_id":{"type":"integer"},"pack":{"type":"string"},"version":{"type":"string"},"status":{"type":"string","enum":["active","expired","used_up","revoked"],"description":"A link that is active can still stop working when the Client's Grant no longer allows the Version."},"expires_at":{"type":"string","format":"date-time"},"max_downloads":{"type":["integer","null"]},"downloads":{"type":"integer"},"note":{"type":["string","null"]},"last_used_at":{"type":["string","null"],"format":"date-time"},"revoked_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":["string","null"],"format":"date-time"}}},"IssuedDownloadLink":{"allOf":[{"$ref":"#\/components\/schemas\/DownloadLink"},{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri","description":"https:\/\/{team}.pkg.polypack.io\/-\/links\/polypack_link_\u2026: shown only here. Send it to the Client."}}}]},"DownloadLinkInput":{"type":"object","required":["pack_id","version"],"properties":{"pack_id":{"type":"integer"},"version":{"type":"string","description":"A published Version the Client may install today. Not an image."},"expires_at":{"type":"string","format":"date-time","description":"1 hour to 30 days from now. Or give expires_in_hours."},"expires_in_hours":{"type":"integer","minimum":1,"maximum":720},"max_downloads":{"type":["integer","null"],"minimum":1,"maximum":1000},"note":{"type":["string","null"],"maxLength":200}}}}}}