{"openapi":"3.1.0","info":{"description":"This page describes the format for the current Hangar REST API as well as general usage guidelines.<br>\nNote that all routes **not** listed here should be considered **internal**, and can change at a moment's notice. **Do not use them**.\n\n## Authentication and Authorization\nThere are two ways to consume the API: Authenticated or anonymous.\n\n### Anonymous\nWhen using anonymous authentication, you only have access to public information, but you don't need to worry about creating and storing an API key or handing JWTs.\n\n### Authenticated\nIf you need access to non-public content or actions, you need to create and use API keys.\nThese can be created by going to the API keys page via the profile dropdown or by going to your user page and clicking on the key icon.\n\nAPI keys allow you to impersonate yourself, so they should be handled like passwords. **Do not share them with anyone else!**\n\n#### Getting and Using a JWT\nOnce you have an API key, you need to authenticate yourself: Send a `POST` request with your API key identifier to `/api/v1/authenticate?apiKey=yourKey`.\nThe response will contain your JWT as well as an expiration time.\nPut this JWT into the `Authorization` header of every request and make sure to request a new JWT after the expiration time has passed.\n\nPlease also set a meaningful `User-Agent` header. This allows us to better identify loads and needs for potentially new endpoints.\n\n## Misc\n### Date Formats\nStandard ISO types. Where possible, we use the [OpenAPI format modifier](https://swagger.io/docs/specification/data-models/data-types/#format).\n\n### Rate Limits and Caching\nThe default rate limit is set at 20 requests every 5 seconds with an initial overdraft for extra leniency.\nIndividual endpoints, such as version creation, may have stricter rate limiting.\n\nIf applicable, always cache responses. The Hangar API itself is cached by CloudFlare and internally.","title":"Hangar API","version":"1.0"},"servers":[{"url":"https://hangar.papermc.io","description":"Generated server url"}],"paths":{"/api/v1/authenticate":{"post":{"description":"`Log-in` with your API key in order to be able to call other endpoints authenticated. The returned JWT should be specified as a header in all following requests: `Authorization: HangarAuth your.jwt`","operationId":"authenticate","parameters":[{"description":"JWT","in":"query","name":"apiKey","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiSession"}}},"description":"Ok"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiSession"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiSession"}}},"description":"Api key missing or invalid"}},"summary":"Creates an API JWT","tags":["Authentication"]}},"/api/v1/authors":{"get":{"description":"Returns all users that have at least one public project. Requires the `view_public_info` permission.","operationId":"getAuthors","parameters":[{"description":"The search query","in":"query","name":"query","required":true,"schema":{"type":"string"}},{"description":"Used to sort the result","in":"query","name":"sort","schema":{"type":"string","enum":["name","createdAt","projectCount"]},"style":"form"},{"description":"The maximum amount of items to return","in":"query","name":"limit","required":false,"schema":{"type":"string","example":"1","maximum":25,"minimum":1},"style":"form"},{"description":"Where to start searching","in":"query","name":"offset","required":false,"schema":{"type":"string","example":"0","minimum":0},"style":"form"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResultUser"}}},"description":"Ok"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResultUser"}}},"description":"Api session missing, invalid or expired"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResultUser"}}},"description":"Not enough permissions to use this endpoint"}},"security":[{"HangarAuth":["view_public_info"]}],"summary":"Returns all users with at least one public project","tags":["Users"]}},"/api/v1/keys":{"delete":{"description":"Deletes an API key. Requires the `edit_api_keys` permission.","operationId":"deleteKey","parameters":[{"description":"The name of the key to delete","in":"query","name":"name","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Key deleted"},"401":{"description":"Api session missing, invalid or expired"},"403":{"description":"Not enough permissions to use this endpoint"}},"security":[{"HangarAuth":["edit_api_keys"]}],"summary":"Deletes an API key","tags":["API Keys"]},"get":{"description":"Fetches a list of API Keys. Requires the `edit_api_keys` permission.","operationId":"getKeys","responses":{"200":{"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ApiKey"}}}},"description":"The keys"},"401":{"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ApiKey"}}}},"description":"Api session missing, invalid or expired"},"403":{"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ApiKey"}}}},"description":"Not enough permissions to use this endpoint"}},"security":[{"HangarAuth":["edit_api_keys"]}],"summary":"Fetches a list of API Keys","tags":["API Keys"]},"post":{"description":"Creates an API key. Requires the `edit_api_keys` permission.","operationId":"createKey","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAPIKeyForm"}}},"required":true},"responses":{"201":{"content":{"text/plain":{"schema":{"type":"string"}}},"description":"Key created"},"401":{"content":{"text/plain":{"schema":{"type":"string"}}},"description":"Api session missing, invalid or expired"},"403":{"content":{"text/plain":{"schema":{"type":"string"}}},"description":"Not enough permissions to use this endpoint"}},"security":[{"HangarAuth":["edit_api_keys"]}],"summary":"Creates an API key","tags":["API Keys"]}},"/api/v1/pages/edit/{author}/{project}":{"patch":{"deprecated":true,"operationId":"editPage_1","parameters":[{"description":"The author of the project to change the page for","in":"path","name":"author","required":true,"schema":{"type":"string"}},{"description":"The slug or id of the project to change the page for","in":"path","name":"project","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageEditForm"}}},"required":true},"responses":{"200":{"description":"OK"}},"tags":["Pages"]}},"/api/v1/pages/edit/{project}":{"patch":{"description":"Edits a page of a project. Requires the `edit_page` permission in the project or owning organization.","operationId":"editPage","parameters":[{"description":"The slug or id of the project to change the page for","in":"path","name":"project","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageEditForm"}}},"required":true},"responses":{"200":{"description":"Ok"},"401":{"description":"Api session missing, invalid or expired"},"403":{"description":"Not enough permissions to use this endpoint"}},"security":[{"HangarAuth":["edit_page"]}],"summary":"Edits a page of a project","tags":["Pages"]}},"/api/v1/pages/editmain/{author}/{project}":{"patch":{"deprecated":true,"operationId":"editMainPage_1","parameters":[{"description":"The author of the project to change the page for","in":"path","name":"author","required":true,"schema":{"type":"string"}},{"description":"The slug or id of the project to change the page for","in":"path","name":"project","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StringContent"}}},"required":true},"responses":{"200":{"description":"OK"}},"tags":["Pages"]}},"/api/v1/pages/editmain/{project}":{"patch":{"description":"Edits the main page of a project. Requires the `edit_page` permission in the project or owning organization.","operationId":"editMainPage","parameters":[{"description":"The slug or id of the project to change the page for","in":"path","name":"project","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StringContent"}}},"required":true},"responses":{"200":{"description":"Ok"},"401":{"description":"Api session missing, invalid or expired"},"403":{"description":"Not enough permissions to use this endpoint"}},"security":[{"HangarAuth":["edit_page"]}],"summary":"Edits the main page of a project","tags":["Pages"]}},"/api/v1/pages/main/{author}/{project}":{"get":{"deprecated":true,"operationId":"getMainPage_1","parameters":[{"description":"The author of the project to return the page for","in":"path","name":"author","required":true,"schema":{"type":"string"}},{"description":"The slug or id of the project to return the page for","in":"path","name":"project","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"text/plain":{"schema":{"type":"string"}}},"description":"OK"}},"tags":["Pages"]}},"/api/v1/pages/main/{project}":{"get":{"description":"Returns the main page of a project. Requires visibility of the page.","operationId":"getMainPage","parameters":[{"description":"The slug or id of the project to return the page for","in":"path","name":"project","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"text/plain":{"schema":{"type":"string"}}},"description":"Ok"},"401":{"content":{"text/plain":{"schema":{"type":"string"}}},"description":"Api session missing, invalid or expired"},"403":{"content":{"text/plain":{"schema":{"type":"string"}}},"description":"Not enough permissions to use this endpoint"}},"summary":"Returns the main page of a project","tags":["Pages"]}},"/api/v1/pages/page/{author}/{project}":{"get":{"deprecated":true,"operationId":"getPage_1","parameters":[{"description":"The author of the project to return the page for","in":"path","name":"author","required":true,"schema":{"type":"string"}},{"description":"The slug or id of the project to return the page for","in":"path","name":"project","required":true,"schema":{"type":"string"}},{"description":"The path of the page","in":"query","name":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"text/plain":{"schema":{"type":"string"}}},"description":"OK"}},"tags":["Pages"]}},"/api/v1/pages/page/{project}":{"get":{"description":"Returns a page of a project. Requires visibility of the page.","operationId":"getPage","parameters":[{"description":"The slug or id of the project to return the page for","in":"path","name":"project","required":true,"schema":{"type":"string"}},{"description":"The path of the page","in":"query","name":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"text/plain":{"schema":{"type":"string"}}},"description":"Ok"},"401":{"content":{"text/plain":{"schema":{"type":"string"}}},"description":"Api session missing, invalid or expired"},"403":{"content":{"text/plain":{"schema":{"type":"string"}}},"description":"Not enough permissions to use this endpoint"}},"summary":"Returns a page of a project","tags":["Pages"]}},"/api/v1/permissions":{"get":{"description":"Returns a list of permissions you have in the given context","operationId":"showPermissions","parameters":[{"deprecated":true,"description":"Deprecated alias for `project`","in":"query","name":"slug","required":false,"schema":{"type":"string"}},{"description":"The id or name of the organization to check permissions in. Must not be used together with `project`","in":"query","name":"organization","required":false,"schema":{"type":"string"}},{"description":"The id or slug of the project to check permissions in. Must not be used together with `organization`","in":"query","name":"project","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserPermissions"}}},"description":"Ok"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserPermissions"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserPermissions"}}},"description":"Api session missing, invalid or expired"}},"security":[{"HangarAuth":[]}],"summary":"Returns your permissions","tags":["Permissions"]}},"/api/v1/permissions/hasAll":{"get":{"description":"Checks whether you have all the provided permissions in the given context","operationId":"hasAll","parameters":[{"description":"The permissions to check","in":"query","name":"permissions","required":true,"schema":{"type":"array","items":{"$ref":"#/components/schemas/NamedPermission"},"maxItems":50,"minItems":0,"uniqueItems":true}},{"deprecated":true,"description":"Deprecated alias for `project`","in":"query","name":"slug","required":false,"schema":{"type":"string"}},{"description":"The id or name of the organization to check permissions in. Must not be used together with `slug`","in":"query","name":"organization","required":false,"schema":{"type":"string"}},{"description":"The id or slug of the project to check permissions in. Must not be used together with `organization`","in":"query","name":"project","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PermissionCheck"}}},"description":"Ok"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PermissionCheck"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PermissionCheck"}}},"description":"Api session missing, invalid or expired"}},"security":[{"HangarAuth":[]}],"summary":"Checks whether you have all the provided permissions","tags":["Permissions"]}},"/api/v1/permissions/hasAny":{"get":{"description":"Checks whether you have at least one of the provided permissions in the given context","operationId":"hasAny","parameters":[{"description":"The permissions to check","in":"query","name":"permissions","required":true,"schema":{"type":"array","items":{"$ref":"#/components/schemas/NamedPermission"},"uniqueItems":true}},{"deprecated":true,"description":"Deprecated alias for `project`","in":"query","name":"slug","required":false,"schema":{"type":"string"}},{"description":"The id or name of the organization to check permissions in. Must not be used together with `project`","in":"query","name":"organization","required":false,"schema":{"type":"string"}},{"description":"The id or slug of the project to check permissions in. Must not be used together with `organization`","in":"query","name":"project","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PermissionCheck"}}},"description":"Ok"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PermissionCheck"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PermissionCheck"}}},"description":"Api session missing, invalid or expired"}},"security":[{"HangarAuth":[]}],"summary":"Checks whether you have at least one of the provided permissions","tags":["Permissions"]}},"/api/v1/platforms/{platform}/versions":{"get":{"description":"Gets a list of platform versions, including children.","operationId":"getPlatformVersions","parameters":[{"description":"The platform to get versions for","in":"path","name":"platform","required":true,"schema":{"$ref":"#/components/schemas/Platform"}}],"responses":{"200":{"content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PlatformVersion"}}}},"description":"OK"}},"summary":"Gets a list of versions for a platform","tags":["Platforms","Platform versions"]}},"/api/v1/projects":{"get":{"description":"Searches all the projects on Hangar, or for a single user. Requires the `view_public_info` permission.","operationId":"getProjects","parameters":[{"deprecated":true,"description":"Whether to prioritize the project with an exact name match if present","in":"query","name":"prioritizeExactMatch","required":false,"schema":{"type":"boolean","default":true}},{"description":"Used to sort the result","in":"query","name":"sort","schema":{"type":"string","enum":["views","downloads","newest","stars","updated","recent_downloads","recent_views","slug"]},"style":"form"},{"description":"A category to filter for","in":"query","name":"category","schema":{"type":"string"},"style":"form"},{"description":"A platform to filter for","in":"query","name":"platform","schema":{"type":"string"},"style":"form"},{"description":"The author of the project","in":"query","name":"owner","schema":{"type":"string"},"style":"form"},{"description":"The query to use when searching","in":"query","name":"query","schema":{"type":"string"},"style":"form"},{"deprecated":true,"description":"Deprecated: Use 'query' instead","in":"query","name":"q","schema":{"type":"string"},"style":"form"},{"description":"A license to filter for","in":"query","name":"license","schema":{"type":"string"},"style":"form"},{"description":"A platform version to filter for","in":"query","name":"version","schema":{"type":"string"},"style":"form"},{"description":"A tag to filter for","in":"query","name":"tag","schema":{"type":"string"},"style":"form"},{"description":"The member of the project","in":"query","name":"member","schema":{"type":"string"},"style":"form"},{"description":"The maximum amount of items to return","in":"query","name":"limit","required":false,"schema":{"type":"string","example":"1","maximum":25,"minimum":1},"style":"form"},{"description":"Where to start searching","in":"query","name":"offset","required":false,"schema":{"type":"string","example":"0","minimum":0},"style":"form"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResultProject"}}},"description":"Ok"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResultProject"}}},"description":"Api session missing, invalid or expired"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResultProject"}}},"description":"Not enough permissions to use this endpoint"}},"security":[{"HangarAuth":["view_public_info"]}],"summary":"Searches the projects on Hangar","tags":["Projects"]}},"/api/v1/projects/{author}/{slugOrId}":{"get":{"deprecated":true,"operationId":"getProject_1","parameters":[{"description":"The author of the project to return","in":"path","name":"author","required":true,"schema":{"type":"string"}},{"description":"The slug or id of the project to return","in":"path","name":"slugOrId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}},"description":"OK"}},"tags":["Projects"]}},"/api/v1/projects/{author}/{slugOrId}/latest":{"get":{"deprecated":true,"operationId":"getLatestVersion","parameters":[{"description":"The author of the project to return the latest version for","in":"path","name":"author","required":true,"schema":{"type":"string"}},{"description":"The slug or id of the project to return the latest version for","in":"path","name":"slugOrId","required":true,"schema":{"type":"string"}},{"description":"The channel to return the latest version for","in":"query","name":"channel","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"text/plain":{"schema":{"type":"string"}}},"description":"OK"}},"tags":["Versions"]}},"/api/v1/projects/{author}/{slugOrId}/latestrelease":{"get":{"deprecated":true,"operationId":"getLatestReleaseVersion","parameters":[{"description":"The author of the project to return the latest version for","in":"path","name":"author","required":true,"schema":{"type":"string"}},{"description":"The slug or id of the project to return the latest version for","in":"path","name":"slugOrId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"text/plain":{"schema":{"type":"string"}}},"description":"OK"}},"tags":["Versions"]}},"/api/v1/projects/{author}/{slugOrId}/members":{"get":{"deprecated":true,"operationId":"getProjectMembers_1","parameters":[{"description":"The author of the project to return members for","in":"path","name":"author","required":true,"schema":{"type":"string"}},{"description":"The slug or id of the project to return members for","in":"path","name":"slugOrId","required":true,"schema":{"type":"string"}},{"description":"The maximum amount of items to return","in":"query","name":"limit","required":false,"schema":{"type":"string","example":"1","maximum":25,"minimum":1},"style":"form"},{"description":"Where to start searching","in":"query","name":"offset","required":false,"schema":{"type":"string","example":"0","minimum":0},"style":"form"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResultProjectMember"}}},"description":"OK"}},"tags":["Projects"]}},"/api/v1/projects/{author}/{slugOrId}/stargazers":{"get":{"deprecated":true,"operationId":"getProjectStargazers_1","parameters":[{"description":"The author of the project to return stargazers for","in":"path","name":"author","required":true,"schema":{"type":"string"}},{"description":"The slug or id of the project to return stargazers for","in":"path","name":"slugOrId","required":true,"schema":{"type":"string"}},{"description":"The maximum amount of items to return","in":"query","name":"limit","required":false,"schema":{"type":"string","example":"1","maximum":25,"minimum":1},"style":"form"},{"description":"Where to start searching","in":"query","name":"offset","required":false,"schema":{"type":"string","example":"0","minimum":0},"style":"form"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResultUser"}}},"description":"OK"}},"tags":["Projects"]}},"/api/v1/projects/{author}/{slugOrId}/stats":{"get":{"deprecated":true,"operationId":"getProjectStats","parameters":[{"description":"The author of the project to return stats for","in":"path","name":"author","required":true,"schema":{"type":"string"}},{"description":"The slug or id of the project to return stats for","in":"path","name":"slugOrId","required":true,"schema":{"type":"string"}},{"description":"The first date to include in the result","in":"query","name":"fromDate","required":true,"schema":{"type":"string","format":"date-time"}},{"description":"The last date to include in the result","in":"query","name":"toDate","required":true,"schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/DayProjectStats"}}}},"description":"OK"}},"tags":["Projects"]}},"/api/v1/projects/{author}/{slugOrId}/upload":{"post":{"deprecated":true,"operationId":"uploadVersion_1","parameters":[{"description":"The author of the project to return versions for","in":"path","name":"author","required":true,"schema":{"type":"string"}},{"description":"The slug or id of the project to return versions for","in":"path","name":"slugOrId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","description":"The version files in order of selected platforms, if any","items":{"type":"string","format":"binary"}},"versionUpload":{"$ref":"#/components/schemas/VersionUpload"}},"required":["versionUpload"]}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadedVersion"}}},"description":"OK"}},"tags":["Versions"]}},"/api/v1/projects/{author}/{slugOrId}/versions":{"get":{"deprecated":true,"operationId":"getVersions","parameters":[{"description":"The author of the project to return versions for","in":"path","name":"author","required":true,"schema":{"type":"string"}},{"description":"The slug or id of the project to return versions for","in":"path","name":"slugOrId","required":true,"schema":{"type":"string"}},{"description":"A name of a version channel to filter for","in":"query","name":"channel","schema":{"type":"string"},"style":"form"},{"description":"A platform name to filter for","in":"query","name":"platform","schema":{"type":"string"},"style":"form"},{"description":"A platform version to filter for","in":"query","name":"platformVersion","schema":{"type":"string"},"style":"form"},{"description":"The maximum amount of items to return","in":"query","name":"limit","required":false,"schema":{"type":"string","example":"1","maximum":25,"minimum":1},"style":"form"},{"description":"Where to start searching","in":"query","name":"offset","required":false,"schema":{"type":"string","example":"0","minimum":0},"style":"form"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResultVersion"}}},"description":"OK"}},"tags":["Versions"]}},"/api/v1/projects/{author}/{slugOrId}/versions/{nameOrId}":{"get":{"deprecated":true,"operationId":"getVersion","parameters":[{"description":"The author of the project to return the version for","in":"path","name":"author","required":true,"schema":{"type":"string"}},{"description":"The slug or id of the project to return the version for","in":"path","name":"slugOrId","required":true,"schema":{"type":"string"}},{"description":"The name of the version to return","in":"path","name":"nameOrId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Version"}}},"description":"OK"}},"tags":["Versions"]}},"/api/v1/projects/{author}/{slugOrId}/versions/{nameOrId}/stats":{"get":{"deprecated":true,"operationId":"getVersionStats","parameters":[{"description":"The author of the version to return the stats for","in":"path","name":"author","required":true,"schema":{"type":"string"}},{"description":"The slug or id of the project to return stats for","in":"path","name":"slugOrId","required":true,"schema":{"type":"string"}},{"description":"The name or id of the version to return the stats for","in":"path","name":"nameOrId","required":true,"schema":{"type":"string"}},{"description":"The first date to include in the result","in":"query","name":"fromDate","required":true,"schema":{"type":"string","format":"date-time"}},{"description":"The last date to include in the result","in":"query","name":"toDate","required":true,"schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/VersionStats"}}}},"description":"OK"}},"tags":["Versions"]}},"/api/v1/projects/{author}/{slugOrId}/versions/{nameOrId}/{platform}/download":{"get":{"deprecated":true,"operationId":"downloadVersion_1","parameters":[{"description":"The author of the project to download the version from","in":"path","name":"author","required":true,"schema":{"type":"string"}},{"description":"The slug or id of the project to download the version from","in":"path","name":"slugOrId","required":true,"schema":{"type":"string"}},{"description":"The name of the version to download","in":"path","name":"nameOrId","required":true,"schema":{"type":"string"}},{"description":"The platform of the version to download","in":"path","name":"platform","required":true,"schema":{"$ref":"#/components/schemas/Platform"}}],"responses":{"200":{"content":{"application/octet-stream":{"schema":{"type":"object"}}},"description":"OK"}},"tags":["Versions"]}},"/api/v1/projects/{author}/{slugOrId}/watchers":{"get":{"deprecated":true,"operationId":"getProjectWatchers_1","parameters":[{"description":"The author of the project to return watchers for","in":"path","name":"author","required":true,"schema":{"type":"string"}},{"description":"The slug or id of the project to return watchers for","in":"path","name":"slugOrId","required":true,"schema":{"type":"string"}},{"description":"The maximum amount of items to return","in":"query","name":"limit","required":false,"schema":{"type":"string","example":"1","maximum":25,"minimum":1},"style":"form"},{"description":"Where to start searching","in":"query","name":"offset","required":false,"schema":{"type":"string","example":"0","minimum":0},"style":"form"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResultUser"}}},"description":"OK"}},"tags":["Projects"]}},"/api/v1/projects/{slugOrId}":{"get":{"description":"Returns info on a specific project. Requires the `view_public_info` permission.","operationId":"getProject","parameters":[{"description":"The slug or id or id of the project to return","in":"path","name":"slugOrId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}},"description":"Ok"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}},"description":"Api session missing, invalid or expired"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}},"description":"Not enough permissions to use this endpoint"}},"security":[{"HangarAuth":["view_public_info"]}],"summary":"Returns info on a specific project","tags":["Projects"]}},"/api/v1/projects/{slugOrId}/latest":{"get":{"description":"Returns the latest version of a project. Requires the `view_public_info` permission in the project or owning organization.","operationId":"latestVersion","parameters":[{"description":"The slug or id of the project to return the latest version for","in":"path","name":"slugOrId","required":true,"schema":{"type":"string"}},{"description":"The channel to return the latest version for","in":"query","name":"channel","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"text/plain":{"schema":{"type":"string"}}},"description":"Ok"},"401":{"content":{"text/plain":{"schema":{"type":"string"}}},"description":"Api session missing, invalid or expired"},"403":{"content":{"text/plain":{"schema":{"type":"string"}}},"description":"Not enough permissions to use this endpoint"}},"security":[{"HangarAuth":["view_public_info"]}],"summary":"Returns the latest version of a project for a specific channel","tags":["Versions"]}},"/api/v1/projects/{slugOrId}/latestrelease":{"get":{"description":"Returns the latest version of a project. Requires the `view_public_info` permission in the project or owning organizations.","operationId":"latestReleaseVersion","parameters":[{"description":"The slug or id of the project to return the latest version for","in":"path","name":"slugOrId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"text/plain":{"schema":{"type":"string"}}},"description":"Ok"},"401":{"content":{"text/plain":{"schema":{"type":"string"}}},"description":"Api session missing, invalid or expired"},"403":{"content":{"text/plain":{"schema":{"type":"string"}}},"description":"Not enough permissions to use this endpoint"}},"security":[{"HangarAuth":["view_public_info"]}],"summary":"Returns the latest release version of a project","tags":["Versions"]}},"/api/v1/projects/{slugOrId}/members":{"get":{"description":"Returns the members of a project. Requires the `view_public_info` permission.","operationId":"getProjectMembers","parameters":[{"description":"The slug or id of the project to return members for","in":"path","name":"slugOrId","required":true,"schema":{"type":"string"}},{"description":"The maximum amount of items to return","in":"query","name":"limit","required":false,"schema":{"type":"string","example":"1","maximum":25,"minimum":1},"style":"form"},{"description":"Where to start searching","in":"query","name":"offset","required":false,"schema":{"type":"string","example":"0","minimum":0},"style":"form"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResultProjectMember"}}},"description":"Ok"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResultProjectMember"}}},"description":"Api session missing, invalid or expired"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResultProjectMember"}}},"description":"Not enough permissions to use this endpoint"}},"security":[{"HangarAuth":["view_public_info"]}],"summary":"Returns the members of a project","tags":["Projects"]}},"/api/v1/projects/{slugOrId}/stargazers":{"get":{"description":"Returns the stargazers of a project. Requires the `view_public_info` permission.","operationId":"getProjectStargazers","parameters":[{"description":"The slug or id of the project to return stargazers for","in":"path","name":"slugOrId","required":true,"schema":{"type":"string"}},{"description":"The maximum amount of items to return","in":"query","name":"limit","required":false,"schema":{"type":"string","example":"1","maximum":25,"minimum":1},"style":"form"},{"description":"Where to start searching","in":"query","name":"offset","required":false,"schema":{"type":"string","example":"0","minimum":0},"style":"form"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResultUser"}}},"description":"Ok"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResultUser"}}},"description":"Api session missing, invalid or expired"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResultUser"}}},"description":"Not enough permissions to use this endpoint"}},"security":[{"HangarAuth":["view_public_info"]}],"summary":"Returns the stargazers of a project","tags":["Projects"]}},"/api/v1/projects/{slugOrId}/stats":{"get":{"description":"Returns the stats (downloads and views) for a project per day for a certain date range. Requires the `is_subject_member` permission.","operationId":"showProjectStats","parameters":[{"description":"The slug or id of the project to return stats for","in":"path","name":"slugOrId","required":true,"schema":{"type":"string"}},{"description":"The first date to include in the result","in":"query","name":"fromDate","required":true,"schema":{"type":"string","format":"date-time"}},{"description":"The last date to include in the result","in":"query","name":"toDate","required":true,"schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/DayProjectStats"}}}},"description":"Ok"},"401":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/DayProjectStats"}}}},"description":"Api session missing, invalid or expired"},"403":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/DayProjectStats"}}}},"description":"Not enough permissions to use this endpoint"}},"security":[{"HangarAuth":["is_subject_member"]}],"summary":"Returns the stats for a project","tags":["Projects"]}},"/api/v1/projects/{slugOrId}/upload":{"post":{"description":"Creates a new version for a project. Requires the `create_version` permission in the project or owning organization.\nMake sure you provide the contents of this request as multipart/form-data.\nYou can find a simple example implementation written in Java here: https://gist.github.com/kennytv/a227d82249f54e0ad35005330256fee2","operationId":"uploadVersion","parameters":[{"description":"The slug or id of the project to return versions for","in":"path","name":"slugOrId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"multipart/form-data":{"encoding":{"versionUpload":{"contentType":"application/json"}},"schema":{"type":"object","properties":{"files":{"type":"array","description":"The version files in order of selected platforms, if any","items":{"type":"string","format":"binary"}},"versionUpload":{"$ref":"#/components/schemas/VersionUpload"}},"required":["versionUpload"]}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadedVersion"}}},"description":"Ok"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadedVersion"}}},"description":"Api session missing, invalid or expired"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadedVersion"}}},"description":"Not enough permissions to use this endpoint"}},"security":[{"HangarAuth":["create_version"]}],"summary":"Creates a new version and returns parts of its metadata","tags":["Versions"]}},"/api/v1/projects/{slugOrId}/versions":{"get":{"description":"Returns all versions of a project. Requires the `view_public_info` permission in the project or owning organization.","operationId":"listVersions","parameters":[{"description":"The slug or id of the project to return versions for","in":"path","name":"slugOrId","required":true,"schema":{"type":"string"}},{"description":"Whether to include hidden-by-default channels in the result, defaults to true","in":"query","name":"includeHiddenChannels","required":false,"schema":{"type":"boolean","default":true}},{"description":"A name of a version channel to filter for","in":"query","name":"channel","schema":{"type":"string"},"style":"form"},{"description":"A platform name to filter for","in":"query","name":"platform","schema":{"type":"string"},"style":"form"},{"description":"A platform version to filter for","in":"query","name":"platformVersion","schema":{"type":"string"},"style":"form"},{"description":"The maximum amount of items to return","in":"query","name":"limit","required":false,"schema":{"type":"string","example":"1","maximum":25,"minimum":1},"style":"form"},{"description":"Where to start searching","in":"query","name":"offset","required":false,"schema":{"type":"string","example":"0","minimum":0},"style":"form"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResultVersion"}}},"description":"Ok"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResultVersion"}}},"description":"Api session missing, invalid or expired"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResultVersion"}}},"description":"Not enough permissions to use this endpoint"}},"security":[{"HangarAuth":["view_public_info"]}],"summary":"Returns all versions of a project","tags":["Versions"]}},"/api/v1/projects/{slugOrId}/versions/{nameOrId}":{"get":{"description":"Returns a specific version of a project. Requires the `view_public_info` permission in the project or owning organization.","operationId":"showVersion","parameters":[{"description":"The slug or id of the project to return the version for","in":"path","name":"slugOrId","required":true,"schema":{"type":"string"}},{"description":"The name or id of the version to return","in":"path","name":"nameOrId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Version"}}},"description":"Ok"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Version"}}},"description":"Api session missing, invalid or expired"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Version"}}},"description":"Not enough permissions to use this endpoint"}},"security":[{"HangarAuth":["view_public_info"]}],"summary":"Returns a specific version of a project","tags":["Versions"]}},"/api/v1/projects/{slugOrId}/versions/{nameOrId}/stats":{"get":{"description":"Returns the stats (downloads) for a version per day for a certain date range. Requires the `is_subject_member` permission.","operationId":"showVersionStats","parameters":[{"description":"The slug or id of the project to return stats for","in":"path","name":"slugOrId","required":true,"schema":{"type":"string"}},{"description":"The version to return the stats for","in":"path","name":"nameOrId","required":true,"schema":{"type":"string"}},{"description":"The first date to include in the result","in":"query","name":"fromDate","required":true,"schema":{"type":"string","format":"date-time"}},{"description":"The last date to include in the result","in":"query","name":"toDate","required":true,"schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/VersionStats"}}}},"description":"Ok"},"401":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/VersionStats"}}}},"description":"Api session missing, invalid or expired"},"403":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/VersionStats"}}}},"description":"Not enough permissions to use this endpoint"}},"security":[{"HangarAuth":["is_subject_member"]}],"summary":"Returns the stats for a version","tags":["Versions"]}},"/api/v1/projects/{slugOrId}/versions/{nameOrId}/{platform}/download":{"get":{"description":"Downloads the file for a specific platform of a version. Requires visibility of the project and version.","operationId":"downloadVersion","parameters":[{"description":"The slug or id of the project to download the version from","in":"path","name":"slugOrId","required":true,"schema":{"type":"string"}},{"description":"The name of the version to download","in":"path","name":"nameOrId","required":true,"schema":{"type":"string"}},{"description":"The platform of the version to download","in":"path","name":"platform","required":true,"schema":{"$ref":"#/components/schemas/Platform"}}],"responses":{"200":{"content":{"application/octet-stream":{"schema":{"type":"object"}}},"description":"Ok"},"303":{"content":{"application/octet-stream":{"schema":{"type":"object"}}},"description":"Version has an external download url"},"400":{"content":{"application/octet-stream":{"schema":{"type":"object"}}},"description":"Version doesn't have a file attached to it"},"401":{"content":{"application/octet-stream":{"schema":{"type":"object"}}},"description":"Api session missing, invalid or expired"},"403":{"content":{"application/octet-stream":{"schema":{"type":"object"}}},"description":"Not enough permissions to use this endpoint"}},"security":[{"HangarAuth":[]}],"summary":"Downloads a version","tags":["Versions"]}},"/api/v1/projects/{slugOrId}/watchers":{"get":{"description":"Returns the watchers of a project. Requires the `view_public_info` permission.","operationId":"getProjectWatchers","parameters":[{"description":"The slug or id of the project to return watchers for","in":"path","name":"slugOrId","required":true,"schema":{"type":"string"}},{"description":"The maximum amount of items to return","in":"query","name":"limit","required":false,"schema":{"type":"string","example":"1","maximum":25,"minimum":1},"style":"form"},{"description":"Where to start searching","in":"query","name":"offset","required":false,"schema":{"type":"string","example":"0","minimum":0},"style":"form"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResultUser"}}},"description":"Ok"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResultUser"}}},"description":"Api session missing, invalid or expired"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResultUser"}}},"description":"Not enough permissions to use this endpoint"}},"security":[{"HangarAuth":["view_public_info"]}],"summary":"Returns the watchers of a project","tags":["Projects"]}},"/api/v1/staff":{"get":{"description":"Returns Hanagr staff. Requires the `view_public_info` permission.","operationId":"getStaff","parameters":[{"description":"The search query","in":"query","name":"query","required":true,"schema":{"type":"string"}},{"description":"Used to sort the result","in":"query","name":"sort","schema":{"type":"string","enum":["name","createdAt","roles"]},"style":"form"},{"description":"The maximum amount of items to return","in":"query","name":"limit","required":false,"schema":{"type":"string","example":"1","maximum":25,"minimum":1},"style":"form"},{"description":"Where to start searching","in":"query","name":"offset","required":false,"schema":{"type":"string","example":"0","minimum":0},"style":"form"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResultUser"}}},"description":"Ok"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResultUser"}}},"description":"Api session missing, invalid or expired"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResultUser"}}},"description":"Not enough permissions to use this endpoint"}},"security":[{"HangarAuth":["view_public_info"]}],"summary":"Returns Hangar staff","tags":["Users"]}},"/api/v1/users":{"get":{"description":"Returns a list of users based on a search query. Requires the `view_public_info` permission.","operationId":"showUsers","parameters":[{"description":"The search query","in":"query","name":"query","required":true,"schema":{"type":"string"}},{"description":"Used to sort the result","in":"query","name":"sort","schema":{"type":"string","enum":["name","createdAt","projectCount","locked","org","roles"]},"style":"form"},{"description":"The maximum amount of items to return","in":"query","name":"limit","required":false,"schema":{"type":"string","example":"1","maximum":25,"minimum":1},"style":"form"},{"description":"Where to start searching","in":"query","name":"offset","required":false,"schema":{"type":"string","example":"0","minimum":0},"style":"form"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResultUser"}}},"description":"Ok"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResultUser"}}},"description":"Api session missing, invalid or expired"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResultUser"}}},"description":"Not enough permissions to use this endpoint"}},"security":[{"HangarAuth":["view_public_info"]}],"summary":"Searches for users","tags":["Users"]}},"/api/v1/users/{user}":{"get":{"description":"Returns a specific user. Requires the `view_public_info` permission.","operationId":"getUser","parameters":[{"description":"The name or id of the user to return","in":"path","name":"user","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}},"description":"Ok"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}},"description":"Api session missing, invalid or expired"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}},"description":"Not enough permissions to use this endpoint"}},"security":[{"HangarAuth":["view_public_info"]}],"summary":"Returns a specific user","tags":["Users"]}},"/api/v1/users/{user}/pinned":{"get":{"description":"Returns the pinned projects for a specific user. Requires the `view_public_info` permission.","operationId":"getUserPinnedProjects","parameters":[{"description":"The name or id of the user to return pinned projects for","in":"path","name":"user","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ProjectCompact"}}}},"description":"Ok"},"401":{"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ProjectCompact"}}}},"description":"Api session missing, invalid or expired"},"403":{"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ProjectCompact"}}}},"description":"Not enough permissions to use this endpoint"}},"security":[{"HangarAuth":["view_public_info"]}],"summary":"Returns the pinned projects for a specific user","tags":["Users"]}},"/api/v1/users/{user}/starred":{"get":{"description":"Returns the starred projects for a specific user. Requires the `view_public_info` permission.","operationId":"showStarred","parameters":[{"description":"The name or id of the user to return starred projects for","in":"path","name":"user","required":true,"schema":{"type":"string"}},{"description":"Used to sort the result","in":"query","name":"sort","schema":{"type":"string","enum":["views","downloads","newest","stars","updated","recent_downloads","recent_views","slug"]},"style":"form"},{"description":"The maximum amount of items to return","in":"query","name":"limit","required":false,"schema":{"type":"string","example":"1","maximum":25,"minimum":1},"style":"form"},{"description":"Where to start searching","in":"query","name":"offset","required":false,"schema":{"type":"string","example":"0","minimum":0},"style":"form"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResultProjectCompact"}}},"description":"Ok"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResultProjectCompact"}}},"description":"Api session missing, invalid or expired"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResultProjectCompact"}}},"description":"Not enough permissions to use this endpoint"}},"security":[{"HangarAuth":["view_public_info"]}],"summary":"Returns the starred projects for a specific user","tags":["Users"]}},"/api/v1/users/{user}/watching":{"get":{"description":"Returns the watched projects for a specific user. Requires the `view_public_info` permission.","operationId":"getUserWatching","parameters":[{"description":"The name or id of the user to return watched projects for","in":"path","name":"user","required":true,"schema":{"type":"string"}},{"description":"Used to sort the result","in":"query","name":"sort","schema":{"type":"string","enum":["views","downloads","newest","stars","updated","recent_downloads","recent_views","slug"]},"style":"form"},{"description":"The maximum amount of items to return","in":"query","name":"limit","required":false,"schema":{"type":"string","example":"1","maximum":25,"minimum":1},"style":"form"},{"description":"Where to start searching","in":"query","name":"offset","required":false,"schema":{"type":"string","example":"0","minimum":0},"style":"form"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResultProjectCompact"}}},"description":"Ok"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResultProjectCompact"}}},"description":"Api session missing, invalid or expired"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResultProjectCompact"}}},"description":"Not enough permissions to use this endpoint"}},"security":[{"HangarAuth":["view_public_info"]}],"summary":"Returns the watched projects for a specific user","tags":["Users"]}},"/api/v1/versions/hash/{hash}":{"get":{"operationId":"projectByVersionHash","parameters":[{"description":"The SHA-256 hash of the version","in":"path","name":"hash","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}},"description":"Ok"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}},"description":"Api session missing, invalid or expired"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}},"description":"Not enough permissions to use this endpoint"}},"security":[{"HangarAuth":["view_public_info"]}],"summary":"Returns project of the first version that matches the given file hash (SHA-256)","tags":["Projects"]}},"/api/v1/versions/{id}":{"get":{"description":"Returns a specific version by its ID. Requires the `view_public_info` permission in the project or owning organization.","operationId":"showVersionById","parameters":[{"description":"The id of the version to return","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Version"}}},"description":"Ok"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Version"}}},"description":"Api session missing, invalid or expired"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Version"}}},"description":"Not enough permissions to use this endpoint"}},"security":[{"HangarAuth":["view_public_info"]}],"summary":"Returns a specific version by its ID","tags":["Versions"]}},"/api/v1/versions/{id}/stats":{"get":{"description":"Returns the stats (downloads) for a version per day for a certain date range. Requires the `is_subject_member` permission.","operationId":"showVersionStatsById","parameters":[{"description":"The id of version to return the stats for","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"The first date to include in the result","in":"query","name":"fromDate","required":true,"schema":{"type":"string","format":"date-time"}},{"description":"The last date to include in the result","in":"query","name":"toDate","required":true,"schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/VersionStats"}}}},"description":"Ok"},"401":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/VersionStats"}}}},"description":"Api session missing, invalid or expired"},"403":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/VersionStats"}}}},"description":"Not enough permissions to use this endpoint"}},"security":[{"HangarAuth":["is_subject_member"]}],"summary":"Returns the stats for a version by its ID","tags":["Versions"]}},"/api/v1/versions/{id}/{platform}/download":{"get":{"description":"Downloads the file for a specific platform of a version. Requires visibility of the project and version.","operationId":"downloadVersionById","parameters":[{"description":"The id of the version to download","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"The platform of the version to download","in":"path","name":"platform","required":true,"schema":{"$ref":"#/components/schemas/Platform"}}],"responses":{"200":{"content":{"application/octet-stream":{"schema":{"type":"object"}}},"description":"Ok"},"303":{"content":{"application/octet-stream":{"schema":{"type":"object"}}},"description":"Version has an external download url"},"400":{"content":{"application/octet-stream":{"schema":{"type":"object"}}},"description":"Version doesn't have a file attached to it"},"401":{"content":{"application/octet-stream":{"schema":{"type":"object"}}},"description":"Api session missing, invalid or expired"},"403":{"content":{"application/octet-stream":{"schema":{"type":"object"}}},"description":"Not enough permissions to use this endpoint"}},"security":[{"HangarAuth":[]}],"summary":"Downloads a version by its ID","tags":["Versions"]}}},"components":{"schemas":{"ApiKey":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","format":"date-time","description":"The time the key stops working, if it was created with an expiration date"},"lastUsed":{"type":"string","format":"date-time"},"name":{"type":"string"},"permissions":{"type":"array","items":{"$ref":"#/components/schemas/NamedPermission"}},"projectScoped":{"type":"boolean","description":"Whether the key may only be used on the projects listed below"},"projects":{"type":"array","description":"The projects the key is limited to, empty unless the key is project scoped","items":{"$ref":"#/components/schemas/ProjectNamespace"}},"tokenIdentifier":{"type":"string"}}},"ApiSession":{"type":"object","properties":{"expiresIn":{"type":"integer","format":"int64","description":"Milliseconds this JWT expires in"},"token":{"type":"string","description":"JWT used for authentication"}}},"Category":{"type":"string","enum":["admin_tools","chat","dev_tools","economy","gameplay","games","protection","role_playing","world_management","misc","undefined"]},"ChannelFlag":{"type":"string","enum":["FROZEN","UNSTABLE","PINNED","SENDS_NOTIFICATIONS","HIDE_BY_DEFAULT"]},"Color":{"type":"string","enum":["#d946ef","#a855f7","#8b5cf6","#6366f1","#3b82f6","#0ea5e9","#06b6d4","#14b8a6","#34d399","#22c55e","#84cc16","#eab308","#f59e0b","#f97316","#ef4444","#78716c","#A9A9A9","transparent"]},"CreateAPIKeyForm":{"type":"object","description":"Data about the key to create","properties":{"expiresAt":{"type":"string","format":"date-time","description":"Point in time at which the key stops working. Leave empty for a key that never expires"},"name":{"type":"string","maxLength":36,"maximum":36,"minLength":5,"minimum":5},"permissions":{"type":"array","items":{"$ref":"#/components/schemas/NamedPermission"},"uniqueItems":true},"projects":{"type":"array","description":"Slugs of the projects the key may be used on. Leave empty to allow all projects","items":{"type":"string"},"maxItems":100,"minItems":0,"uniqueItems":true}},"required":["name","permissions"]},"DayProjectStats":{"type":"object","properties":{"downloads":{"type":"integer","format":"int64"},"views":{"type":"integer","format":"int64"}}},"FileInfo":{"type":"object","properties":{"name":{"type":"string"},"sha256Hash":{"type":"string"},"sizeBytes":{"type":"integer","format":"int64"}}},"JsonNode":{},"Link":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"url":{"type":"string"}},"required":["url"]},"LinkSection":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"links":{"type":"array","items":{"$ref":"#/components/schemas/Link"}},"title":{"type":"string"},"type":{"type":"string","description":"Type of the link. Either SIDEBAR or TOP","example":"TOP"}},"required":["links","type"]},"MultipartFileOrUrl":{"type":"object","description":"List of different jars/external links that are part of the version","properties":{"externalUrl":{"type":"string","description":"External url to download the jar from if not provided via an attached jar, else null","example":"https://papermc.io/downloads"},"platforms":{"type":"array","description":"List of platforms this jar runs on","example":"[PAPER, WATERFALL, VELOCITY]","items":{"$ref":"#/components/schemas/Platform"}}}},"NamedPermission":{"type":"string","enum":["view_public_info","edit_own_user_settings","edit_api_keys","edit_subject_settings","manage_subject_members","is_subject_owner","is_subject_member","create_project","edit_page","delete_project","create_version","edit_version","delete_version","edit_channels","create_organization","delete_organization","mod_notes_and_flags","see_hidden","is_staff","reviewer","view_health","view_ip","view_stats","view_logs","manual_value_changes","restore_version","restore_project","hard_delete_project","hard_delete_version","edit_all_user_settings"]},"PageEditForm":{"type":"object","description":"The path and new contents of the page","properties":{"content":{"type":"string"},"path":{"type":"string"}},"required":["content","path"]},"PaginatedResultProject":{"type":"object","properties":{"pagination":{"$ref":"#/components/schemas/Pagination"},"result":{"type":"array","items":{"$ref":"#/components/schemas/Project"}}}},"PaginatedResultProjectCompact":{"type":"object","properties":{"pagination":{"$ref":"#/components/schemas/Pagination"},"result":{"type":"array","items":{"$ref":"#/components/schemas/ProjectCompact"}}}},"PaginatedResultProjectMember":{"type":"object","properties":{"pagination":{"$ref":"#/components/schemas/Pagination"},"result":{"type":"array","items":{"$ref":"#/components/schemas/ProjectMember"}}}},"PaginatedResultUser":{"type":"object","properties":{"pagination":{"$ref":"#/components/schemas/Pagination"},"result":{"type":"array","items":{"$ref":"#/components/schemas/User"}}}},"PaginatedResultVersion":{"type":"object","properties":{"pagination":{"$ref":"#/components/schemas/Pagination"},"result":{"type":"array","items":{"$ref":"#/components/schemas/Version"}}}},"Pagination":{"type":"object","properties":{"count":{"type":"integer","format":"int64"},"limit":{"type":"integer","format":"int64","description":"The maximum amount of items to return","example":1,"maximum":25,"minimum":1},"offset":{"type":"integer","format":"int64","description":"Where to start searching","example":0,"minimum":0}}},"PermissionCheck":{"type":"object","properties":{"result":{"type":"boolean"},"type":{"$ref":"#/components/schemas/PermissionType"}}},"PermissionType":{"type":"string","enum":["global","project","organization"]},"PinnedStatus":{"type":"string","enum":["NONE","VERSION","CHANNEL"]},"Platform":{"type":"string","description":"Server platform","enum":["PAPER","WATERFALL","VELOCITY"],"example":"PAPER"},"PlatformVersion":{"type":"object","properties":{"platform":{"type":"integer","format":"int32"},"versions":{"type":"array","items":{"type":"string"},"uniqueItems":true}}},"PlatformVersionDownload":{"type":"object","properties":{"downloadUrl":{"type":"string","description":"Hangar download url if not an external download"},"externalUrl":{"type":"string","description":"External download url if not directly uploaded to Hangar"},"fileInfo":{"$ref":"#/components/schemas/FileInfo"}}},"PluginDependency":{"type":"object","properties":{"externalUrl":{"type":"string","description":"External url to download the dependency from if not a Hangar project, else null","example":"https://papermc.io/downloads"},"name":{"type":"string","description":"Name of the plugin dependency. For non-external dependencies, this should be the Hangar project name","example":"Maintenance"},"platform":{"$ref":"#/components/schemas/Platform","description":"Platform the dependency runs on"},"projectId":{"type":"integer","format":"int64","description":"Project ID of the dependency. Only for non-external dependencies","example":1},"required":{"type":"boolean","description":"Whether the dependency is required for the plugin to function"}}},"Project":{"type":"object","properties":{"avatarUrl":{"type":"string","description":"The url to the project's icon"},"category":{"$ref":"#/components/schemas/Category","description":"The category of the project"},"createdAt":{"type":"string","format":"date-time"},"description":{"type":"string","description":"The short description of the project"},"id":{"type":"integer","format":"int64","description":"The internal id of the project"},"lastUpdated":{"type":"string","format":"date-time","description":"The last time the project was updated"},"mainPageContent":{"type":"string","description":"The content of the main page"},"memberNames":{"type":"array","description":"The names of the members of the project","items":{"type":"string"}},"name":{"type":"string","description":"The unique name of the project"},"namespace":{"$ref":"#/components/schemas/ProjectNamespace","description":"The namespace of the project"},"publishedAt":{"type":["string","null"],"format":"date-time","description":"The time the project's first version was published"},"settings":{"$ref":"#/components/schemas/ProjectSettings","description":"The settings of the project"},"stats":{"$ref":"#/components/schemas/ProjectStats","description":"Stats of the project"},"supportedPlatforms":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"},"uniqueItems":true},"description":"The platforms and versions the project supports"},"userActions":{"$ref":"#/components/schemas/UserActions","description":"Information about your interactions with the project"},"visibility":{"$ref":"#/components/schemas/Visibility","description":"The visibility of the project"}}},"ProjectChannel":{"type":"object","properties":{"color":{"$ref":"#/components/schemas/Color"},"createdAt":{"type":"string","format":"date-time"},"description":{"type":"string"},"flags":{"type":"array","items":{"$ref":"#/components/schemas/ChannelFlag"},"uniqueItems":true},"name":{"type":"string"}}},"ProjectCompact":{"type":"object","properties":{"avatarUrl":{"type":"string","description":"The url to the project's icon"},"category":{"$ref":"#/components/schemas/Category","description":"The category of the project"},"createdAt":{"type":"string","format":"date-time"},"description":{"type":"string","description":"The short description of the project"},"id":{"type":"integer","format":"int64","description":"The internal id of the project"},"lastUpdated":{"type":"string","format":"date-time","description":"The last time the project was updated"},"name":{"type":"string","description":"The unique name of the project"},"namespace":{"$ref":"#/components/schemas/ProjectNamespace","description":"The namespace of the project"},"stats":{"$ref":"#/components/schemas/ProjectStats","description":"Stats of the project"},"visibility":{"$ref":"#/components/schemas/Visibility","description":"The visibility of the project"}}},"ProjectDonationSettings":{"type":"object","properties":{"enable":{"type":"boolean"},"subject":{"type":"string"}}},"ProjectLicense":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"},"url":{"type":"string"}}},"ProjectMember":{"type":"object","properties":{"permissions":{"type":"array","description":"What the member is allowed to do in this project","items":{"$ref":"#/components/schemas/NamedPermission"}},"title":{"type":"string","description":"The member's title within the project, chosen when they were added","example":"Maintainer"},"user":{"type":"string"},"userId":{"type":"integer","format":"int64"}}},"ProjectNamespace":{"type":"object","properties":{"owner":{"type":"string"},"slug":{"type":"string","description":"The unique name of a project","example":"Maintenance"}}},"ProjectSettings":{"type":"object","properties":{"donation":{"$ref":"#/components/schemas/ProjectDonationSettings","deprecated":true},"keywords":{"type":"array","items":{"type":"string"}},"license":{"$ref":"#/components/schemas/ProjectLicense"},"links":{"type":"array","items":{"$ref":"#/components/schemas/LinkSection"}},"sponsors":{"type":"string"},"tags":{"type":"array","items":{"$ref":"#/components/schemas/Tag"}},"unlisted":{"type":"boolean","description":"Whether the project is reachable by link but left out of search, the homepage and profiles"}},"required":["keywords","links","tags"]},"ProjectStats":{"type":"object","properties":{"downloads":{"type":"integer","format":"int64"},"recentDownloads":{"type":"integer","format":"int64"},"recentViews":{"type":"integer","format":"int64"},"stars":{"type":"integer","format":"int64"},"views":{"type":"integer","format":"int64"},"watchers":{"type":"integer","format":"int64"}}},"ReviewState":{"type":"string","enum":["unreviewed","reviewed","under_review","partially_reviewed"]},"StringContent":{"type":"object","description":"The path and new contents of the page","properties":{"content":{"type":"string","description":"A non-null, non-empty string","minLength":1}},"required":["content"]},"Tag":{"type":"string","enum":["ADDON","LIBRARY","SUPPORTS_FOLIA"]},"UploadedVersion":{"type":"object","description":"A version that has been uploaded","properties":{"url":{"type":"string","description":"URL of the uploaded version","example":"https://hangar.papermc.io/PaperMC/Debuggery/versions/1.0.0"}}},"User":{"type":"object","properties":{"avatarUrl":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"id":{"type":"integer","format":"int64"},"isOrganization":{"type":"boolean"},"locked":{"type":"boolean"},"name":{"type":"string"},"nameHistory":{"type":["array","null"],"items":{"$ref":"#/components/schemas/UserNameChange"}},"projectCount":{"type":"integer","format":"int64"},"roles":{"type":"array","items":{"type":"integer","format":"int64"}},"socials":{"$ref":"#/components/schemas/JsonNode"},"tagline":{"type":"string"}}},"UserActions":{"type":"object","properties":{"flagged":{"type":"boolean"},"starred":{"type":"boolean"},"watching":{"type":"boolean"}}},"UserNameChange":{"type":"object","properties":{"date":{"type":"string","format":"date-time"},"newName":{"type":"string"},"oldName":{"type":"string"}}},"UserPermissions":{"type":"object","properties":{"permissionBinString":{"type":"string"},"permissions":{"type":"array","items":{"$ref":"#/components/schemas/NamedPermission"}},"type":{"$ref":"#/components/schemas/PermissionType"}}},"Version":{"type":"object","properties":{"author":{"type":"string"},"channel":{"$ref":"#/components/schemas/ProjectChannel"},"createdAt":{"type":"string","format":"date-time"},"description":{"type":"string"},"downloads":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/PlatformVersionDownload"}},"id":{"type":"integer","format":"int64"},"memberNames":{"type":"array","items":{"type":"string"}},"name":{"type":"string"},"pinnedStatus":{"$ref":"#/components/schemas/PinnedStatus"},"platformDependencies":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"},"uniqueItems":true}},"platformDependenciesFormatted":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"pluginDependencies":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/PluginDependency"},"uniqueItems":true}},"projectId":{"type":"integer","format":"int64"},"reviewState":{"$ref":"#/components/schemas/ReviewState"},"stats":{"$ref":"#/components/schemas/VersionStats"},"visibility":{"$ref":"#/components/schemas/Visibility"}}},"VersionStats":{"type":"object","properties":{"platformDownloads":{"type":"object","additionalProperties":{"type":"integer","format":"int64"}},"totalDownloads":{"type":"integer","format":"int64"}}},"VersionUpload":{"type":"object","description":"Version data. See the VersionUpload schema for more info","properties":{"channel":{"type":"string","description":"Channel of the version to be published under","example":"Release","minLength":1},"description":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/MultipartFileOrUrl"},"maxItems":3,"minItems":1},"platformDependencies":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"},"uniqueItems":true},"description":"Map of platforms and their versions this version runs on","example":"{PAPER: [\"1.12\", \"1.16-1.18.2\", \"1.20.x\"]}"},"pluginDependencies":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/PluginDependency"},"uniqueItems":true},"description":"Map of each platform's plugin dependencies"},"version":{"type":"string","description":"Version string of the version to be published","example":"1.0.0-SNAPSHOT+1","minLength":1}},"required":["channel","files","platformDependencies","version"]},"Visibility":{"type":"string","description":"The visibility of a project or version","enum":["public","new","needsChanges","needsApproval","softDelete"],"example":"PUBLIC"}},"securitySchemes":{"HangarAuth":{"bearerFormat":"JWT","scheme":"bearer","type":"http"}}}}