ository can create commit statuses for a given SHA. * * Note: there is a limit of 1000 statuses per `sha` and `context` within a repository. Attempts to create more than 1000 statuses will result in a validation error. */ "repos/create-commit-status": { parameters: { path: { owner: components["parameters"]["owner"]; repo: components["parameters"]["repo"]; sha: string; }; }; requestBody: { content: { "application/json": { /** * @description The state of the status. * @enum {string} */ state: "error" | "failure" | "pending" | "success"; /** * @description The target URL to associate with this status. This URL will be linked from the GitHub UI to allow users to easily see the source of the status. * For example, if your continuous integration system is posting build status, you would want to provide the deep link for the build output for this specific SHA: * `http://ci.example.com/user/repo/build/sha` */ target_url?: string | null; /** @description A short description of the status. */ description?: string | null; /** * @description A string label to differentiate this status from the status of other systems. This field is case-insensitive. * @default default */ context?: string; }; }; }; responses: { /** @description Response */ 201: { headers: { /** @example https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e */ Location?: string; }; content: { "application/json": components["schemas"]["status"]; }; }; }; }; /** * List watchers * @description Lists the people watching the specified repository. */ "activity/list-watchers-for-repo": { parameters: { query?: { per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; path: { owner: components["parameters"]["owner"]; repo: components["parameters"]["repo"]; }; }; responses: { /** @description Response */ 200: { headers: { Link: components["headers"]["link"]; }; content: { "application/json": components["schemas"]["simple-user"][]; }; }; }; }; /** * Get a repository subscription * @description Gets information about whether the authenticated user is subscribed to the repository. */ "activity/get-repo-subscription": { parameters: { path: { owner: components["parameters"]["owner"]; repo: components["parameters"]["repo"]; }; }; responses: { /** @description if you subscribe to the repository */ 200: { content: { "application/json": components["schemas"]["repository-subscription"]; }; }; 403: components["responses"]["forbidden"]; /** @description Not Found if you don't subscribe to the repository */ 404: { content: never; }; }; }; /** * Set a repository subscription * @description If you would like to watch a repository, set `subscribed` to `true`. If you would like to ignore notifications made within a repository, set `ignored` to `true`. If you would like to stop watching a repository, [delete the repository's subscription](https://docs.github.com/rest/activity/watching#delete-a-repository-subscription) completely. */ "activity/set-repo-subscription": { parameters: { path: { owner: components["parameters"]["owner"]; repo: components["parameters"]["repo"]; }; }; requestBody?: { content: { "application/json": { /** @description Determines if notifications should be received from this repository. */ subscribed?: boolean; /** @description Determines if all notifications should be blocked from this repository. */ ignored?: boolean; }; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["repository-subscription"]; }; }; }; }; /** * Delete a repository subscription * @description This endpoint should only be used to stop watching a repository. To control whether or not you wish to receive notifications from a repository, [set the repository's subscription manually](https://docs.github.com/rest/activity/watching#set-a-repository-subscription). */ "activity/delete-repo-subscription": { parameters: { path: { owner: components["parameters"]["owner"]; repo: components["parameters"]["repo"]; }; }; responses: { /** @description Response */ 204: { content: never; }; }; }; /** List repository tags */ "repos/list-tags": { parameters: { query?: { per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; path: { owner: components["parameters"]["owner"]; repo: components["parameters"]["repo"]; }; }; responses: { /** @description Response */ 200: { headers: { Link: components["headers"]["link"]; }; content: { "application/json": components["schemas"]["tag"][]; }; }; }; }; /** * List tag protection states for a repository * @description This returns the tag protection states of a repository. * * This information is only available to repository administrators. */ "repos/list-tag-protection": { parameters: { path: { owner: components["parameters"]["owner"]; repo: components["parameters"]["repo"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["tag-protection"][]; }; }; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; }; }; /** * Create a tag protection state for a repository * @description This creates a tag protection state for a repository. * This endpoint is only available to repository administrators. */ "repos/create-tag-protection": { parameters: { path: { owner: components["parameters"]["owner"]; repo: components["parameters"]["repo"]; }; }; requestBody: { content: { "application/json": { /** @description An optional glob pattern to match against when enforcing tag protection. */ pattern: string; }; }; }; responses: { /** @description Response */ 201: { content: { "application/json": components["schemas"]["tag-protection"]; }; }; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; }; }; /** * Delete a tag protection state for a repository * @description This deletes a tag protection state for a repository. * This endpoint is only available to repository administrators. */ "repos/delete-tag-protection": { parameters: { path: { owner: components["parameters"]["owner"]; repo: components["parameters"]["repo"]; tag_protection_id: components["parameters"]["tag-protection-id"]; }; }; responses: { /** @description Response */ 204: { content: never; }; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; }; }; /** * Download a repository archive (tar) * @description Gets a redirect URL to download a tar archive for a repository. If you omit `:ref`, the repository’s default branch (usually * `main`) will be used. Please make sure your HTTP framework is configured to follow redirects or you will need to use * the `Location` header to make a second `GET` request. * **Note**: For private repositories, these links are temporary and expire after five minutes. */ "repos/download-tarball-archive": { parameters: { path: { owner: components["parameters"]["owner"]; repo: components["parameters"]["repo"]; ref: string; }; }; responses: { /** @description Response */ 302: { headers: { /** @example https://codeload.github.com/me/myprivate/legacy.zip/master?login=me&token=thistokenexpires */ Location?: string; }; content: never; }; }; }; /** * List repository teams * @description Lists the teams that have access to the specified repository and that are also visible to the authenticated user. * * For a public repository, a team is listed only if that team added the public repository explicitly. * * Personal access tokens require the following scopes: * * `public_repo` to call this endpoint on a public repository * * `repo` to call this endpoint on a private repository (this scope also includes public repositories) * * This endpoint is not compatible with fine-grained personal access tokens. */ "repos/list-teams": { parameters: { query?: { per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; path: { owner: components["parameters"]["owner"]; repo: components["parameters"]["repo"]; }; }; responses: { /** @description Response */ 200: { headers: { Link: components["headers"]["link"]; }; content: { "application/json": components["schemas"]["team"][]; }; }; 404: components["responses"]["not_found"]; }; }; /** Get all repository topics */ "repos/get-all-topics": { parameters: { query?: { page?: components["parameters"]["page"]; per_page?: components["parameters"]["per-page"]; }; path: { owner: components["parameters"]["owner"]; repo: components["parameters"]["repo"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["topic"]; }; }; 404: components["responses"]["not_found"]; }; }; /** Replace all repository topics */ "repos/replace-all-topics": { parameters: { path: { owner: components["parameters"]["owner"]; repo: components["parameters"]["repo"]; }; }; requestBody: { content: { "application/json": { /** @description An array of topics to add to the repository. Pass one or more topics to _replace_ the set of existing topics. Send an empty array (`[]`) to clear all topics from the repository. **Note:** Topic `names` cannot contain uppercase letters. */ names: string[]; }; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["topic"]; }; }; 404: components["responses"]["not_found"]; 422: components["responses"]["validation_failed_simple"]; }; }; /** * Get repository clones * @description Get the total number of clones and breakdown per day or week for the last 14 days. Timestamps are aligned to UTC midnight of the beginning of the day or week. Week begins on Monday. */ "repos/get-clones": { parameters: { query?: { per?: components["parameters"]["per"]; }; path: { owner: components["parameters"]["owner"]; repo: components["parameters"]["repo"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["clone-traffic"]; }; }; 403: components["responses"]["forbidden"]; }; }; /** * Get top referral paths * @description Get the top 10 popular contents over the last 14 days. */ "repos/get-top-paths": { parameters: { path: { owner: components["parameters"]["owner"]; repo: components["parameters"]["repo"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["content-traffic"][]; }; }; 403: components["responses"]["forbidden"]; }; }; /** * Get top referral sources * @description Get the top 10 referrers over the last 14 days. */ "repos/get-top-referrers": { parameters: { path: { owner: components["parameters"]["owner"]; repo: components["parameters"]["repo"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["referrer-traffic"][]; }; }; 403: components["responses"]["forbidden"]; }; }; /** * Get page views * @description Get the total number of views and breakdown per day or week for the last 14 days. Timestamps are aligned to UTC midnight of the beginning of the day or week. Week begins on Monday. */ "repos/get-views": { parameters: { query?: { per?: components["parameters"]["per"]; }; path: { owner: components["parameters"]["owner"]; repo: components["parameters"]["repo"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["view-traffic"]; }; }; 403: components["responses"]["forbidden"]; }; }; /** * Transfer a repository * @description A transfer request will need to be accepted by the new owner when transferring a personal repository to another user. The response will contain the original `owner`, and the transfer will continue asynchronously. For more details on the requirements to transfer personal and organization-owned repositories, see [about repository transfers](https://docs.github.com/articles/about-repository-transfers/). * You must use a personal access token (classic) or an OAuth token for this endpoint. An installation access token or a fine-grained personal access token cannot be used because they are only granted access to a single account. */ "repos/transfer": { parameters: { path: { owner: components["parameters"]["owner"]; repo: components["parameters"]["repo"]; }; }; requestBody: { content: { "application/json": { /** @description The username or organization name the repository will be transferred to. */ new_owner: string; /** @description The new name to be given to the repository. */ new_name?: string; /** @description ID of the team or teams to add to the repository. Teams can only be added to organization-owned repositories. */ team_ids?: number[]; }; }; }; responses: { /** @description Response */ 202: { content: { "application/json": components["schemas"]["minimal-repository"]; }; }; }; }; /** * Check if vulnerability alerts are enabled for a repository * @description Shows whether dependency alerts are enabled or disabled for a repository. The authenticated user must have admin read access to the repository. For more information, see "[About security alerts for vulnerable dependencies](https://docs.github.com/articles/about-security-alerts-for-vulnerable-dependencies)". */ "repos/check-vulnerability-alerts": { parameters: { path: { owner: components["parameters"]["owner"]; repo: components["parameters"]["repo"]; }; }; responses: { /** @description Response if repository is enabled with vulnerability alerts */ 204: { content: never; }; /** @description Not Found if repository is not enabled with vulnerability alerts */ 404: { content: never; }; }; }; /** * Enable vulnerability alerts * @description Enables dependency alerts and the dependency graph for a repository. The authenticated user must have admin access to the repository. For more information, see "[About security alerts for vulnerable dependencies](https://docs.github.com/articles/about-security-alerts-for-vulnerable-dependencies)". */ "repos/enable-vulnerability-alerts": { parameters: { path: { owner: components["parameters"]["owner"]; repo: components["parameters"]["repo"]; }; }; responses: { /** @description Response */ 204: { content: never; }; }; }; /** * Disable vulnerability alerts * @description Disables dependency alerts and the dependency graph for a repository. * The authenticated user must have admin access to the repository. For more information, * see "[About security alerts for vulnerable dependencies](https://docs.github.com/articles/about-security-alerts-for-vulnerable-dependencies)". */ "repos/disable-vulnerability-alerts": { parameters: { path: { owner: components["parameters"]["owner"]; repo: components["parameters"]["repo"]; }; }; responses: { /** @description Response */ 204: { content: never; }; }; }; /** * Download a repository archive (zip) * @description Gets a redirect URL to download a zip archive for a repository. If you omit `:ref`, the repository’s default branch (usually * `main`) will be used. Please make sure your HTTP framework is configured to follow redirects or you will need to use * the `Location` header to make a second `GET` request. * * **Note**: For private repositories, these links are temporary and expire after five minutes. If the repository is empty, you will receive a 404 when you follow the redirect. */ "repos/download-zipball-archive": { parameters: { path: { owner: components["parameters"]["owner"]; repo: components["parameters"]["repo"]; ref: string; }; }; responses: { /** @description Response */ 302: { headers: { /** @example https://codeload.github.com/me/myprivate/legacy.zip/master?login=me&token=thistokenexpires */ Location?: string; }; content: never; }; }; }; /** * Create a repository using a template * @description Creates a new repository using a repository template. Use the `template_owner` and `template_repo` route parameters to specify the repository to use as the template. If the repository is not public, the authenticated user must own or be a member of an organization that owns the repository. To check if a repository is available to use as a template, get the repository's information using the [Get a repository](https://docs.github.com/rest/repos/repos#get-a-repository) endpoint and check that the `is_template` key is `true`. * * **OAuth scope requirements** * * When using [OAuth](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include: * * * `public_repo` scope or `repo` scope to create a public repository. Note: For GitHub AE, use `repo` scope to create an internal repository. * * `repo` scope to create a private repository */ "repos/create-using-template": { parameters: { path: { /** @description The account owner of the template repository. The name is not case sensitive. */ template_owner: string; /** @description The name of the template repository without the `.git` extension. The name is not case sensitive. */ template_repo: string; }; }; requestBody: { content: { "application/json": { /** @description The organization or person who will own the new repository. To create a new repository in an organization, the authenticated user must be a member of the specified organization. */ owner?: string; /** @description The name of the new repository. */ name: string; /** @description A short description of the new repository. */ description?: string; /** * @description Set to `true` to include the directory structure and files from all branches in the template repository, and not just the default branch. Default: `false`. * @default false */ include_all_branches?: boolean; /** * @description Either `true` to create a new private repository or `false` to create a new public one. * @default false */ private?: boolean; }; }; }; responses: { /** @description Response */ 201: { headers: { /** @example https://api.github.com/repos/octocat/Hello-World */ Location?: string; }; content: { "application/json": components["schemas"]["repository"]; }; }; }; }; /** * List public repositories * @description Lists all public repositories in the order that they were created. * * Note: * - For GitHub Enterprise Server, this endpoint will only list repositories available to all users on the enterprise. * - Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers) to get the URL for the next page of repositories. */ "repos/list-public": { parameters: { query?: { since?: components["parameters"]["since-repo"]; }; }; responses: { /** @description Response */ 200: { headers: { /** @example ; rel="next" */ Link?: string; }; content: { "application/json": components["schemas"]["minimal-repository"][]; }; }; 304: components["responses"]["not_modified"]; 422: components["responses"]["validation_failed"]; }; }; /** * List environment secrets * @description Lists all secrets available in an environment without revealing their * encrypted values. * * You must authenticate using an access token with the `repo` scope to use this endpoint. * GitHub Apps must have the `secrets` repository permission to use this endpoint. * Authenticated users must have collaborator access to a repository to create, update, or read secrets. */ "actions/list-environment-secrets": { parameters: { query?: { per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; path: { repository_id: components["parameters"]["repository-id"]; environment_name: components["parameters"]["environment-name"]; }; }; responses: { /** @description Response */ 200: { headers: { Link: components["headers"]["link"]; }; content: { "application/json": { total_count: number; secrets: components["schemas"]["actions-secret"][]; }; }; }; }; }; /** * Get an environment public key * @description Get the public key for an environment, which you need to encrypt environment * secrets. You need to encrypt a secret before you can create or update secrets. * * Anyone with read access to the repository can use this endpoint. * If the repository is private you must use an access token with the `repo` scope. * GitHub Apps must have the `secrets` repository permission to use this endpoint. * Authenticated users must have collaborator access to a repository to create, update, or read secrets. */ "actions/get-environment-public-key": { parameters: { path: { repository_id: components["parameters"]["repository-id"]; environment_name: components["parameters"]["environment-name"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["actions-public-key"]; }; }; }; }; /** * Get an environment secret * @description Gets a single environment secret without revealing its encrypted value. * * You must authenticate using an access token with the `repo` scope to use this endpoint. * GitHub Apps must have the `secrets` repository permission to use this endpoint. * Authenticated users must have collaborator access to a repository to create, update, or read secrets. */ "actions/get-environment-secret": { parameters: { path: { repository_id: components["parameters"]["repository-id"]; environment_name: components["parameters"]["environment-name"]; secret_name: components["parameters"]["secret-name"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["actions-secret"]; }; }; }; }; /** * Create or update an environment secret * @description Creates or updates an environment secret with an encrypted value. Encrypt your secret using * [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)." * * You must authenticate using an access token with the `repo` scope to use this endpoint. * GitHub Apps must have the `secrets` repository permission to use this endpoint. * Authenticated users must have collaborator access to a repository to create, update, or read secrets. */ "actions/create-or-update-environment-secret": { parameters: { path: { repository_id: components["parameters"]["repository-id"]; environment_name: components["parameters"]["environment-name"]; secret_name: components["parameters"]["secret-name"]; }; }; requestBody: { content: { "application/json": { /** @description Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get an environment public key](https://docs.github.com/rest/actions/secrets#get-an-environment-public-key) endpoint. */ encrypted_value: string; /** @description ID of the key you used to encrypt the secret. */ key_id: string; }; }; }; responses: { /** @description Response when creating a secret */ 201: { content: { "application/json": components["schemas"]["empty-object"]; }; }; /** @description Response when updating a secret */ 204: { content: never; }; }; }; /** * Delete an environment secret * @description Deletes a secret in an environment using the secret name. * * You must authenticate using an access token with the `repo` scope to use this endpoint. * GitHub Apps must have the `secrets` repository permission to use this endpoint. * Authenticated users must have collaborator access to a repository to create, update, or read secrets. */ "actions/delete-environment-secret": { parameters: { path: { repository_id: components["parameters"]["repository-id"]; environment_name: components["parameters"]["environment-name"]; secret_name: components["parameters"]["secret-name"]; }; }; responses: { /** @description Default response */ 204: { content: never; }; }; }; /** * List environment variables * @description Lists all environment variables. * * You must authenticate using an access token with the `repo` scope to use this endpoint. * GitHub Apps must have the `environments:read` repository permission to use this endpoint. * Authenticated users must have collaborator access to a repository to create, update, or read variables. */ "actions/list-environment-variables": { parameters: { query?: { per_page?: components["parameters"]["variables-per-page"]; page?: components["parameters"]["page"]; }; path: { repository_id: components["parameters"]["repository-id"]; environment_name: components["parameters"]["environment-name"]; }; }; responses: { /** @description Response */ 200: { headers: { Link: components["headers"]["link"]; }; content: { "application/json": { total_count: number; variables: components["schemas"]["actions-variable"][]; }; }; }; }; }; /** * Create an environment variable * @description Create an environment variable that you can reference in a GitHub Actions workflow. * * You must authenticate using an access token with the `repo` scope to use this endpoint. * GitHub Apps must have the `environment:write` repository permission to use this endpoint. * Authenticated users must have collaborator access to a repository to create, update, or read variables. */ "actions/create-environment-variable": { parameters: { path: { repository_id: components["parameters"]["repository-id"]; environment_name: components["parameters"]["environment-name"]; }; }; requestBody: { content: { "application/json": { /** @description The name of the variable. */ name: string; /** @description The value of the variable. */ value: string; }; }; }; responses: { /** @description Response */ 201: { content: { "application/json": components["schemas"]["empty-object"]; }; }; }; }; /** * Get an environment variable * @description Gets a specific variable in an environment. * * You must authenticate using an access token with the `repo` scope to use this endpoint. * GitHub Apps must have the `environments:read` repository permission to use this endpoint. * Authenticated users must have collaborator access to a repository to create, update, or read variables. */ "actions/get-environment-variable": { parameters: { path: { repository_id: components["parameters"]["repository-id"]; environment_name: components["parameters"]["environment-name"]; name: components["parameters"]["variable-name"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["actions-variable"]; }; }; }; }; /** * Delete an environment variable * @description Deletes an environment variable using the variable name. * * You must authenticate using an access token with the `repo` scope to use this endpoint. * GitHub Apps must have the `environment:write` repository permission to use this endpoint. * Authenticated users must have collaborator access to a repository to create, update, or read variables. */ "actions/delete-environment-variable": { parameters: { path: { repository_id: components["parameters"]["repository-id"]; name: components["parameters"]["variable-name"]; environment_name: components["parameters"]["environment-name"]; }; }; responses: { /** @description Response */ 204: { content: never; }; }; }; /** * Update an environment variable * @description Updates an environment variable that you can reference in a GitHub Actions workflow. * * You must authenticate using an access token with the `repo` scope to use this endpoint. * GitHub Apps must have the `environment:write` repository permission to use this endpoint. * Authenticated users must have collaborator access to a repository to create, update, or read variables. */ "actions/update-environment-variable": { parameters: { path: { repository_id: components["parameters"]["repository-id"]; name: components["parameters"]["variable-name"]; environment_name: components["parameters"]["environment-name"]; }; }; requestBody: { content: { "application/json": { /** @description The name of the variable. */ name?: string; /** @description The value of the variable. */ value?: string; }; }; }; responses: { /** @description Response */ 204: { content: never; }; }; }; /** * Search code * @description Searches for query terms inside of a file. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). * * When searching for code, you can get text match metadata for the file **content** and file **path** fields when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/search/search#text-match-metadata). * * For example, if you want to find the definition of the `addClass` function inside [jQuery](https://github.com/jquery/jquery) repository, your query would look something like this: * * `q=addClass+in:file+language:js+repo:jquery/jquery` * * This query searches for the keyword `addClass` within a file's contents. The query limits the search to files where the language is JavaScript in the `jquery/jquery` repository. * * Considerations for code search: * * Due to the complexity of searching code, there are a few restrictions on how searches are performed: * * * Only the _default branch_ is considered. In most cases, this will be the `master` branch. * * Only files smaller than 384 KB are searchable. * * You must always include at least one search term when searching source code. For example, searching for [`language:go`](https://github.com/search?utf8=%E2%9C%93&q=language%3Ago&type=Code) is not valid, while [`amazing * language:go`](https://github.com/search?utf8=%E2%9C%93&q=amazing+language%3Ago&type=Code) is. * * This endpoint requires you to authenticate and limits you to 10 requests per minute. */ "search/code": { parameters: { query: { /** @description The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as the web interface for GitHub. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/search/search#constructing-a-search-query). See "[Searching code](https://docs.github.com/search-github/searching-on-github/searching-code)" for a detailed list of qualifiers. */ q: string; /** * @deprecated * @description **This field is deprecated.** Sorts the results of your query. Can only be `indexed`, which indicates how recently a file has been indexed by the GitHub search infrastructure. Default: [best match](https://docs.github.com/rest/search/search#ranking-search-results) */ sort?: "indexed"; /** * @deprecated * @description **This field is deprecated.** Determines whether the first search result returned is the highest number of matches (`desc`) or lowest number of matches (`asc`). This parameter is ignored unless you provide `sort`. */ order?: "desc" | "asc"; per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": { total_count: number; incomplete_results: boolean; items: components["schemas"]["code-search-result-item"][]; }; }; }; 304: components["responses"]["not_modified"]; 403: components["responses"]["forbidden"]; 422: components["responses"]["validation_failed"]; 503: components["responses"]["service_unavailable"]; }; }; /** * Search commits * @description Find commits via various criteria on the default branch (usually `main`). This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). * * When searching for commits, you can get text match metadata for the **message** field when you provide the `text-match` media type. For more details about how to receive highlighted search results, see [Text match * metadata](https://docs.github.com/rest/search/search#text-match-metadata). * * For example, if you want to find commits related to CSS in the [octocat/Spoon-Knife](https://github.com/octocat/Spoon-Knife) repository. Your query would look something like this: * * `q=repo:octocat/Spoon-Knife+css` */ "search/commits": { parameters: { query: { /** @description The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as the web interface for GitHub. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/search/search#constructing-a-search-query). See "[Searching commits](https://docs.github.com/search-github/searching-on-github/searching-commits)" for a detailed list of qualifiers. */ q: string; /** @description Sorts the results of your query by `author-date` or `committer-date`. Default: [best match](https://docs.github.com/rest/search/search#ranking-search-results) */ sort?: "author-date" | "committer-date"; order?: components["parameters"]["order"]; per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": { total_count: number; incomplete_results: boolean; items: components["schemas"]["commit-search-result-item"][]; }; }; }; 304: components["responses"]["not_modified"]; }; }; /** * Search issues and pull requests * @description Find issues by state and keyword. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). * * When searching for issues, you can get text match metadata for the issue **title**, issue **body**, and issue **comment body** fields when you pass the `text-match` media type. For more details about how to receive highlighted * search results, see [Text match metadata](https://docs.github.com/rest/search/search#text-match-metadata). * * For example, if you want to find the oldest unresolved Python bugs on Windows. Your query might look something like this. * * `q=windows+label:bug+language:python+state:open&sort=created&order=asc` * * This query searches for the keyword `windows`, within any open issue that is labeled as `bug`. The search runs across repositories whose primary language is Python. The results are sorted by creation date in ascending order, which means the oldest issues appear first in the search results. * * **Note:** For requests made by GitHub Apps with a user access token, you can't retrieve a combination of issues and pull requests in a single query. Requests that don't include the `is:issue` or `is:pull-request` qualifier will receive an HTTP `422 Unprocessable Entity` response. To get results for both issues and pull requests, you must send separate queries for issues and pull requests. For more information about the `is` qualifier, see "[Searching only issues or pull requests](https://docs.github.com/github/searching-for-information-on-github/searching-issues-and-pull-requests#search-only-issues-or-pull-requests)." */ "search/issues-and-pull-requests": { parameters: { query: { /** @description The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as the web interface for GitHub. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/search/search#constructing-a-search-query). See "[Searching issues and pull requests](https://docs.github.com/search-github/searching-on-github/searching-issues-and-pull-requests)" for a detailed list of qualifiers. */ q: string; /** @description Sorts the results of your query by the number of `comments`, `reactions`, `reactions-+1`, `reactions--1`, `reactions-smile`, `reactions-thinking_face`, `reactions-heart`, `reactions-tada`, or `interactions`. You can also sort results by how recently the items were `created` or `updated`, Default: [best match](https://docs.github.com/rest/search/search#ranking-search-results) */ sort?: | "comments" | "reactions" | "reactions-+1" | "reactions--1" | "reactions-smile" | "reactions-thinking_face" | "reactions-heart" | "reactions-tada" | "interactions" | "created" | "updated"; order?: components["parameters"]["order"]; per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": { total_count: number; incomplete_results: boolean; items: components["schemas"]["issue-search-result-item"][]; }; }; }; 304: components["responses"]["not_modified"]; 403: components["responses"]["forbidden"]; 422: components["responses"]["validation_failed"]; 503: components["responses"]["service_unavailable"]; }; }; /** * Search labels * @description Find labels in a repository with names or descriptions that match search keywords. Returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). * * When searching for labels, you can get text match metadata for the label **name** and **description** fields when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/search/search#text-match-metadata). * * For example, if you want to find labels in the `linguist` repository that match `bug`, `defect`, or `enhancement`. Your query might look like this: * * `q=bug+defect+enhancement&repository_id=64778136` * * The labels that best match the query appear first in the search results. */ "search/labels": { parameters: { query: { /** @description The id of the repository. */ repository_id: number; /** @description The search keywords. This endpoint does not accept qualifiers in the query. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/search/search#constructing-a-search-query). */ q: string; /** @description Sorts the results of your query by when the label was `created` or `updated`. Default: [best match](https://docs.github.com/rest/search/search#ranking-search-results) */ sort?: "created" | "updated"; order?: components["parameters"]["order"]; per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": { total_count: number; incomplete_results: boolean; items: components["schemas"]["label-search-result-item"][]; }; }; }; 304: components["responses"]["not_modified"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; 422: components["responses"]["validation_failed"]; }; }; /** * Search repositories * @description Find repositories via various criteria. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). * * When searching for repositories, you can get text match metadata for the **name** and **description** fields when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/search/search#text-match-metadata). * * For example, if you want to search for popular Tetris repositories written in assembly code, your query might look like this: * * `q=tetris+language:assembly&sort=stars&order=desc` * * This query searches for repositories with the word `tetris` in the name, the description, or the README. The results are limited to repositories where the primary language is assembly. The results are sorted by stars in descending order, so that the most popular repositories appear first in the search results. */ "search/repos": { parameters: { query: { /** @description The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as the web interface for GitHub. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/search/search#constructing-a-search-query). See "[Searching for repositories](https://docs.github.com/articles/searching-for-repositories/)" for a detailed list of qualifiers. */ q: string; /** @description Sorts the results of your query by number of `stars`, `forks`, or `help-wanted-issues` or how recently the items were `updated`. Default: [best match](https://docs.github.com/rest/search/search#ranking-search-results) */ sort?: "stars" | "forks" | "help-wanted-issues" | "updated"; order?: components["parameters"]["order"]; per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": { total_count: number; incomplete_results: boolean; items: components["schemas"]["repo-search-result-item"][]; }; }; }; 304: components["responses"]["not_modified"]; 422: components["responses"]["validation_failed"]; 503: components["responses"]["service_unavailable"]; }; }; /** * Search topics * @description Find topics via various criteria. Results are sorted by best match. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). See "[Searching topics](https://docs.github.com/articles/searching-topics/)" for a detailed list of qualifiers. * * When searching for topics, you can get text match metadata for the topic's **short\_description**, **description**, **name**, or **display\_name** field when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/search/search#text-match-metadata). * * For example, if you want to search for topics related to Ruby that are featured on https://github.com/topics. Your query might look like this: * * `q=ruby+is:featured` * * This query searches for topics with the keyword `ruby` and limits the results to find only topics that are featured. The topics that are the best match for the query appear first in the search results. */ "search/topics": { parameters: { query: { /** @description The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as the web interface for GitHub. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/search/search#constructing-a-search-query). */ q: string; per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": { total_count: number; incomplete_results: boolean; items: components["schemas"]["topic-search-result-item"][]; }; }; }; 304: components["responses"]["not_modified"]; }; }; /** * Search users * @description Find users via various criteria. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). * * When searching for users, you can get text match metadata for the issue **login**, public **email**, and **name** fields when you pass the `text-match` media type. For more details about highlighting search results, see [Text match metadata](https://docs.github.com/rest/search/search#text-match-metadata). For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/search/search#text-match-metadata). * * For example, if you're looking for a list of popular users, you might try this query: * * `q=tom+repos:%3E42+followers:%3E1000` * * This query searches for users with the name `tom`. The results are restricted to users with more than 42 repositories and over 1,000 followers. * * This endpoint does not accept authentication and will only include publicly visible users. As an alternative, you can use the GraphQL API. The GraphQL API requires authentication and will return private users, including Enterprise Managed Users (EMUs), that you are authorized to view. For more information, see "[GraphQL Queries](https://docs.github.com/graphql/reference/queries#search)." */ "search/users": { parameters: { query: { /** @description The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as the web interface for GitHub. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/search/search#constructing-a-search-query). See "[Searching users](https://docs.github.com/search-github/searching-on-github/searching-users)" for a detailed list of qualifiers. */ q: string; /** @description Sorts the results of your query by number of `followers` or `repositories`, or when the person `joined` GitHub. Default: [best match](https://docs.github.com/rest/search/search#ranking-search-results) */ sort?: "followers" | "repositories" | "joined"; order?: components["parameters"]["order"]; per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": { total_count: number; incomplete_results: boolean; items: components["schemas"]["user-search-result-item"][]; }; }; }; 304: components["responses"]["not_modified"]; 422: components["responses"]["validation_failed"]; 503: components["responses"]["service_unavailable"]; }; }; /** * Get a team (Legacy) * @deprecated * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the [Get a team by name](https://docs.github.com/rest/teams/teams#get-a-team-by-name) endpoint. */ "teams/get-legacy": { parameters: { path: { team_id: components["parameters"]["team-id"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["team-full"]; }; }; 404: components["responses"]["not_found"]; }; }; /** * Delete a team (Legacy) * @deprecated * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a team](https://docs.github.com/rest/teams/teams#delete-a-team) endpoint. * * To delete a team, the authenticated user must be an organization owner or team maintainer. * * If you are an organization owner, deleting a parent team will delete all of its child teams as well. */ "teams/delete-legacy": { parameters: { path: { team_id: components["parameters"]["team-id"]; }; }; responses: { /** @description Response */ 204: { content: never; }; 404: components["responses"]["not_found"]; 422: components["responses"]["validation_failed"]; }; }; /** * Update a team (Legacy) * @deprecated * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a team](https://docs.github.com/rest/teams/teams#update-a-team) endpoint. * * To edit a team, the authenticated user must either be an organization owner or a team maintainer. * * **Note:** With nested teams, the `privacy` for parent teams cannot be `secret`. */ "teams/update-legacy": { parameters: { path: { team_id: components["parameters"]["team-id"]; }; }; requestBody: { content: { "application/json": { /** @description The name of the team. */ name: string; /** @description The description of the team. */ description?: string; /** * @description The level of privacy this team should have. Editing teams without specifying this parameter leaves `privacy` intact. The options are: * **For a non-nested team:** * * `secret` - only visible to organization owners and members of this team. * * `closed` - visible to all members of this organization. * **For a parent or child team:** * * `closed` - visible to all members of this organization. * @enum {string} */ privacy?: "secret" | "closed"; /** * @description The notification setting the team has chosen. Editing teams without specifying this parameter leaves `notification_setting` intact. The options are: * * `notifications_enabled` - team members receive notifications when the team is @mentioned. * * `notifications_disabled` - no one receives notifications. * @enum {string} */ notification_setting?: | "notifications_enabled" | "notifications_disabled"; /** * @description **Deprecated**. The permission that new repositories will be added to the team with when none is specified. * @default pull * @enum {string} */ permission?: "pull" | "push" | "admin"; /** @description The ID of a team to set as the parent team. */ parent_team_id?: number | null; }; }; }; responses: { /** @description Response when the updated information already exists */ 200: { content: { "application/json": components["schemas"]["team-full"]; }; }; /** @description Response */ 201: { content: { "application/json": components["schemas"]["team-full"]; }; }; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; 422: components["responses"]["validation_failed"]; }; }; /** * List discussions (Legacy) * @deprecated * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List discussions`](https://docs.github.com/rest/teams/discussions#list-discussions) endpoint. * * List all discussions on a team's page. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ "teams/list-discussions-legacy": { parameters: { query?: { direction?: components["parameters"]["direction"]; per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; path: { team_id: components["parameters"]["team-id"]; }; }; responses: { /** @description Response */ 200: { headers: { Link: components["headers"]["link"]; }; content: { "application/json": components["schemas"]["team-discussion"][]; }; }; }; }; /** * Create a discussion (Legacy) * @deprecated * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create a discussion`](https://docs.github.com/rest/teams/discussions#create-a-discussion) endpoint. * * Creates a new discussion post on a team's page. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * * This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See "[Secondary rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)" for details. */ "teams/create-discussion-legacy": { parameters: { path: { team_id: components["parameters"]["team-id"]; }; }; requestBody: { content: { "application/json": { /** @description The discussion post's title. */ title: string; /** @description The discussion post's body text. */ body: string; /** * @description Private posts are only visible to team members, organization owners, and team maintainers. Public posts are visible to all members of the organization. Set to `true` to create a private post. * @default false */ private?: boolean; }; }; }; responses: { /** @description Response */ 201: { content: { "application/json": components["schemas"]["team-discussion"]; }; }; }; }; /** * Get a discussion (Legacy) * @deprecated * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion) endpoint. * * Get a specific discussion on a team's page. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ "teams/get-discussion-legacy": { parameters: { path: { team_id: components["parameters"]["team-id"]; discussion_number: components["parameters"]["discussion-number"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["team-discussion"]; }; }; }; }; /** * Delete a discussion (Legacy) * @deprecated * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Delete a discussion`](https://docs.github.com/rest/teams/discussions#delete-a-discussion) endpoint. * * Delete a discussion from a team's page. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ "teams/delete-discussion-legacy": { parameters: { path: { team_id: components["parameters"]["team-id"]; discussion_number: components["parameters"]["discussion-number"]; }; }; responses: { /** @description Response */ 204: { content: never; }; }; }; /** * Update a discussion (Legacy) * @deprecated * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion](https://docs.github.com/rest/teams/discussions#update-a-discussion) endpoint. * * Edits the title and body text of a discussion post. Only the parameters you provide are updated. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ "teams/update-discussion-legacy": { parameters: { path: { team_id: components["parameters"]["team-id"]; discussion_number: components["parameters"]["discussion-number"]; }; }; requestBody?: { content: { "application/json": { /** @description The discussion post's title. */ title?: string; /** @description The discussion post's body text. */ body?: string; }; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["team-discussion"]; }; }; }; }; /** * List discussion comments (Legacy) * @deprecated * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [List discussion comments](https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments) endpoint. * * List all comments on a team discussion. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ "teams/list-discussion-comments-legacy": { parameters: { query?: { direction?: components["parameters"]["direction"]; per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; path: { team_id: components["parameters"]["team-id"]; discussion_number: components["parameters"]["discussion-number"]; }; }; responses: { /** @description Response */ 200: { headers: { Link: components["headers"]["link"]; }; content: { "application/json": components["schemas"]["team-discussion-comment"][]; }; }; }; }; /** * Create a discussion comment (Legacy) * @deprecated * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Create a discussion comment](https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment) endpoint. * * Creates a new comment on a team discussion. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * * This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See "[Secondary rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)" for details. */ "teams/create-discussion-comment-legacy": { parameters: { path: { team_id: components["parameters"]["team-id"]; discussion_number: components["parameters"]["discussion-number"]; }; }; requestBody: { content: { "application/json": { /** @description The discussion comment's body text. */ body: string; }; }; }; responses: { /** @description Response */ 201: { content: { "application/json": components["schemas"]["team-discussion-comment"]; }; }; }; }; /** * Get a discussion comment (Legacy) * @deprecated * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment) endpoint. * * Get a specific comment on a team discussion. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ "teams/get-discussion-comment-legacy": { parameters: { path: { team_id: components["parameters"]["team-id"]; discussion_number: components["parameters"]["discussion-number"]; comment_number: components["parameters"]["comment-number"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["team-discussion-comment"]; }; }; }; }; /** * Delete a discussion comment (Legacy) * @deprecated * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a discussion comment](https://docs.github.com/rest/teams/discussion-comments#delete-a-discussion-comment) endpoint. * * Deletes a comment on a team discussion. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ "teams/delete-discussion-comment-legacy": { parameters: { path: { team_id: components["parameters"]["team-id"]; discussion_number: components["parameters"]["discussion-number"]; comment_number: components["parameters"]["comment-number"]; }; }; responses: { /** @description Response */ 204: { content: never; }; }; }; /** * Update a discussion comment (Legacy) * @deprecated * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion comment](https://docs.github.com/rest/teams/discussion-comments#update-a-discussion-comment) endpoint. * * Edits the body text of a discussion comment. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ "teams/update-discussion-comment-legacy": { parameters: { path: { team_id: components["parameters"]["team-id"]; discussion_number: components["parameters"]["discussion-number"]; comment_number: components["parameters"]["comment-number"]; }; }; requestBody: { content: { "application/json": { /** @description The discussion comment's body text. */ body: string; }; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["team-discussion-comment"]; }; }; }; }; /** * List reactions for a team discussion comment (Legacy) * @deprecated * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List reactions for a team discussion comment`](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment) endpoint. * * List the reactions to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment). OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ "reactions/list-for-team-discussion-comment-legacy": { parameters: { query?: { /** @description Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to a team discussion comment. */ content?: | "+1" | "-1" | "laugh" | "confused" | "heart" | "hooray" | "rocket" | "eyes"; per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; path: { team_id: components["parameters"]["team-id"]; discussion_number: components["parameters"]["discussion-number"]; comment_number: components["parameters"]["comment-number"]; }; }; responses: { /** @description Response */ 200: { headers: { Link: components["headers"]["link"]; }; content: { "application/json": components["schemas"]["reaction"][]; }; }; }; }; /** * Create reaction for a team discussion comment (Legacy) * @deprecated * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Create reaction for a team discussion comment](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment)" endpoint. * * Create a reaction to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment). OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with an HTTP `200` status means that you already added the reaction type to this team discussion comment. */ "reactions/create-for-team-discussion-comment-legacy": { parameters: { path: { team_id: components["parameters"]["team-id"]; discussion_number: components["parameters"]["discussion-number"]; comment_number: components["parameters"]["comment-number"]; }; }; requestBody: { content: { "application/json": { /** * @description The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the team discussion comment. * @enum {string} */ content: | "+1" | "-1" | "laugh" | "confused" | "heart" | "hooray" | "rocket" | "eyes"; }; }; }; responses: { /** @description Response */ 201: { content: { "application/json": components["schemas"]["reaction"]; }; }; }; }; /** * List reactions for a team discussion (Legacy) * @deprecated * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List reactions for a team discussion`](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion) endpoint. * * List the reactions to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion). OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ "reactions/list-for-team-discussion-legacy": { parameters: { query?: { /** @description Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to a team discussion. */ content?: | "+1" | "-1" | "laugh" | "confused" | "heart" | "hooray" | "rocket" | "eyes"; per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; path: { team_id: components["parameters"]["team-id"]; discussion_number: components["parameters"]["discussion-number"]; }; }; responses: { /** @description Response */ 200: { headers: { Link: components["headers"]["link"]; }; content: { "application/json": components["schemas"]["reaction"][]; }; }; }; }; /** * Create reaction for a team discussion (Legacy) * @deprecated * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create reaction for a team discussion`](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion) endpoint. * * Create a reaction to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion). OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with an HTTP `200` status means that you already added the reaction type to this team discussion. */ "reactions/create-for-team-discussion-legacy": { parameters: { path: { team_id: components["parameters"]["team-id"]; discussion_number: components["parameters"]["discussion-number"]; }; }; requestBody: { content: { "application/json": { /** * @description The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the team discussion. * @enum {string} */ content: | "+1" | "-1" | "laugh" | "confused" | "heart" | "hooray" | "rocket" | "eyes"; }; }; }; responses: { /** @description Response */ 201: { content: { "application/json": components["schemas"]["reaction"]; }; }; }; }; /** * List pending team invitations (Legacy) * @deprecated * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List pending team invitations`](https://docs.github.com/rest/teams/members#list-pending-team-invitations) endpoint. * * The return hash contains a `role` field which refers to the Organization Invitation role and will be one of the following values: `direct_member`, `admin`, `billing_manager`, `hiring_manager`, or `reinstate`. If the invitee is not a GitHub member, the `login` field in the return hash will be `null`. */ "teams/list-pending-invitations-legacy": { parameters: { query?: { per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; path: { team_id: components["parameters"]["team-id"]; }; }; responses: { /** @description Response */ 200: { headers: { Link: components["headers"]["link"]; }; content: { "application/json": components["schemas"]["organization-invitation"][]; }; }; }; }; /** * List team members (Legacy) * @deprecated * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List team members`](https://docs.github.com/rest/teams/members#list-team-members) endpoint. * * Team members will include the members of child teams. */ "teams/list-members-legacy": { parameters: { query?: { /** @description Filters members returned by their role in the team. */ role?: "member" | "maintainer" | "all"; per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; path: { team_id: components["parameters"]["team-id"]; }; }; responses: { /** @description Response */ 200: { headers: { Link: components["headers"]["link"]; }; content: { "application/json": components["schemas"]["simple-user"][]; }; }; 404: components["responses"]["not_found"]; }; }; /** * Get team member (Legacy) * @deprecated * @description The "Get team member" endpoint (described below) is deprecated. * * We recommend using the [Get team membership for a user](https://docs.github.com/rest/teams/members#get-team-membership-for-a-user) endpoint instead. It allows you to get both active and pending memberships. * * To list members in a team, the team must be visible to the authenticated user. */ "teams/get-member-legacy": { parameters: { path: { team_id: components["parameters"]["team-id"]; username: components["parameters"]["username"]; }; }; responses: { /** @description if user is a member */ 204: { content: never; }; /** @description if user is not a member */ 404: { content: never; }; }; }; /** * Add team member (Legacy) * @deprecated * @description The "Add team member" endpoint (described below) is deprecated. * * We recommend using the [Add or update team membership for a user](https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user) endpoint instead. It allows you to invite new organization members to your teams. * * Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * To add someone to a team, the authenticated user must be an organization owner or a team maintainer in the team they're changing. The person being added to the team must be a member of the team's organization. * * **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." * * Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." */ "teams/add-member-legacy": { parameters: { path: { team_id: components["parameters"]["team-id"]; username: components["parameters"]["username"]; }; }; responses: { /** @description Response */ 204: { content: never; }; 403: components["responses"]["forbidden"]; /** @description Not Found if team synchronization is set up */ 404: { content: never; }; /** @description Unprocessable Entity if you attempt to add an organization to a team or you attempt to add a user to a team when they are not a member of at least one other team in the same organization */ 422: { content: never; }; }; }; /** * Remove team member (Legacy) * @deprecated * @description The "Remove team member" endpoint (described below) is deprecated. * * We recommend using the [Remove team membership for a user](https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user) endpoint instead. It allows you to remove both active and pending memberships. * * Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * To remove a team member, the authenticated user must have 'admin' permissions to the team or be an owner of the org that the team is associated with. Removing a team member does not delete the user, it just removes them from the team. * * **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." */ "teams/remove-member-legacy": { parameters: { path: { team_id: components["parameters"]["team-id"]; username: components["parameters"]["username"]; }; }; responses: { /** @description Response */ 204: { content: never; }; /** @description Not Found if team synchronization is setup */ 404: { content: never; }; }; }; /** * Get team membership for a user (Legacy) * @deprecated * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get team membership for a user](https://docs.github.com/rest/teams/members#get-team-membership-for-a-user) endpoint. * * Team members will include the members of child teams. * * To get a user's membership with a team, the team must be visible to the authenticated user. * * **Note:** * The response contains the `state` of the membership and the member's `role`. * * The `role` for organization owners is set to `maintainer`. For more information about `maintainer` roles, see [Create a team](https://docs.github.com/rest/teams/teams#create-a-team). */ "teams/get-membership-for-user-legacy": { parameters: { path: { team_id: components["parameters"]["team-id"]; username: components["parameters"]["username"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["team-membership"]; }; }; 404: components["responses"]["not_found"]; }; }; /** * Add or update team membership for a user (Legacy) * @deprecated * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team membership for a user](https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user) endpoint. * * Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * If the user is already a member of the team's organization, this endpoint will add the user to the team. To add a membership between an organization member and a team, the authenticated user must be an organization owner or a team maintainer. * * **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." * * If the user is unaffiliated with the team's organization, this endpoint will send an invitation to the user via email. This newly-created membership will be in the "pending" state until the user accepts the invitation, at which point the membership will transition to the "active" state and the user will be added as a member of the team. To add a membership between an unaffiliated user and a team, the authenticated user must be an organization owner. * * If the user is already a member of the team, this endpoint will update the role of the team member's role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer. */ "teams/add-or-update-membership-for-user-legacy": { parameters: { path: { team_id: components["parameters"]["team-id"]; username: components["parameters"]["username"]; }; }; requestBody?: { content: { "application/json": { /** * @description The role that this user should have in the team. * @default member * @enum {string} */ role?: "member" | "maintainer"; }; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["team-membership"]; }; }; /** @description Forbidden if team synchronization is set up */ 403: { content: never; }; 404: components["responses"]["not_found"]; /** @description Unprocessable Entity if you attempt to add an organization to a team */ 422: { content: never; }; }; }; /** * Remove team membership for a user (Legacy) * @deprecated * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove team membership for a user](https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user) endpoint. * * Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * To remove a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with. Removing team membership does not delete the user, it just removes their membership from the team. * * **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." */ "teams/remove-membership-for-user-legacy": { parameters: { path: { team_id: components["parameters"]["team-id"]; username: components["parameters"]["username"]; }; }; responses: { /** @description Response */ 204: { content: never; }; /** @description if team synchronization is set up */ 403: { content: never; }; }; }; /** * List team projects (Legacy) * @deprecated * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List team projects`](https://docs.github.com/rest/teams/teams#list-team-projects) endpoint. * * Lists the organization projects for a team. */ "teams/list-projects-legacy": { parameters: { query?: { per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; path: { team_id: components["parameters"]["team-id"]; }; }; responses: { /** @description Response */ 200: { headers: { Link: components["headers"]["link"]; }; content: { "application/json": components["schemas"]["team-project"][]; }; }; 404: components["responses"]["not_found"]; }; }; /** * Check team permissions for a project (Legacy) * @deprecated * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a project](https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project) endpoint. * * Checks whether a team has `read`, `write`, or `admin` permissions for an organization project. The response includes projects inherited from a parent team. */ "teams/check-permissions-for-project-legacy": { parameters: { path: { team_id: components["parameters"]["team-id"]; project_id: components["parameters"]["project-id"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["team-project"]; }; }; /** @description Not Found if project is not managed by this team */ 404: { content: never; }; }; }; /** * Add or update team project permissions (Legacy) * @deprecated * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team project permissions](https://docs.github.com/rest/teams/teams#add-or-update-team-project-permissions) endpoint. * * Adds an organization project to a team. To add a project to a team or update the team's permission on a project, the authenticated user must have `admin` permissions for the project. The project and team must be part of the same organization. */ "teams/add-or-update-project-permissions-legacy": { parameters: { path: { team_id: components["parameters"]["team-id"]; project_id: components["parameters"]["project-id"]; }; }; requestBody?: { content: { "application/json": { /** * @description The permission to grant to the team for this project. Default: the team's `permission` attribute will be used to determine what permission to grant the team on this project. Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." * @enum {string} */ permission?: "read" | "write" | "admin"; }; }; }; responses: { /** @description Response */ 204: { content: never; }; /** @description Forbidden if the project is not owned by the organization */ 403: { content: { "application/json": { message?: string; documentation_url?: string; }; }; }; 404: components["responses"]["not_found"]; 422: components["responses"]["validation_failed"]; }; }; /** * Remove a project from a team (Legacy) * @deprecated * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a project from a team](https://docs.github.com/rest/teams/teams#remove-a-project-from-a-team) endpoint. * * Removes an organization project from a team. An organization owner or a team maintainer can remove any project from the team. To remove a project from a team as an organization member, the authenticated user must have `read` access to both the team and project, or `admin` access to the team or project. **Note:** This endpoint removes the project from the team, but does not delete it. */ "teams/remove-project-legacy": { parameters: { path: { team_id: components["parameters"]["team-id"]; project_id: components["parameters"]["project-id"]; }; }; responses: { /** @description Response */ 204: { content: never; }; 404: components["responses"]["not_found"]; 422: components["responses"]["validation_failed"]; }; }; /** * List team repositories (Legacy) * @deprecated * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [List team repositories](https://docs.github.com/rest/teams/teams#list-team-repositories) endpoint. */ "teams/list-repos-legacy": { parameters: { query?: { per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; path: { team_id: components["parameters"]["team-id"]; }; }; responses: { /** @description Response */ 200: { headers: { Link: components["headers"]["link"]; }; content: { "application/json": components["schemas"]["minimal-repository"][]; }; }; 404: components["responses"]["not_found"]; }; }; /** * Check team permissions for a repository (Legacy) * @deprecated * @description **Note**: Repositories inherited through a parent team will also be checked. * * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a repository](https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository) endpoint. * * You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the `Accept` header: */ "teams/check-permissions-for-repo-legacy": { parameters: { path: { team_id: components["parameters"]["team-id"]; owner: components["parameters"]["owner"]; repo: components["parameters"]["repo"]; }; }; responses: { /** @description Alternative response with extra repository information */ 200: { content: { "application/json": components["schemas"]["team-repository"]; }; }; /** @description Response if repository is managed by this team */ 204: { content: never; }; /** @description Not Found if repository is not managed by this team */ 404: { content: never; }; }; }; /** * Add or update team repository permissions (Legacy) * @deprecated * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Add or update team repository permissions](https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions)" endpoint. * * To add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a `422 Unprocessable Entity` status if you attempt to add a repository to a team that is not owned by the organization. * * Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." */ "teams/add-or-update-repo-permissions-legacy": { parameters: { path: { team_id: components["parameters"]["team-id"]; owner: components["parameters"]["owner"]; repo: components["parameters"]["repo"]; }; }; requestBody?: { content: { "application/json": { /** * @description The permission to grant the team on this repository. If no permission is specified, the team's `permission` attribute will be used to determine what permission to grant the team on this repository. * @enum {string} */ permission?: "pull" | "push" | "admin"; }; }; }; responses: { /** @description Response */ 204: { content: never; }; 403: components["responses"]["forbidden"]; 422: components["responses"]["validation_failed"]; }; }; /** * Remove a repository from a team (Legacy) * @deprecated * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a repository from a team](https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team) endpoint. * * If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. NOTE: This does not delete the repository, it just removes it from the team. */ "teams/remove-repo-legacy": { parameters: { path: { team_id: components["parameters"]["team-id"]; owner: components["parameters"]["owner"]; repo: components["parameters"]["repo"]; }; }; responses: { /** @description Response */ 204: { content: never; }; }; }; /** * List child teams (Legacy) * @deprecated * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List child teams`](https://docs.github.com/rest/teams/teams#list-child-teams) endpoint. */ "teams/list-child-legacy": { parameters: { query?: { per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; path: { team_id: components["parameters"]["team-id"]; }; }; responses: { /** @description if child teams exist */ 200: { headers: { Link: components["headers"]["link"]; }; content: { "application/json": components["schemas"]["team"][]; }; }; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; 422: components["responses"]["validation_failed"]; }; }; /** * Get the authenticated user * @description If the authenticated user is authenticated with an OAuth token with the `user` scope, then the response lists public and private profile information. * * If the authenticated user is authenticated through OAuth without the `user` scope, then the response lists only public profile information. */ "users/get-authenticated": { responses: { /** @description Response */ 200: { content: { "application/json": | components["schemas"]["private-user"] | components["schemas"]["public-user"]; }; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; }; }; /** * Update the authenticated user * @description **Note:** If your email is set to private and you send an `email` parameter as part of this request to update your profile, your privacy settings are still enforced: the email address will not be displayed on your public profile or via the API. */ "users/update-authenticated": { requestBody?: { content: { "application/json": { /** * @description The new name of the user. * @example Omar Jahandar */ name?: string; /** * @description The publicly visible email address of the user. * @example omar@example.com */ email?: string; /** * @description The new blog URL of the user. * @example blog.example.com */ blog?: string; /** * @description The new Twitter username of the user. * @example therealomarj */ twitter_username?: string | null; /** * @description The new company of the user. * @example Acme corporation */ company?: string; /** * @description The new location of the user. * @example Berlin, Germany */ location?: string; /** @description The new hiring availability of the user. */ hireable?: boolean; /** @description The new short biography of the user. */ bio?: string; }; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["private-user"]; }; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; 422: components["responses"]["validation_failed"]; }; }; /** * List users blocked by the authenticated user * @description List the users you've blocked on your personal account. */ "users/list-blocked-by-authenticated-user": { parameters: { query?: { per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["simple-user"][]; }; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; }; }; /** * Check if a user is blocked by the authenticated user * @description Returns a 204 if the given user is blocked by the authenticated user. Returns a 404 if the given user is not blocked by the authenticated user, or if the given user account has been identified as spam by GitHub. */ "users/check-blocked": { parameters: { path: { username: components["parameters"]["username"]; }; }; responses: { /** @description If the user is blocked */ 204: { content: never; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; /** @description If the user is not blocked */ 404: { content: { "application/json": components["schemas"]["basic-error"]; }; }; }; }; /** * Block a user * @description Blocks the given user and returns a 204. If the authenticated user cannot block the given user a 422 is returned. */ "users/block": { parameters: { path: { username: components["parameters"]["username"]; }; }; responses: { /** @description Response */ 204: { content: never; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; 422: components["responses"]["validation_failed"]; }; }; /** * Unblock a user * @description Unblocks the given user and returns a 204. */ "users/unblock": { parameters: { path: { username: components["parameters"]["username"]; }; }; responses: { /** @description Response */ 204: { content: never; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; }; }; /** * List codespaces for the authenticated user * @description Lists the authenticated user's codespaces. * * You must authenticate using an access token with the `codespace` scope to use this endpoint. * * GitHub Apps must have read access to the `codespaces` repository permission to use this endpoint. */ "codespaces/list-for-authenticated-user": { parameters: { query?: { per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; repository_id?: components["parameters"]["repository-id-in-query"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": { total_count: number; codespaces: components["schemas"]["codespace"][]; }; }; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; 500: components["responses"]["internal_error"]; }; }; /** * Create a codespace for the authenticated user * @description Creates a new codespace, owned by the authenticated user. * * This endpoint requires either a `repository_id` OR a `pull_request` but not both. * * You must authenticate using an access token with the `codespace` scope to use this endpoint. * * GitHub Apps must have write access to the `codespaces` repository permission to use this endpoint. */ "codespaces/create-for-authenticated-user": { requestBody: { content: { "application/json": OneOf< [ { /** @description Repository id for this codespace */ repository_id: number; /** @description Git ref (typically a branch name) for this codespace */ ref?: string; /** @description The requested location for a new codespace. Best efforts are made to respect this upon creation. Assigned by IP if not provided. */ location?: string; /** * @description The geographic area for this codespace. If not specified, the value is assigned by IP. This property replaces `location`, which is being deprecated. * @enum {string} */ geo?: "EuropeWest" | "SoutheastAsia" | "UsEast" | "UsWest"; /** @description IP for location auto-detection when proxying a request */ client_ip?: string; /** @description Machine type to use for this codespace */ machine?: string; /** @description Path to devcontainer.json config to use for this codespace */ devcontainer_path?: string; /** @description Whether to authorize requested permissions from devcontainer.json */ multi_repo_permissions_opt_out?: boolean; /** @description Working directory for this codespace */ working_directory?: string; /** @description Time in minutes before codespace stops from inactivity */ idle_timeout_minutes?: number; /** @description Display name for this codespace */ display_name?: string; /** @description Duration in minutes after codespace has gone idle in which it will be deleted. Must be integer minutes between 0 and 43200 (30 days). */ retention_period_minutes?: number; }, { /** @description Pull request number for this codespace */ pull_request: { /** @description Pull request number */ pull_request_number: number; /** @description Repository id for this codespace */ repository_id: number; }; /** @description The requested location for a new codespace. Best efforts are made to respect this upon creation. Assigned by IP if not provided. */ location?: string; /** * @description The geographic area for this codespace. If not specified, the value is assigned by IP. This property replaces `location`, which is being deprecated. * @enum {string} */ geo?: "EuropeWest" | "SoutheastAsia" | "UsEast" | "UsWest"; /** @description Machine type to use for this codespace */ machine?: string; /** @description Path to devcontainer.json config to use for this codespace */ devcontainer_path?: string; /** @description Working directory for this codespace */ working_directory?: string; /** @description Time in minutes before codespace stops from inactivity */ idle_timeout_minutes?: number; }, ] >; }; }; responses: { /** @description Response when the codespace was successfully created */ 201: { content: { "application/json": components["schemas"]["codespace"]; }; }; /** @description Response when the codespace creation partially failed but is being retried in the background */ 202: { content: { "application/json": components["schemas"]["codespace"]; }; }; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; 503: components["responses"]["service_unavailable"]; }; }; /** * List secrets for the authenticated user * @description Lists all secrets available for a user's Codespaces without revealing their * encrypted values. * * You must authenticate using an access token with the `codespace` or `codespace:secrets` scope to use this endpoint. User must have Codespaces access to use this endpoint. * * GitHub Apps must have read access to the `codespaces_user_secrets` user permission to use this endpoint. */ "codespaces/list-secrets-for-authenticated-user": { parameters: { query?: { per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; }; responses: { /** @description Response */ 200: { headers: { Link: components["headers"]["link"]; }; content: { "application/json": { total_count: number; secrets: components["schemas"]["codespaces-secret"][]; }; }; }; }; }; /** * Get public key for the authenticated user * @description Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. * * You must authenticate using an access token with the `codespace` or `codespace:secrets` scope to use this endpoint. User must have Codespaces access to use this endpoint. * * GitHub Apps must have read access to the `codespaces_user_secrets` user permission to use this endpoint. */ "codespaces/get-public-key-for-authenticated-user": { responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["codespaces-user-public-key"]; }; }; }; }; /** * Get a secret for the authenticated user * @description Gets a secret available to a user's codespaces without revealing its encrypted value. * * You must authenticate using an access token with the `codespace` or `codespace:secrets` scope to use this endpoint. User must have Codespaces access to use this endpoint. * * GitHub Apps must have read access to the `codespaces_user_secrets` user permission to use this endpoint. */ "codespaces/get-secret-for-authenticated-user": { parameters: { path: { secret_name: components["parameters"]["secret-name"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["codespaces-secret"]; }; }; }; }; /** * Create or update a secret for the authenticated user * @description Creates or updates a secret for a user's codespace with an encrypted value. Encrypt your secret using * [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)." * * You must authenticate using an access token with the `codespace` or `codespace:secrets` scope to use this endpoint. User must also have Codespaces access to use this endpoint. * * GitHub Apps must have write access to the `codespaces_user_secrets` user permission and `codespaces_secrets` repository permission on all referenced repositories to use this endpoint. */ "codespaces/create-or-update-secret-for-authenticated-user": { parameters: { path: { secret_name: components["parameters"]["secret-name"]; }; }; requestBody: { content: { "application/json": { /** @description Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get the public key for the authenticated user](https://docs.github.com/rest/codespaces/secrets#get-public-key-for-the-authenticated-user) endpoint. */ encrypted_value?: string; /** @description ID of the key you used to encrypt the secret. */ key_id: string; /** @description An array of repository ids that can access the user secret. You can manage the list of selected repositories using the [List selected repositories for a user secret](https://docs.github.com/rest/codespaces/secrets#list-selected-repositories-for-a-user-secret), [Set selected repositories for a user secret](https://docs.github.com/rest/codespaces/secrets#set-selected-repositories-for-a-user-secret), and [Remove a selected repository from a user secret](https://docs.github.com/rest/codespaces/secrets#remove-a-selected-repository-from-a-user-secret) endpoints. */ selected_repository_ids?: (number | string)[]; }; }; }; responses: { /** @description Response after successfully creating a secret */ 201: { content: { "application/json": components["schemas"]["empty-object"]; }; }; /** @description Response after successfully updating a secret */ 204: { content: never; }; 404: components["responses"]["not_found"]; 422: components["responses"]["validation_failed"]; }; }; /** * Delete a secret for the authenticated user * @description Deletes a secret from a user's codespaces using the secret name. Deleting the secret will remove access from all codespaces that were allowed to access the secret. * * You must authenticate using an access token with the `codespace` or `codespace:secrets` scope to use this endpoint. User must have Codespaces access to use this endpoint. * * GitHub Apps must have write access to the `codespaces_user_secrets` user permission to use this endpoint. */ "codespaces/delete-secret-for-authenticated-user": { parameters: { path: { secret_name: components["parameters"]["secret-name"]; }; }; responses: { /** @description Response */ 204: { content: never; }; }; }; /** * List selected repositories for a user secret * @description List the repositories that have been granted the ability to use a user's codespace secret. * * You must authenticate using an access token with the `codespace` or `codespace:secrets` scope to use this endpoint. User must have Codespaces access to use this endpoint. * * GitHub Apps must have read access to the `codespaces_user_secrets` user permission and write access to the `codespaces_secrets` repository permission on all referenced repositories to use this endpoint. */ "codespaces/list-repositories-for-secret-for-authenticated-user": { parameters: { path: { secret_name: components["parameters"]["secret-name"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": { total_count: number; repositories: components["schemas"]["minimal-repository"][]; }; }; }; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; 500: components["responses"]["internal_error"]; }; }; /** * Set selected repositories for a user secret * @description Select the repositories that will use a user's codespace secret. * * You must authenticate using an access token with the `codespace` or `codespace:secrets` scope to use this endpoint. User must have Codespaces access to use this endpoint. * * GitHub Apps must have write access to the `codespaces_user_secrets` user permission and write access to the `codespaces_secrets` repository permission on all referenced repositories to use this endpoint. */ "codespaces/set-repositories-for-secret-for-authenticated-user": { parameters: { path: { secret_name: components["parameters"]["secret-name"]; }; }; requestBody: { content: { "application/json": { /** @description An array of repository ids for which a codespace can access the secret. You can manage the list of selected repositories using the [List selected repositories for a user secret](https://docs.github.com/rest/codespaces/secrets#list-selected-repositories-for-a-user-secret), [Add a selected repository to a user secret](https://docs.github.com/rest/codespaces/secrets#add-a-selected-repository-to-a-user-secret), and [Remove a selected repository from a user secret](https://docs.github.com/rest/codespaces/secrets#remove-a-selected-repository-from-a-user-secret) endpoints. */ selected_repository_ids: number[]; }; }; }; responses: { /** @description No Content when repositories were added to the selected list */ 204: { content: never; }; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; 500: components["responses"]["internal_error"]; }; }; /** * Add a selected repository to a user secret * @description Adds a repository to the selected repositories for a user's codespace secret. * You must authenticate using an access token with the `codespace` or `codespace:secrets` scope to use this endpoint. User must have Codespaces access to use this endpoint. * GitHub Apps must have write access to the `codespaces_user_secrets` user permission and write access to the `codespaces_secrets` repository permission on the referenced repository to use this endpoint. */ "codespaces/add-repository-for-secret-for-authenticated-user": { parameters: { path: { secret_name: components["parameters"]["secret-name"]; repository_id: number; }; }; responses: { /** @description No Content when repository was added to the selected list */ 204: { content: never; }; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; 500: components["responses"]["internal_error"]; }; }; /** * Remove a selected repository from a user secret * @description Removes a repository from the selected repositories for a user's codespace secret. * You must authenticate using an access token with the `codespace` or `codespace:secrets` scope to use this endpoint. User must have Codespaces access to use this endpoint. * GitHub Apps must have write access to the `codespaces_user_secrets` user permission to use this endpoint. */ "codespaces/remove-repository-for-secret-for-authenticated-user": { parameters: { path: { secret_name: components["parameters"]["secret-name"]; repository_id: number; }; }; responses: { /** @description No Content when repository was removed from the selected list */ 204: { content: never; }; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; 500: components["responses"]["internal_error"]; }; }; /** * Get a codespace for the authenticated user * @description Gets information about a user's codespace. * * You must authenticate using an access token with the `codespace` scope to use this endpoint. * * GitHub Apps must have read access to the `codespaces` repository permission to use this endpoint. */ "codespaces/get-for-authenticated-user": { parameters: { path: { codespace_name: components["parameters"]["codespace-name"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["codespace"]; }; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; 500: components["responses"]["internal_error"]; }; }; /** * Delete a codespace for the authenticated user * @description Deletes a user's codespace. * * You must authenticate using an access token with the `codespace` scope to use this endpoint. * * GitHub Apps must have write access to the `codespaces` repository permission to use this endpoint. */ "codespaces/delete-for-authenticated-user": { parameters: { path: { codespace_name: components["parameters"]["codespace-name"]; }; }; responses: { 202: components["responses"]["accepted"]; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; 500: components["responses"]["internal_error"]; }; }; /** * Update a codespace for the authenticated user * @description Updates a codespace owned by the authenticated user. Currently only the codespace's machine type and recent folders can be modified using this endpoint. * * If you specify a new machine type it will be applied the next time your codespace is started. * * You must authenticate using an access token with the `codespace` scope to use this endpoint. * * GitHub Apps must have write access to the `codespaces` repository permission to use this endpoint. */ "codespaces/update-for-authenticated-user": { parameters: { path: { codespace_name: components["parameters"]["codespace-name"]; }; }; requestBody?: { content: { "application/json": { /** @description A valid machine to transition this codespace to. */ machine?: string; /** @description Display name for this codespace */ display_name?: string; /** @description Recently opened folders inside the codespace. It is currently used by the clients to determine the folder path to load the codespace in. */ recent_folders?: string[]; }; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["codespace"]; }; }; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; }; }; /** * Export a codespace for the authenticated user * @description Triggers an export of the specified codespace and returns a URL and ID where the status of the export can be monitored. * * If changes cannot be pushed to the codespace's repository, they will be pushed to a new or previously-existing fork instead. * * You must authenticate using a personal access token with the `codespace` scope to use this endpoint. * * GitHub Apps must have write access to the `codespaces_lifecycle_admin` repository permission to use this endpoint. */ "codespaces/export-for-authenticated-user": { parameters: { path: { codespace_name: components["parameters"]["codespace-name"]; }; }; responses: { /** @description Response */ 202: { content: { "application/json": components["schemas"]["codespace-export-details"]; }; }; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; 422: components["responses"]["validation_failed"]; 500: components["responses"]["internal_error"]; }; }; /** * Get details about a codespace export * @description Gets information about an export of a codespace. * * You must authenticate using a personal access token with the `codespace` scope to use this endpoint. * * GitHub Apps must have read access to the `codespaces_lifecycle_admin` repository permission to use this endpoint. */ "codespaces/get-export-details-for-authenticated-user": { parameters: { path: { codespace_name: components["parameters"]["codespace-name"]; export_id: components["parameters"]["export-id"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["codespace-export-details"]; }; }; 404: components["responses"]["not_found"]; }; }; /** * List machine types for a codespace * @description List the machine types a codespace can transition to use. * * You must authenticate using an access token with the `codespace` scope to use this endpoint. * * GitHub Apps must have read access to the `codespaces_metadata` repository permission to use this endpoint. */ "codespaces/codespace-machines-for-authenticated-user": { parameters: { path: { codespace_name: components["parameters"]["codespace-name"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": { total_count: number; machines: components["schemas"]["codespace-machine"][]; }; }; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; 500: components["responses"]["internal_error"]; }; }; /** * Create a repository from an unpublished codespace * @description Publishes an unpublished codespace, creating a new repository and assigning it to the codespace. * * The codespace's token is granted write permissions to the repository, allowing the user to push their changes. * * This will fail for a codespace that is already published, meaning it has an associated repository. * * You must authenticate using a personal access token with the `codespace` scope to use this endpoint. * * GitHub Apps must have write access to the `codespaces` repository permission to use this endpoint. */ "codespaces/publish-for-authenticated-user": { parameters: { path: { codespace_name: components["parameters"]["codespace-name"]; }; }; requestBody: { content: { "application/json": { /** @description A name for the new repository. */ name?: string; /** * @description Whether the new repository should be private. * @default false */ private?: boolean; }; }; }; responses: { /** @description Response */ 201: { content: { "application/json": components["schemas"]["codespace-with-full-repository"]; }; }; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; 422: components["responses"]["validation_failed"]; }; }; /** * Start a codespace for the authenticated user * @description Starts a user's codespace. * * You must authenticate using an access token with the `codespace` scope to use this endpoint. * * GitHub Apps must have write access to the `codespaces_lifecycle_admin` repository permission to use this endpoint. */ "codespaces/start-for-authenticated-user": { parameters: { path: { codespace_name: components["parameters"]["codespace-name"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["codespace"]; }; }; 304: components["responses"]["not_modified"]; 400: components["responses"]["bad_request"]; 401: components["responses"]["requires_authentication"]; /** @description Payment required */ 402: { content: { "application/json": components["schemas"]["basic-error"]; }; }; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; 409: components["responses"]["conflict"]; 500: components["responses"]["internal_error"]; }; }; /** * Stop a codespace for the authenticated user * @description Stops a user's codespace. * * You must authenticate using an access token with the `codespace` scope to use this endpoint. * * GitHub Apps must have write access to the `codespaces_lifecycle_admin` repository permission to use this endpoint. */ "codespaces/stop-for-authenticated-user": { parameters: { path: { codespace_name: components["parameters"]["codespace-name"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["codespace"]; }; }; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; 500: components["responses"]["internal_error"]; }; }; /** * Get list of conflicting packages during Docker migration for authenticated-user * @description Lists all packages that are owned by the authenticated user within the user's namespace, and that encountered a conflict during a Docker migration. * To use this endpoint, you must authenticate using an access token with the `read:packages` scope. */ "packages/list-docker-migration-conflicting-packages-for-authenticated-user": { responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["package"][]; }; }; }; }; /** * Set primary email visibility for the authenticated user * @description Sets the visibility for your primary email addresses. */ "users/set-primary-email-visibility-for-authenticated-user": { requestBody: { content: { "application/json": { /** * @description Denotes whether an email is publicly visible. * @enum {string} */ visibility: "public" | "private"; }; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["email"][]; }; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; 422: components["responses"]["validation_failed"]; }; }; /** * List email addresses for the authenticated user * @description Lists all of your email addresses, and specifies which one is visible to the public. This endpoint is accessible with the `user:email` scope. */ "users/list-emails-for-authenticated-user": { parameters: { query?: { per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; }; responses: { /** @description Response */ 200: { headers: { Link: components["headers"]["link"]; }; content: { "application/json": components["schemas"]["email"][]; }; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; }; }; /** * Add an email address for the authenticated user * @description This endpoint is accessible with the `user` scope. */ "users/add-email-for-authenticated-user": { requestBody?: { content: { "application/json": { /** * @description Adds one or more email addresses to your GitHub account. Must contain at least one email address. **Note:** Alternatively, you can pass a single email address or an `array` of emails addresses directly, but we recommend that you pass an object using the `emails` key. * @example [] */ emails: string[]; }; }; }; responses: { /** @description Response */ 201: { content: { "application/json": components["schemas"]["email"][]; }; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; 422: components["responses"]["validation_failed"]; }; }; /** * Delete an email address for the authenticated user * @description This endpoint is accessible with the `user` scope. */ "users/delete-email-for-authenticated-user": { requestBody?: { content: { "application/json": { /** @description Email addresses associated with the GitHub user account. */ emails: string[]; }; }; }; responses: { /** @description Response */ 204: { content: never; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; 422: components["responses"]["validation_failed"]; }; }; /** * List followers of the authenticated user * @description Lists the people following the authenticated user. */ "users/list-followers-for-authenticated-user": { parameters: { query?: { per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; }; responses: { /** @description Response */ 200: { headers: { Link: components["headers"]["link"]; }; content: { "application/json": components["schemas"]["simple-user"][]; }; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; }; }; /** * List the people the authenticated user follows * @description Lists the people who the authenticated user follows. */ "users/list-followed-by-authenticated-user": { parameters: { query?: { per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; }; responses: { /** @description Response */ 200: { headers: { Link: components["headers"]["link"]; }; content: { "application/json": components["schemas"]["simple-user"][]; }; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; }; }; /** Check if a person is followed by the authenticated user */ "users/check-person-is-followed-by-authenticated": { parameters: { path: { username: components["parameters"]["username"]; }; }; responses: { /** @description if the person is followed by the authenticated user */ 204: { content: never; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; /** @description if the person is not followed by the authenticated user */ 404: { content: { "application/json": components["schemas"]["basic-error"]; }; }; }; }; /** * Follow a user * @description Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." * * Following a user requires the user to be logged in and authenticated with basic auth or OAuth with the `user:follow` scope. */ "users/follow": { parameters: { path: { username: components["parameters"]["username"]; }; }; responses: { /** @description Response */ 204: { content: never; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; }; }; /** * Unfollow a user * @description Unfollowing a user requires the user to be logged in and authenticated with basic auth or OAuth with the `user:follow` scope. */ "users/unfollow": { parameters: { path: { username: components["parameters"]["username"]; }; }; responses: { /** @description Response */ 204: { content: never; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; }; }; /** * List GPG keys for the authenticated user * @description Lists the current user's GPG keys. Requires that you are authenticated via Basic Auth or via OAuth with at least `read:gpg_key` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ "users/list-gpg-keys-for-authenticated-user": { parameters: { query?: { per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; }; responses: { /** @description Response */ 200: { headers: { Link: components["headers"]["link"]; }; content: { "application/json": components["schemas"]["gpg-key"][]; }; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; }; }; /** * Create a GPG key for the authenticated user * @description Adds a GPG key to the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth, or OAuth with at least `write:gpg_key` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ "users/create-gpg-key-for-authenticated-user": { requestBody: { content: { "application/json": { /** @description A descriptive name for the new key. */ name?: string; /** @description A GPG key in ASCII-armored format. */ armored_public_key: string; }; }; }; responses: { /** @description Response */ 201: { content: { "application/json": components["schemas"]["gpg-key"]; }; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; 422: components["responses"]["validation_failed"]; }; }; /** * Get a GPG key for the authenticated user * @description View extended details for a single GPG key. Requires that you are authenticated via Basic Auth or via OAuth with at least `read:gpg_key` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ "users/get-gpg-key-for-authenticated-user": { parameters: { path: { gpg_key_id: components["parameters"]["gpg-key-id"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["gpg-key"]; }; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; }; }; /** * Delete a GPG key for the authenticated user * @description Removes a GPG key from the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth or via OAuth with at least `admin:gpg_key` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ "users/delete-gpg-key-for-authenticated-user": { parameters: { path: { gpg_key_id: components["parameters"]["gpg-key-id"]; }; }; responses: { /** @description Response */ 204: { content: never; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; 422: components["responses"]["validation_failed"]; }; }; /** * List app installations accessible to the user access token * @description Lists installations of your GitHub App that the authenticated user has explicit permission (`:read`, `:write`, or `:admin`) to access. * * You must use a [user access token](https://docs.github.com/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app), created for a user who has authorized your GitHub App, to access this endpoint. * * The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership. * * You can find the permissions for the installation under the `permissions` key. */ "apps/list-installations-for-authenticated-user": { parameters: { query?: { per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; }; responses: { /** @description You can find the permissions for the installation under the `permissions` key. */ 200: { headers: { Link: components["headers"]["link"]; }; content: { "application/json": { total_count: number; installations: components["schemas"]["installation"][]; }; }; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; }; }; /** * List repositories accessible to the user access token * @description List repositories that the authenticated user has explicit permission (`:read`, `:write`, or `:admin`) to access for an installation. * * The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership. * * You must use a [user access token](https://docs.github.com/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app), created for a user who has authorized your GitHub App, to access this endpoint. * * The access the user has to each repository is included in the hash under the `permissions` key. */ "apps/list-installation-repos-for-authenticated-user": { parameters: { query?: { per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; path: { installation_id: components["parameters"]["installation-id"]; }; }; responses: { /** @description The access the user has to each repository is included in the hash under the `permissions` key. */ 200: { headers: { Link: components["headers"]["link"]; }; content: { "application/json": { total_count: number; repository_selection?: string; repositories: components["schemas"]["repository"][]; }; }; }; 304: components["responses"]["not_modified"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; }; }; /** * Add a repository to an app installation * @description Add a single repository to an installation. The authenticated user must have admin access to the repository. * * You must use a personal access token (which you can create via the [command line](https://docs.github.com/github/authenticating-to-github/creating-a-personal-access-token) or [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication)) to access this endpoint. */ "apps/add-repo-to-installation-for-authenticated-user": { parameters: { path: { installation_id: components["parameters"]["installation-id"]; repository_id: components["parameters"]["repository-id"]; }; }; responses: { /** @description Response */ 204: { content: never; }; 304: components["responses"]["not_modified"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; }; }; /** * Remove a repository from an app installation * @description Remove a single repository from an installation. The authenticated user must have admin access to the repository. The installation must have the `repository_selection` of `selected`. * * You must use a personal access token (which you can create via the [command line](https://docs.github.com/github/authenticating-to-github/creating-a-personal-access-token) or [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication)) to access this endpoint. */ "apps/remove-repo-from-installation-for-authenticated-user": { parameters: { path: { installation_id: components["parameters"]["installation-id"]; repository_id: components["parameters"]["repository-id"]; }; }; responses: { /** @description Response */ 204: { content: never; }; 304: components["responses"]["not_modified"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; /** @description Returned when the application is installed on `all` repositories in the organization, or if this request would remove the last repository that the application has access to in the organization. */ 422: { content: never; }; }; }; /** * Get interaction restrictions for your public repositories * @description Shows which type of GitHub user can interact with your public repositories and when the restriction expires. */ "interactions/get-restrictions-for-authenticated-user": { responses: { /** @description Default response */ 200: { content: { "application/json": | components["schemas"]["interaction-limit-response"] | Record; }; }; /** @description Response when there are no restrictions */ 204: { content: never; }; }; }; /** * Set interaction restrictions for your public repositories * @description Temporarily restricts which type of GitHub user can interact with your public repositories. Setting the interaction limit at the user level will overwrite any interaction limits that are set for individual repositories owned by the user. */ "interactions/set-restrictions-for-authenticated-user": { requestBody: { content: { "application/json": components["schemas"]["interaction-limit"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["interaction-limit-response"]; }; }; 422: components["responses"]["validation_failed"]; }; }; /** * Remove interaction restrictions from your public repositories * @description Removes any interaction restrictions from your public repositories. */ "interactions/remove-restrictions-for-authenticated-user": { responses: { /** @description Response */ 204: { content: never; }; }; }; /** * List user account issues assigned to the authenticated user * @description List issues across owned and member repositories assigned to the authenticated user. * * **Note**: GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For this * reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by * the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull * request id, use the "[List pull requests](https://docs.github.com/rest/pulls/pulls#list-pull-requests)" endpoint. */ "issues/list-for-authenticated-user": { parameters: { query?: { /** @description Indicates which sorts of issues to return. `assigned` means issues assigned to you. `created` means issues created by you. `mentioned` means issues mentioning you. `subscribed` means issues you're subscribed to updates for. `all` or `repos` means all issues you can see, regardless of participation or creation. */ filter?: | "assigned" | "created" | "mentioned" | "subscribed" | "repos" | "all"; /** @description Indicates the state of the issues to return. */ state?: "open" | "closed" | "all"; labels?: components["parameters"]["labels"]; /** @description What to sort results by. */ sort?: "created" | "updated" | "comments"; direction?: components["parameters"]["direction"]; since?: components["parameters"]["since"]; per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; }; responses: { /** @description Response */ 200: { headers: { Link: components["headers"]["link"]; }; content: { "application/json": components["schemas"]["issue"][]; }; }; 304: components["responses"]["not_modified"]; 404: components["responses"]["not_found"]; }; }; /** * List public SSH keys for the authenticated user * @description Lists the public SSH keys for the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth or via OAuth with at least `read:public_key` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ "users/list-public-ssh-keys-for-authenticated-user": { parameters: { query?: { per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; }; responses: { /** @description Response */ 200: { headers: { Link: components["headers"]["link"]; }; content: { "application/json": components["schemas"]["key"][]; }; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; }; }; /** * Create a public SSH key for the authenticated user * @description Adds a public SSH key to the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth, or OAuth with at least `write:public_key` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ "users/create-public-ssh-key-for-authenticated-user": { requestBody: { content: { "application/json": { /** * @description A descriptive name for the new key. * @example Personal MacBook Air */ title?: string; /** @description The public SSH key to add to your GitHub account. */ key: string; }; }; }; responses: { /** @description Response */ 201: { content: { "application/json": components["schemas"]["key"]; }; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; 422: components["responses"]["validation_failed"]; }; }; /** * Get a public SSH key for the authenticated user * @description View extended details for a single public SSH key. Requires that you are authenticated via Basic Auth or via OAuth with at least `read:public_key` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ "users/get-public-ssh-key-for-authenticated-user": { parameters: { path: { key_id: components["parameters"]["key-id"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["key"]; }; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; }; }; /** * Delete a public SSH key for the authenticated user * @description Removes a public SSH key from the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth or via OAuth with at least `admin:public_key` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ "users/delete-public-ssh-key-for-authenticated-user": { parameters: { path: { key_id: components["parameters"]["key-id"]; }; }; responses: { /** @description Response */ 204: { content: never; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; }; }; /** * List subscriptions for the authenticated user * @description Lists the active subscriptions for the authenticated user. GitHub Apps must use a [user access token](https://docs.github.com/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app), created for a user who has authorized your GitHub App, to access this endpoint. OAuth apps must authenticate using an [OAuth token](https://docs.github.com/apps/oauth-apps/building-oauth-apps/authorizing-oauth-apps). */ "apps/list-subscriptions-for-authenticated-user": { parameters: { query?: { per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; }; responses: { /** @description Response */ 200: { headers: { Link: components["headers"]["link"]; }; content: { "application/json": components["schemas"]["user-marketplace-purchase"][]; }; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 404: components["responses"]["not_found"]; }; }; /** * List subscriptions for the authenticated user (stubbed) * @description Lists the active subscriptions for the authenticated user. GitHub Apps must use a [user access token](https://docs.github.com/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app), created for a user who has authorized your GitHub App, to access this endpoint. OAuth apps must authenticate using an [OAuth token](https://docs.github.com/apps/oauth-apps/building-oauth-apps/authorizing-oauth-apps). */ "apps/list-subscriptions-for-authenticated-user-stubbed": { parameters: { query?: { per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; }; responses: { /** @description Response */ 200: { headers: { Link: components["headers"]["link"]; }; content: { "application/json": components["schemas"]["user-marketplace-purchase"][]; }; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; }; }; /** * List organization memberships for the authenticated user * @description Lists all of the authenticated user's organization memberships. */ "orgs/list-memberships-for-authenticated-user": { parameters: { query?: { /** @description Indicates the state of the memberships to return. If not specified, the API returns both active and pending memberships. */ state?: "active" | "pending"; per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; }; responses: { /** @description Response */ 200: { headers: { Link: components["headers"]["link"]; }; content: { "application/json": components["schemas"]["org-membership"][]; }; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 422: components["responses"]["validation_failed"]; }; }; /** * Get an organization membership for the authenticated user * @description If the authenticated user is an active or pending member of the organization, this endpoint will return the user's membership. If the authenticated user is not affiliated with the organization, a `404` is returned. This endpoint will return a `403` if the request is made by a GitHub App that is blocked by the organization. */ "orgs/get-membership-for-authenticated-user": { parameters: { path: { org: components["parameters"]["org"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["org-membership"]; }; }; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; }; }; /** * Update an organization membership for the authenticated user * @description Converts the authenticated user to an active member of the organization, if that user has a pending invitation from the organization. */ "orgs/update-membership-for-authenticated-user": { parameters: { path: { org: components["parameters"]["org"]; }; }; requestBody: { content: { "application/json": { /** * @description The state that the membership should be in. Only `"active"` will be accepted. * @enum {string} */ state: "active"; }; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["org-membership"]; }; }; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; 422: components["responses"]["validation_failed"]; }; }; /** * List user migrations * @description Lists all migrations a user has started. */ "migrations/list-for-authenticated-user": { parameters: { query?: { per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; }; responses: { /** @description Response */ 200: { headers: { Link: components["headers"]["link"]; }; content: { "application/json": components["schemas"]["migration"][]; }; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; }; }; /** * Start a user migration * @description Initiates the generation of a user migration archive. */ "migrations/start-for-authenticated-user": { requestBody: { content: { "application/json": { /** * @description Lock the repositories being migrated at the start of the migration * @example true */ lock_repositories?: boolean; /** * @description Indicates whether metadata should be excluded and only git source should be included for the migration. * @example true */ exclude_metadata?: boolean; /** * @description Indicates whether the repository git data should be excluded from the migration. * @example true */ exclude_git_data?: boolean; /** * @description Do not include attachments in the migration * @example true */ exclude_attachments?: boolean; /** * @description Do not include releases in the migration * @example true */ exclude_releases?: boolean; /** * @description Indicates whether projects owned by the organization or users should be excluded. * @example true */ exclude_owner_projects?: boolean; /** * @description Indicates whether this should only include organization metadata (repositories array should be empty and will ignore other flags). * @default false * @example true */ org_metadata_only?: boolean; /** * @description Exclude attributes from the API response to improve performance * @example [ * "repositories" * ] */ exclude?: "repositories"[]; repositories: string[]; }; }; }; responses: { /** @description Response */ 201: { content: { "application/json": components["schemas"]["migration"]; }; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 422: components["responses"]["validation_failed"]; }; }; /** * Get a user migration status * @description Fetches a single user migration. The response includes the `state` of the migration, which can be one of the following values: * * * `pending` - the migration hasn't started yet. * * `exporting` - the migration is in progress. * * `exported` - the migration finished successfully. * * `failed` - the migration failed. * * Once the migration has been `exported` you can [download the migration archive](https://docs.github.com/rest/migrations/users#download-a-user-migration-archive). */ "migrations/get-status-for-authenticated-user": { parameters: { query?: { exclude?: string[]; }; path: { migration_id: components["parameters"]["migration-id"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["migration"]; }; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; }; }; /** * Download a user migration archive * @description Fetches the URL to download the migration archive as a `tar.gz` file. Depending on the resources your repository uses, the migration archive can contain JSON files with data for these objects: * * * attachments * * bases * * commit\_comments * * issue\_comments * * issue\_events * * issues * * milestones * * organizations * * projects * * protected\_branches * * pull\_request\_reviews * * pull\_requests * * releases * * repositories * * review\_comments * * schema * * users * * The archive will also contain an `attachments` directory that includes all attachment files uploaded to GitHub.com and a `repositories` directory that contains the repository's Git data. */ "migrations/get-archive-for-authenticated-user": { parameters: { path: { migration_id: components["parameters"]["migration-id"]; }; }; responses: { /** @description Response */ 302: { content: never; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; }; }; /** * Delete a user migration archive * @description Deletes a previous migration archive. Downloadable migration archives are automatically deleted after seven days. Migration metadata, which is returned in the [List user migrations](https://docs.github.com/rest/migrations/users#list-user-migrations) and [Get a user migration status](https://docs.github.com/rest/migrations/users#get-a-user-migration-status) endpoints, will continue to be available even after an archive is deleted. */ "migrations/delete-archive-for-authenticated-user": { parameters: { path: { migration_id: components["parameters"]["migration-id"]; }; }; responses: { /** @description Response */ 204: { content: never; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; }; }; /** * Unlock a user repository * @description Unlocks a repository. You can lock repositories when you [start a user migration](https://docs.github.com/rest/migrations/users#start-a-user-migration). Once the migration is complete you can unlock each repository to begin using it again or [delete the repository](https://docs.github.com/rest/repos/repos#delete-a-repository) if you no longer need the source data. Returns a status of `404 Not Found` if the repository is not locked. */ "migrations/unlock-repo-for-authenticated-user": { parameters: { path: { migration_id: components["parameters"]["migration-id"]; repo_name: components["parameters"]["repo-name"]; }; }; responses: { /** @description Response */ 204: { content: never; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; }; }; /** * List repositories for a user migration * @description Lists all the repositories for this user migration. */ "migrations/list-repos-for-authenticated-user": { parameters: { query?: { per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; path: { migration_id: components["parameters"]["migration-id"]; }; }; responses: { /** @description Response */ 200: { headers: { Link: components["headers"]["link"]; }; content: { "application/json": components["schemas"]["minimal-repository"][]; }; }; 404: components["responses"]["not_found"]; }; }; /** * List organizations for the authenticated user * @description List organizations for the authenticated user. * * **OAuth scope requirements** * * This only lists organizations that your authorization allows you to operate on in some way (e.g., you can list teams with `read:org` scope, you can publicize your organization membership with `user` scope, etc.). Therefore, this API requires at least `user` or `read:org` scope. OAuth requests with insufficient scope receive a `403 Forbidden` response. */ "orgs/list-for-authenticated-user": { parameters: { query?: { per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; }; responses: { /** @description Response */ 200: { headers: { Link: components["headers"]["link"]; }; content: { "application/json": components["schemas"]["organization-simple"][]; }; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; }; }; /** * List packages for the authenticated user's namespace * @description Lists packages owned by the authenticated user within the user's namespace. * * To use this endpoint, you must authenticate using an access token with the `read:packages` scope. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, your token must also include the `repo` scope. For the list of GitHub Packages registries that only support repository-scoped permissions, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." */ "packages/list-packages-for-authenticated-user": { parameters: { query: { /** @description The type of supported package. Packages in GitHub's Gradle registry have the type `maven`. Docker images pushed to GitHub's Container registry (`ghcr.io`) have the type `container`. You can use the type `docker` to find images that were pushed to GitHub's Docker registry (`docker.pkg.github.com`), even if these have now been migrated to the Container registry. */ package_type: | "npm" | "maven" | "rubygems" | "docker" | "nuget" | "container"; visibility?: components["parameters"]["package-visibility"]; page?: components["parameters"]["page"]; per_page?: components["parameters"]["per-page"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["package"][]; }; }; 400: components["responses"]["package_es_list_error"]; }; }; /** * Get a package for the authenticated user * @description Gets a specific package for a package owned by the authenticated user. * * To use this endpoint, you must authenticate using an access token with the `read:packages` scope. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, your token must also include the `repo` scope. For the list of GitHub Packages registries that only support repository-scoped permissions, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." */ "packages/get-package-for-authenticated-user": { parameters: { path: { package_type: components["parameters"]["package-type"]; package_name: components["parameters"]["package-name"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["package"]; }; }; }; }; /** * Delete a package for the authenticated user * @description Deletes a package owned by the authenticated user. You cannot delete a public package if any version of the package has more than 5,000 downloads. In this scenario, contact GitHub support for further assistance. * * To use this endpoint, you must authenticate using an access token with the `read:packages` and `delete:packages` scopes. * If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, your token must also include the `repo` scope. For the list of GitHub Packages registries that only support repository-scoped permissions, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." */ "packages/delete-package-for-authenticated-user": { parameters: { path: { package_type: components["parameters"]["package-type"]; package_name: components["parameters"]["package-name"]; }; }; responses: { /** @description Response */ 204: { content: never; }; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; }; }; /** * Restore a package for the authenticated user * @description Restores a package owned by the authenticated user. * * You can restore a deleted package under the following conditions: * - The package was deleted within the last 30 days. * - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first. * * To use this endpoint, you must authenticate using an access token with the `read:packages` and `write:packages` scopes. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, your token must also include the `repo` scope. For the list of GitHub Packages registries that only support repository-scoped permissions, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." */ "packages/restore-package-for-authenticated-user": { parameters: { query?: { /** @description package token */ token?: string; }; path: { package_type: components["parameters"]["package-type"]; package_name: components["parameters"]["package-name"]; }; }; responses: { /** @description Response */ 204: { content: never; }; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; }; }; /** * List package versions for a package owned by the authenticated user * @description Lists package versions for a package owned by the authenticated user. * * To use this endpoint, you must authenticate using an access token with the `read:packages` scope. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, your token must also include the `repo` scope. For the list of GitHub Packages registries that only support repository-scoped permissions, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." */ "packages/get-all-package-versions-for-package-owned-by-authenticated-user": { parameters: { query?: { page?: components["parameters"]["page"]; per_page?: components["parameters"]["per-page"]; /** @description The state of the package, either active or deleted. */ state?: "active" | "deleted"; }; path: { package_type: components["parameters"]["package-type"]; package_name: components["parameters"]["package-name"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["package-version"][]; }; }; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; }; }; /** * Get a package version for the authenticated user * @description Gets a specific package version for a package owned by the authenticated user. * * To use this endpoint, you must authenticate using an access token with the `read:packages` scope. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, your token must also include the `repo` scope. For the list of GitHub Packages registries that only support repository-scoped permissions, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." */ "packages/get-package-version-for-authenticated-user": { parameters: { path: { package_type: components["parameters"]["package-type"]; package_name: components["parameters"]["package-name"]; package_version_id: components["parameters"]["package-version-id"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["package-version"]; }; }; }; }; /** * Delete a package version for the authenticated user * @description Deletes a specific package version for a package owned by the authenticated user. If the package is public and the package version has more than 5,000 downloads, you cannot delete the package version. In this scenario, contact GitHub support for further assistance. * * To use this endpoint, you must have admin permissions in the organization and authenticate using an access token with the `read:packages` and `delete:packages` scopes. * If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, your token must also include the `repo` scope. For the list of GitHub Packages registries that only support repository-scoped permissions, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." */ "packages/delete-package-version-for-authenticated-user": { parameters: { path: { package_type: components["parameters"]["package-type"]; package_name: components["parameters"]["package-name"]; package_version_id: components["parameters"]["package-version-id"]; }; }; responses: { /** @description Response */ 204: { content: never; }; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; }; }; /** * Restore a package version for the authenticated user * @description Restores a package version owned by the authenticated user. * * You can restore a deleted package version under the following conditions: * - The package was deleted within the last 30 days. * - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first. * * To use this endpoint, you must authenticate using an access token with the `read:packages` and `write:packages` scopes. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, your token must also include the `repo` scope. For the list of GitHub Packages registries that only support repository-scoped permissions, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." */ "packages/restore-package-version-for-authenticated-user": { parameters: { path: { package_type: components["parameters"]["package-type"]; package_name: components["parameters"]["package-name"]; package_version_id: components["parameters"]["package-version-id"]; }; }; responses: { /** @description Response */ 204: { content: never; }; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; }; }; /** * Create a user project * @description Creates a user project board. Returns a `410 Gone` status if the user does not have existing classic projects. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. */ "projects/create-for-authenticated-user": { requestBody: { content: { "application/json": { /** * @description Name of the project * @example Week One Sprint */ name: string; /** * @description Body of the project * @example This project represents the sprint of the first week in January */ body?: string | null; }; }; }; responses: { /** @description Response */ 201: { content: { "application/json": components["schemas"]["project"]; }; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 422: components["responses"]["validation_failed_simple"]; }; }; /** * List public email addresses for the authenticated user * @description Lists your publicly visible email address, which you can set with the [Set primary email visibility for the authenticated user](https://docs.github.com/rest/users/emails#set-primary-email-visibility-for-the-authenticated-user) endpoint. This endpoint is accessible with the `user:email` scope. */ "users/list-public-emails-for-authenticated-user": { parameters: { query?: { per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; }; responses: { /** @description Response */ 200: { headers: { Link: components["headers"]["link"]; }; content: { "application/json": components["schemas"]["email"][]; }; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; }; }; /** * List repositories for the authenticated user * @description Lists repositories that the authenticated user has explicit permission (`:read`, `:write`, or `:admin`) to access. * * The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership. */ "repos/list-for-authenticated-user": { parameters: { query?: { /** @description Limit results to repositories with the specified visibility. */ visibility?: "all" | "public" | "private"; /** * @description Comma-separated list of values. Can include: * * `owner`: Repositories that are owned by the authenticated user. * * `collaborator`: Repositories that the user has been added to as a collaborator. * * `organization_member`: Repositories that the user has access to through being a member of an organization. This includes every repository on every team that the user is on. */ affiliation?: string; /** @description Limit results to repositories of the specified type. Will cause a `422` error if used in the same request as **visibility** or **affiliation**. */ type?: "all" | "owner" | "public" | "private" | "member"; /** @description The property to sort the results by. */ sort?: "created" | "updated" | "pushed" | "full_name"; /** @description The order to sort by. Default: `asc` when using `full_name`, otherwise `desc`. */ direction?: "asc" | "desc"; per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; since?: components["parameters"]["since-repo-date"]; before?: components["parameters"]["before-repo-date"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["repository"][]; }; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 422: components["responses"]["validation_failed"]; }; }; /** * Create a repository for the authenticated user * @description Creates a new repository for the authenticated user. * * **OAuth scope requirements** * * When using [OAuth](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include: * * * `public_repo` scope or `repo` scope to create a public repository. Note: For GitHub AE, use `repo` scope to create an internal repository. * * `repo` scope to create a private repository. */ "repos/create-for-authenticated-user": { requestBody: { content: { "application/json": { /** * @description The name of the repository. * @example Team Environment */ name: string; /** @description A short description of the repository. */ description?: string; /** @description A URL with more information about the repository. */ homepage?: string; /** * @description Whether the repository is private. * @default false */ private?: boolean; /** * @description Whether issues are enabled. * @default true * @example true */ has_issues?: boolean; /** * @description Whether projects are enabled. * @default true * @example true */ has_projects?: boolean; /** * @description Whether the wiki is enabled. * @default true * @example true */ has_wiki?: boolean; /** * @description Whether discussions are enabled. * @default false * @example true */ has_discussions?: boolean; /** @description The id of the team that will be granted access to this repository. This is only valid when creating a repository in an organization. */ team_id?: number; /** * @description Whether the repository is initialized with a minimal README. * @default false */ auto_init?: boolean; /** * @description The desired language or platform to apply to the .gitignore. * @example Haskell */ gitignore_template?: string; /** * @description The license keyword of the open source license for this repository. * @example mit */ license_template?: string; /** * @description Whether to allow squash merges for pull requests. * @default true * @example true */ allow_squash_merge?: boolean; /** * @description Whether to allow merge commits for pull requests. * @default true * @example true */ allow_merge_commit?: boolean; /** * @description Whether to allow rebase merges for pull requests. * @default true * @example true */ allow_rebase_merge?: boolean; /** * @description Whether to allow Auto-merge to be used on pull requests. * @default false * @example false */ allow_auto_merge?: boolean; /** * @description Whether to delete head branches when pull requests are merged * @default false * @example false */ delete_branch_on_merge?: boolean; /** * @description The default value for a squash merge commit title: * * - `PR_TITLE` - default to the pull request's title. * - `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). * @enum {string} */ squash_merge_commit_title?: "PR_TITLE" | "COMMIT_OR_PR_TITLE"; /** * @description The default value for a squash merge commit message: * * - `PR_BODY` - default to the pull request's body. * - `COMMIT_MESSAGES` - default to the branch's commit messages. * - `BLANK` - default to a blank commit message. * @enum {string} */ squash_merge_commit_message?: "PR_BODY" | "COMMIT_MESSAGES" | "BLANK"; /** * @description The default value for a merge commit title. * * - `PR_TITLE` - default to the pull request's title. * - `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). * @enum {string} */ merge_commit_title?: "PR_TITLE" | "MERGE_MESSAGE"; /** * @description The default value for a merge commit message. * * - `PR_TITLE` - default to the pull request's title. * - `PR_BODY` - default to the pull request's body. * - `BLANK` - default to a blank commit message. * @enum {string} */ merge_commit_message?: "PR_BODY" | "PR_TITLE" | "BLANK"; /** * @description Whether downloads are enabled. * @default true * @example true */ has_downloads?: boolean; /** * @description Whether this repository acts as a template that can be used to generate new repositories. * @default false * @example true */ is_template?: boolean; }; }; }; responses: { /** @description Response */ 201: { headers: { /** @example https://api.github.com/repos/octocat/Hello-World */ Location?: string; }; content: { "application/json": components["schemas"]["repository"]; }; }; 304: components["responses"]["not_modified"]; 400: components["responses"]["bad_request"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; 422: components["responses"]["validation_failed"]; }; }; /** * List repository invitations for the authenticated user * @description When authenticating as a user, this endpoint will list all currently open repository invitations for that user. */ "repos/list-invitations-for-authenticated-user": { parameters: { query?: { per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; }; responses: { /** @description Response */ 200: { headers: { Link: components["headers"]["link"]; }; content: { "application/json": components["schemas"]["repository-invitation"][]; }; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; }; }; /** Decline a repository invitation */ "repos/decline-invitation-for-authenticated-user": { parameters: { path: { invitation_id: components["parameters"]["invitation-id"]; }; }; responses: { /** @description Response */ 204: { content: never; }; 304: components["responses"]["not_modified"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; 409: components["responses"]["conflict"]; }; }; /** Accept a repository invitation */ "repos/accept-invitation-for-authenticated-user": { parameters: { path: { invitation_id: components["parameters"]["invitation-id"]; }; }; responses: { /** @description Response */ 204: { content: never; }; 304: components["responses"]["not_modified"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; 409: components["responses"]["conflict"]; }; }; /** * List social accounts for the authenticated user * @description Lists all of your social accounts. */ "users/list-social-accounts-for-authenticated-user": { parameters: { query?: { per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; }; responses: { /** @description Response */ 200: { headers: { Link: components["headers"]["link"]; }; content: { "application/json": components["schemas"]["social-account"][]; }; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; }; }; /** * Add social accounts for the authenticated user * @description Add one or more social accounts to the authenticated user's profile. This endpoint is accessible with the `user` scope. */ "users/add-social-account-for-authenticated-user": { requestBody: { content: { "application/json": { /** * @description Full URLs for the social media profiles to add. * @example [] */ account_urls: string[]; }; }; }; responses: { /** @description Response */ 201: { content: { "application/json": components["schemas"]["social-account"][]; }; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; 422: components["responses"]["validation_failed"]; }; }; /** * Delete social accounts for the authenticated user * @description Deletes one or more social accounts from the authenticated user's profile. This endpoint is accessible with the `user` scope. */ "users/delete-social-account-for-authenticated-user": { requestBody: { content: { "application/json": { /** * @description Full URLs for the social media profiles to delete. * @example [] */ account_urls: string[]; }; }; }; responses: { /** @description Response */ 204: { content: never; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; 422: components["responses"]["validation_failed"]; }; }; /** * List SSH signing keys for the authenticated user * @description Lists the SSH signing keys for the authenticated user's GitHub account. You must authenticate with Basic Authentication, or you must authenticate with OAuth with at least `read:ssh_signing_key` scope. For more information, see "[Understanding scopes for OAuth apps](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/)." */ "users/list-ssh-signing-keys-for-authenticated-user": { parameters: { query?: { per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; }; responses: { /** @description Response */ 200: { headers: { Link: components["headers"]["link"]; }; content: { "application/json": components["schemas"]["ssh-signing-key"][]; }; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; }; }; /** * Create a SSH signing key for the authenticated user * @description Creates an SSH signing key for the authenticated user's GitHub account. You must authenticate with Basic Authentication, or you must authenticate with OAuth with at least `write:ssh_signing_key` scope. For more information, see "[Understanding scopes for OAuth apps](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/)." */ "users/create-ssh-signing-key-for-authenticated-user": { requestBody: { content: { "application/json": { /** * @description A descriptive name for the new key. * @example Personal MacBook Air */ title?: string; /** @description The public SSH key to add to your GitHub account. For more information, see "[Checking for existing SSH keys](https://docs.github.com/authentication/connecting-to-github-with-ssh/checking-for-existing-ssh-keys)." */ key: string; }; }; }; responses: { /** @description Response */ 201: { content: { "application/json": components["schemas"]["ssh-signing-key"]; }; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; 422: components["responses"]["validation_failed"]; }; }; /** * Get an SSH signing key for the authenticated user * @description Gets extended details for an SSH signing key. You must authenticate with Basic Authentication, or you must authenticate with OAuth with at least `read:ssh_signing_key` scope. For more information, see "[Understanding scopes for OAuth apps](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/)." */ "users/get-ssh-signing-key-for-authenticated-user": { parameters: { path: { ssh_signing_key_id: components["parameters"]["ssh-signing-key-id"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["ssh-signing-key"]; }; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; }; }; /** * Delete an SSH signing key for the authenticated user * @description Deletes an SSH signing key from the authenticated user's GitHub account. You must authenticate with Basic Authentication, or you must authenticate with OAuth with at least `admin:ssh_signing_key` scope. For more information, see "[Understanding scopes for OAuth apps](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/)." */ "users/delete-ssh-signing-key-for-authenticated-user": { parameters: { path: { ssh_signing_key_id: components["parameters"]["ssh-signing-key-id"]; }; }; responses: { /** @description Response */ 204: { content: never; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; }; }; /** * List repositories starred by the authenticated user * @description Lists repositories the authenticated user has starred. * * You can also find out _when_ stars were created by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the `Accept` header: `application/vnd.github.star+json`. */ "activity/list-repos-starred-by-authenticated-user": { parameters: { query?: { sort?: components["parameters"]["sort-starred"]; direction?: components["parameters"]["direction"]; per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; }; responses: { /** @description Response */ 200: { headers: { Link: components["headers"]["link"]; }; content: { "application/json": components["schemas"]["repository"][]; "application/vnd.github.v3.star+json": components["schemas"]["starred-repository"][]; }; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; }; }; /** * Check if a repository is starred by the authenticated user * @description Whether the authenticated user has starred the repository. */ "activity/check-repo-is-starred-by-authenticated-user": { parameters: { path: { owner: components["parameters"]["owner"]; repo: components["parameters"]["repo"]; }; }; responses: { /** @description Response if this repository is starred by you */ 204: { content: never; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; /** @description Not Found if this repository is not starred by you */ 404: { content: { "application/json": components["schemas"]["basic-error"]; }; }; }; }; /** * Star a repository for the authenticated user * @description Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." */ "activity/star-repo-for-authenticated-user": { parameters: { path: { owner: components["parameters"]["owner"]; repo: components["parameters"]["repo"]; }; }; responses: { /** @description Response */ 204: { content: never; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; }; }; /** * Unstar a repository for the authenticated user * @description Unstar a repository that the authenticated user has previously starred. */ "activity/unstar-repo-for-authenticated-user": { parameters: { path: { owner: components["parameters"]["owner"]; repo: components["parameters"]["repo"]; }; }; responses: { /** @description Response */ 204: { content: never; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; }; }; /** * List repositories watched by the authenticated user * @description Lists repositories the authenticated user is watching. */ "activity/list-watched-repos-for-authenticated-user": { parameters: { query?: { per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; }; responses: { /** @description Response */ 200: { headers: { Link: components["headers"]["link"]; }; content: { "application/json": components["schemas"]["minimal-repository"][]; }; }; 304: components["responses"]["not_modified"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; }; }; /** * List teams for the authenticated user * @description List all of the teams across all of the organizations to which the authenticated user belongs. This method requires `user`, `repo`, or `read:org` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/) when authenticating via [OAuth](https://docs.github.com/apps/building-oauth-apps/). When using a fine-grained personal access token, the resource owner of the token [must be a single organization](https://docs.github.com/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token#fine-grained-personal-access-tokens), and have at least read-only member organization permissions. The response payload only contains the teams from a single organization when using a fine-grained personal access token. */ "teams/list-for-authenticated-user": { parameters: { query?: { per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; }; responses: { /** @description Response */ 200: { headers: { Link: components["headers"]["link"]; }; content: { "application/json": components["schemas"]["team-full"][]; }; }; 304: components["responses"]["not_modified"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; }; }; /** * List users * @description Lists all users, in the order that they signed up on GitHub. This list includes personal user accounts and organization accounts. * * Note: Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers) to get the URL for the next page of users. */ "users/list": { parameters: { query?: { since?: components["parameters"]["since-user"]; per_page?: components["parameters"]["per-page"]; }; }; responses: { /** @description Response */ 200: { headers: { /** @example ; rel="next" */ Link?: string; }; content: { "application/json": components["schemas"]["simple-user"][]; }; }; 304: components["responses"]["not_modified"]; }; }; /** * Get a user * @description Provides publicly available information about someone with a GitHub account. * * GitHub Apps with the `Plan` user permission can use this endpoint to retrieve information about a user's GitHub plan. The GitHub App must be authenticated as a user. See "[Identifying and authorizing users for GitHub Apps](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/)" for details about authentication. For an example response, see 'Response with GitHub plan information' below" * * The `email` key in the following response is the publicly visible email address from your GitHub [profile page](https://github.com/settings/profile). When setting up your profile, you can select a primary email address to be “public” which provides an email entry for this endpoint. If you do not set a public email address for `email`, then it will have a value of `null`. You only see publicly visible email addresses when authenticated with GitHub. For more information, see [Authentication](https://docs.github.com/rest/overview/resources-in-the-rest-api#authentication). * * The Emails API enables you to list all of your email addresses, and toggle a primary email to be visible publicly. For more information, see "[Emails API](https://docs.github.com/rest/users/emails)". */ "users/get-by-username": { parameters: { path: { username: components["parameters"]["username"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": | components["schemas"]["private-user"] | components["schemas"]["public-user"]; }; }; 404: components["responses"]["not_found"]; }; }; /** * Get list of conflicting packages during Docker migration for user * @description Lists all packages that are in a specific user's namespace, that the requesting user has access to, and that encountered a conflict during Docker migration. * To use this endpoint, you must authenticate using an access token with the `read:packages` scope. */ "packages/list-docker-migration-conflicting-packages-for-user": { parameters: { path: { username: components["parameters"]["username"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["package"][]; }; }; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; }; }; /** * List events for the authenticated user * @description If you are authenticated as the given user, you will see your private events. Otherwise, you'll only see public events. */ "activity/list-events-for-authenticated-user": { parameters: { query?: { per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; path: { username: components["parameters"]["username"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["event"][]; }; }; }; }; /** * List organization events for the authenticated user * @description This is the user's organization dashboard. You must be authenticated as the user to view this. */ "activity/list-org-events-for-authenticated-user": { parameters: { query?: { per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; path: { username: components["parameters"]["username"]; org: components["parameters"]["org"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["event"][]; }; }; }; }; /** List public events for a user */ "activity/list-public-events-for-user": { parameters: { query?: { per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; path: { username: components["parameters"]["username"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["event"][]; }; }; }; }; /** * List followers of a user * @description Lists the people following the specified user. */ "users/list-followers-for-user": { parameters: { query?: { per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; path: { username: components["parameters"]["username"]; }; }; responses: { /** @description Response */ 200: { headers: { Link: components["headers"]["link"]; }; content: { "application/json": components["schemas"]["simple-user"][]; }; }; }; }; /** * List the people a user follows * @description Lists the people who the specified user follows. */ "users/list-following-for-user": { parameters: { query?: { per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; path: { username: components["parameters"]["username"]; }; }; responses: { /** @description Response */ 200: { headers: { Link: components["headers"]["link"]; }; content: { "application/json": components["schemas"]["simple-user"][]; }; }; }; }; /** Check if a user follows another user */ "users/check-following-for-user": { parameters: { path: { username: components["parameters"]["username"]; target_user: string; }; }; responses: { /** @description if the user follows the target user */ 204: { content: never; }; /** @description if the user does not follow the target user */ 404: { content: never; }; }; }; /** * List gists for a user * @description Lists public gists for the specified user: */ "gists/list-for-user": { parameters: { query?: { since?: components["parameters"]["since"]; per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; path: { username: components["parameters"]["username"]; }; }; responses: { /** @description Response */ 200: { headers: { Link: components["headers"]["link"]; }; content: { "application/json": components["schemas"]["base-gist"][]; }; }; 422: components["responses"]["validation_failed"]; }; }; /** * List GPG keys for a user * @description Lists the GPG keys for a user. This information is accessible by anyone. */ "users/list-gpg-keys-for-user": { parameters: { query?: { per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; path: { username: components["parameters"]["username"]; }; }; responses: { /** @description Response */ 200: { headers: { Link: components["headers"]["link"]; }; content: { "application/json": components["schemas"]["gpg-key"][]; }; }; }; }; /** * Get contextual information for a user * @description Provides hovercard information when authenticated through basic auth or OAuth with the `repo` scope. You can find out more about someone in relation to their pull requests, issues, repositories, and organizations. * * The `subject_type` and `subject_id` parameters provide context for the person's hovercard, which returns more information than without the parameters. For example, if you wanted to find out more about `octocat` who owns the `Spoon-Knife` repository via cURL, it would look like this: * * ```shell * curl -u username:token * https://api.github.com/users/octocat/hovercard?subject_type=repository&subject_id=1300192 * ``` */ "users/get-context-for-user": { parameters: { query?: { /** @description Identifies which additional information you'd like to receive about the person's hovercard. Can be `organization`, `repository`, `issue`, `pull_request`. **Required** when using `subject_id`. */ subject_type?: "organization" | "repository" | "issue" | "pull_request"; /** @description Uses the ID for the `subject_type` you specified. **Required** when using `subject_type`. */ subject_id?: string; }; path: { username: components["parameters"]["username"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["hovercard"]; }; }; 404: components["responses"]["not_found"]; 422: components["responses"]["validation_failed"]; }; }; /** * Get a user installation for the authenticated app * @description Enables an authenticated GitHub App to find the user’s installation information. * * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. */ "apps/get-user-installation": { parameters: { path: { username: components["parameters"]["username"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["installation"]; }; }; }; }; /** * List public keys for a user * @description Lists the _verified_ public SSH keys for a user. This is accessible by anyone. */ "users/list-public-keys-for-user": { parameters: { query?: { per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; path: { username: components["parameters"]["username"]; }; }; responses: { /** @description Response */ 200: { headers: { Link: components["headers"]["link"]; }; content: { "application/json": components["schemas"]["key-simple"][]; }; }; }; }; /** * List organizations for a user * @description List [public organization memberships](https://docs.github.com/articles/publicizing-or-concealing-organization-membership) for the specified user. * * This method only lists _public_ memberships, regardless of authentication. If you need to fetch all of the organization memberships (public and private) for the authenticated user, use the [List organizations for the authenticated user](https://docs.github.com/rest/orgs/orgs#list-organizations-for-the-authenticated-user) API instead. */ "orgs/list-for-user": { parameters: { query?: { per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; path: { username: components["parameters"]["username"]; }; }; responses: { /** @description Response */ 200: { headers: { Link: components["headers"]["link"]; }; content: { "application/json": components["schemas"]["organization-simple"][]; }; }; }; }; /** * List packages for a user * @description Lists all packages in a user's namespace for which the requesting user has access. * * To use this endpoint, you must authenticate using an access token with the `read:packages` scope. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, your token must also include the `repo` scope. For the list of GitHub Packages registries that only support repository-scoped permissions, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." */ "packages/list-packages-for-user": { parameters: { query: { /** @description The type of supported package. Packages in GitHub's Gradle registry have the type `maven`. Docker images pushed to GitHub's Container registry (`ghcr.io`) have the type `container`. You can use the type `docker` to find images that were pushed to GitHub's Docker registry (`docker.pkg.github.com`), even if these have now been migrated to the Container registry. */ package_type: | "npm" | "maven" | "rubygems" | "docker" | "nuget" | "container"; visibility?: components["parameters"]["package-visibility"]; page?: components["parameters"]["page"]; per_page?: components["parameters"]["per-page"]; }; path: { username: components["parameters"]["username"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["package"][]; }; }; 400: components["responses"]["package_es_list_error"]; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; }; }; /** * Get a package for a user * @description Gets a specific package metadata for a public package owned by a user. * * To use this endpoint, you must authenticate using an access token with the `read:packages` scope. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, your token must also include the `repo` scope. For the list of GitHub Packages registries that only support repository-scoped permissions, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." */ "packages/get-package-for-user": { parameters: { path: { package_type: components["parameters"]["package-type"]; package_name: components["parameters"]["package-name"]; username: components["parameters"]["username"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["package"]; }; }; }; }; /** * Delete a package for a user * @description Deletes an entire package for a user. You cannot delete a public package if any version of the package has more than 5,000 downloads. In this scenario, contact GitHub support for further assistance. * * To use this endpoint, you must authenticate using an access token with the `read:packages` and `delete:packages` scopes. In addition: * - If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, your token must also include the `repo` scope. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." * - If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, you must have admin permissions to the package you want to delete. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." */ "packages/delete-package-for-user": { parameters: { path: { package_type: components["parameters"]["package-type"]; package_name: components["parameters"]["package-name"]; username: components["parameters"]["username"]; }; }; responses: { /** @description Response */ 204: { content: never; }; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; }; }; /** * Restore a package for a user * @description Restores an entire package for a user. * * You can restore a deleted package under the following conditions: * - The package was deleted within the last 30 days. * - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first. * * To use this endpoint, you must authenticate using an access token with the `read:packages` and `write:packages` scopes. In addition: * - If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, your token must also include the `repo` scope. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." * - If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, you must have admin permissions to the package you want to restore. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." */ "packages/restore-package-for-user": { parameters: { query?: { /** @description package token */ token?: string; }; path: { package_type: components["parameters"]["package-type"]; package_name: components["parameters"]["package-name"]; username: components["parameters"]["username"]; }; }; responses: { /** @description Response */ 204: { content: never; }; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; }; }; /** * List package versions for a package owned by a user * @description Lists package versions for a public package owned by a specified user. * * To use this endpoint, you must authenticate using an access token with the `read:packages` scope. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, your token must also include the `repo` scope. For the list of GitHub Packages registries that only support repository-scoped permissions, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." */ "packages/get-all-package-versions-for-package-owned-by-user": { parameters: { path: { package_type: components["parameters"]["package-type"]; package_name: components["parameters"]["package-name"]; username: components["parameters"]["username"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["package-version"][]; }; }; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; }; }; /** * Get a package version for a user * @description Gets a specific package version for a public package owned by a specified user. * * At this time, to use this endpoint, you must authenticate using an access token with the `read:packages` scope. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, your token must also include the `repo` scope. For the list of GitHub Packages registries that only support repository-scoped permissions, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." */ "packages/get-package-version-for-user": { parameters: { path: { package_type: components["parameters"]["package-type"]; package_name: components["parameters"]["package-name"]; package_version_id: components["parameters"]["package-version-id"]; username: components["parameters"]["username"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["package-version"]; }; }; }; }; /** * Delete package version for a user * @description Deletes a specific package version for a user. If the package is public and the package version has more than 5,000 downloads, you cannot delete the package version. In this scenario, contact GitHub support for further assistance. * * To use this endpoint, you must authenticate using an access token with the `read:packages` and `delete:packages` scopes. In addition: * - If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, your token must also include the `repo` scope. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." * - If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, you must have admin permissions to the package whose version you want to delete. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." */ "packages/delete-package-version-for-user": { parameters: { path: { package_type: components["parameters"]["package-type"]; package_name: components["parameters"]["package-name"]; username: components["parameters"]["username"]; package_version_id: components["parameters"]["package-version-id"]; }; }; responses: { /** @description Response */ 204: { content: never; }; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; }; }; /** * Restore package version for a user * @description Restores a specific package version for a user. * * You can restore a deleted package under the following conditions: * - The package was deleted within the last 30 days. * - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first. * * To use this endpoint, you must authenticate using an access token with the `read:packages` and `write:packages` scopes. In addition: * - If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, your token must also include the `repo` scope. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." * - If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, you must have admin permissions to the package whose version you want to restore. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." */ "packages/restore-package-version-for-user": { parameters: { path: { package_type: components["parameters"]["package-type"]; package_name: components["parameters"]["package-name"]; username: components["parameters"]["username"]; package_version_id: components["parameters"]["package-version-id"]; }; }; responses: { /** @description Response */ 204: { content: never; }; 401: components["responses"]["requires_authentication"]; 403: components["responses"]["forbidden"]; 404: components["responses"]["not_found"]; }; }; /** * List user projects * @description Lists projects for a user. */ "projects/list-for-user": { parameters: { query?: { /** @description Indicates the state of the projects to return. */ state?: "open" | "closed" | "all"; per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; path: { username: components["parameters"]["username"]; }; }; responses: { /** @description Response */ 200: { headers: { Link: components["headers"]["link"]; }; content: { "application/json": components["schemas"]["project"][]; }; }; 422: components["responses"]["validation_failed"]; }; }; /** * List events received by the authenticated user * @description These are events that you've received by watching repos and following users. If you are authenticated as the given user, you will see private events. Otherwise, you'll only see public events. */ "activity/list-received-events-for-user": { parameters: { query?: { per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; path: { username: components["parameters"]["username"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["event"][]; }; }; }; }; /** List public events received by a user */ "activity/list-received-public-events-for-user": { parameters: { query?: { per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; path: { username: components["parameters"]["username"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["event"][]; }; }; }; }; /** * List repositories for a user * @description Lists public repositories for the specified user. Note: For GitHub AE, this endpoint will list internal repositories for the specified user. */ "repos/list-for-user": { parameters: { query?: { /** @description Limit results to repositories of the specified type. */ type?: "all" | "owner" | "member"; /** @description The property to sort the results by. */ sort?: "created" | "updated" | "pushed" | "full_name"; /** @description The order to sort by. Default: `asc` when using `full_name`, otherwise `desc`. */ direction?: "asc" | "desc"; per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; path: { username: components["parameters"]["username"]; }; }; responses: { /** @description Response */ 200: { headers: { Link: components["headers"]["link"]; }; content: { "application/json": components["schemas"]["minimal-repository"][]; }; }; }; }; /** * Get GitHub Actions billing for a user * @description Gets the summary of the free and paid GitHub Actions minutes used. * * Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage returned includes any minute multipliers for macOS and Windows runners, and is rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". * * Access tokens must have the `user` scope. */ "billing/get-github-actions-billing-user": { parameters: { path: { username: components["parameters"]["username"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["actions-billing-usage"]; }; }; }; }; /** * Get GitHub Packages billing for a user * @description Gets the free and paid storage used for GitHub Packages in gigabytes. * * Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." * * Access tokens must have the `user` scope. */ "billing/get-github-packages-billing-user": { parameters: { path: { username: components["parameters"]["username"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["packages-billing-usage"]; }; }; }; }; /** * Get shared storage billing for a user * @description Gets the estimated paid and estimated total storage used for GitHub Actions and GitHub Packages. * * Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." * * Access tokens must have the `user` scope. */ "billing/get-shared-storage-billing-user": { parameters: { path: { username: components["parameters"]["username"]; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["combined-billing-usage"]; }; }; }; }; /** * List social accounts for a user * @description Lists social media accounts for a user. This endpoint is accessible by anyone. */ "users/list-social-accounts-for-user": { parameters: { query?: { per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; path: { username: components["parameters"]["username"]; }; }; responses: { /** @description Response */ 200: { headers: { Link: components["headers"]["link"]; }; content: { "application/json": components["schemas"]["social-account"][]; }; }; }; }; /** * List SSH signing keys for a user * @description Lists the SSH signing keys for a user. This operation is accessible by anyone. */ "users/list-ssh-signing-keys-for-user": { parameters: { query?: { per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; path: { username: components["parameters"]["username"]; }; }; responses: { /** @description Response */ 200: { headers: { Link: components["headers"]["link"]; }; content: { "application/json": components["schemas"]["ssh-signing-key"][]; }; }; }; }; /** * List repositories starred by a user * @description Lists repositories a user has starred. * * You can also find out _when_ stars were created by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the `Accept` header: `application/vnd.github.star+json`. */ "activity/list-repos-starred-by-user": { parameters: { query?: { sort?: components["parameters"]["sort-starred"]; direction?: components["parameters"]["direction"]; per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; path: { username: components["parameters"]["username"]; }; }; responses: { /** @description Response */ 200: { headers: { Link: components["headers"]["link"]; }; content: { "application/json": | components["schemas"]["starred-repository"][] | components["schemas"]["repository"][]; }; }; }; }; /** * List repositories watched by a user * @description Lists repositories a user is watching. */ "activity/list-repos-watched-by-user": { parameters: { query?: { per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; path: { username: components["parameters"]["username"]; }; }; responses: { /** @description Response */ 200: { headers: { Link: components["headers"]["link"]; }; content: { "application/json": components["schemas"]["minimal-repository"][]; }; }; }; }; /** * Get all API versions * @description Get all supported GitHub API versions. */ "meta/get-all-versions": { responses: { /** @description Response */ 200: { content: { "application/json": string[]; }; }; 404: components["responses"]["not_found"]; }; }; /** * Get the Zen of GitHub * @description Get a random sentence from the Zen of GitHub */ "meta/get-zen": { responses: { /** @description Response */ 200: { content: { "application/json": string; }; }; }; }; /** * Compare two commits * @description **Deprecated**: Use `repos.compareCommitsWithBasehead()` (`GET /repos/{owner}/{repo}/compare/{basehead}`) instead. Both `:base` and `:head` must be branch names in `:repo`. To compare branches across other repositories in the same network as `:repo`, use the format `:branch`. * * The response from the API is equivalent to running the `git log base..head` command; however, commits are returned in chronological order. Pass the appropriate [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to fetch diff and patch formats. * * The response also includes details on the files that were changed between the two commits. This includes the status of the change (for example, if a file was added, removed, modified, or renamed), and details of the change itself. For example, files with a `renamed` status have a `previous_filename` field showing the previous filename of the file, and files with a `modified` status have a `patch` field showing the changes made to the file. * * **Working with large comparisons** * * To process a response with a large number of commits, you can use (`per_page` or `page`) to paginate the results. When using paging, the list of changed files is only returned with page 1, but includes all changed files for the entire comparison. For more information on working with pagination, see "[Traversing with pagination](/rest/guides/traversing-with-pagination)." * * When calling this API without any paging parameters (`per_page` or `page`), the returned list is limited to 250 commits and the last commit in the list is the most recent of the entire comparison. When a paging parameter is specified, the first commit in the returned list of each page is the earliest. * * **Signature verification object** * * The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object: * * | Name | Type | Description | * | ---- | ---- | ----------- | * | `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. | * | `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. | * | `signature` | `string` | The signature that was extracted from the commit. | * | `payload` | `string` | The value that was signed. | * * These are the possible values for `reason` in the `verification` object: * * | Value | Description | * | ----- | ----------- | * | `expired_key` | The key that made the signature is expired. | * | `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | * | `gpgverify_error` | There was an error communicating with the signature verification service. | * | `gpgverify_unavailable` | The signature verification service is currently unavailable. | * | `unsigned` | The object does not include a signature. | * | `unknown_signature_type` | A non-PGP signature was found in the commit. | * | `no_user` | No user was associated with the `committer` email address in the commit. | * | `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on her/his account. | * | `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. | * | `unknown_key` | The key that made the signature has not been registered with any user's account. | * | `malformed_signature` | There was an error parsing the signature. | * | `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | * | `valid` | None of the above errors applied, so the signature is considered to be verified. | */ "repos/compare-commits": { parameters: { query?: { per_page?: components["parameters"]["per-page"]; page?: components["parameters"]["page"]; }; path: { owner: components["parameters"]["owner"]; repo: components["parameters"]["repo"]; base: string; head: string; }; }; responses: { /** @description Response */ 200: { content: { "application/json": components["schemas"]["commit-comparison"]; }; }; 404: components["responses"]["not_found"]; 500: components["responses"]["internal_error"]; }; }; }