{"meta":{"title":"存储库推送规则的 REST API 终结点会绕过请求","intro":"使用 REST API 管理存储库推送规则绕过请求。","product":"REST API","breadcrumbs":[{"href":"/zh/enterprise-cloud@latest/rest","title":"REST API"},{"href":"/zh/enterprise-cloud@latest/rest/repos","title":"存储库"},{"href":"/zh/enterprise-cloud@latest/rest/repos/bypass-requests","title":"绕过请求"}],"documentType":"article"},"body":"# 存储库推送规则的 REST API 终结点会绕过请求\n\n使用 REST API 管理存储库推送规则绕过请求。\n\n> [!NOTE]\n> Most endpoints use `Authorization: Bearer <YOUR-TOKEN>` and `Accept: application/vnd.github+json` headers, plus `X-GitHub-Api-Version: 2026-03-10`. Curl examples below omit these standard headers for brevity.\n\n## List repository push rule bypass requests\n\n```\nGET /repos/{owner}/{repo}/bypass-requests/push-rules\n```\n\nLists the requests made by users of a repository to bypass push protection rules\n\n### Parameters\n\n#### Headers\n\n- **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n- **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n- **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n- **`reviewer`** (string)\n  Filter bypass requests by the handle of the GitHub user who reviewed the bypass request.\n\n- **`requester`** (string)\n  Filter bypass requests by the handle of the GitHub user who requested the bypass.\n\n- **`time_period`** (string)\n  The time period to filter by.\nFor example, day will filter for rule suites that occurred in the past 24 hours, and week will filter for rule suites that occurred in the past 7 days (168 hours).\n  Default: `day`\n  Can be one of: `hour`, `day`, `week`, `month`\n\n- **`request_status`** (string)\n  The status of the bypass request to filter on. When specified, only requests with this status will be returned.\n  Default: `all`\n  Can be one of: `completed`, `cancelled`, `approved`, `expired`, `deleted`, `denied`, `open`, `all`\n\n- **`per_page`** (integer)\n  The number of results per page (max 100). For more information, see \"Using pagination in the REST API.\"\n  Default: `30`\n\n- **`page`** (integer)\n  The page number of the results to fetch. For more information, see \"Using pagination in the REST API.\"\n  Default: `1`\n\n### HTTP response status codes\n\n- **200** - OK\n\n- **404** - Resource not found\n\n- **500** - Internal Error\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/repos/OWNER/REPO/bypass-requests/push-rules\n```\n\n**Response schema (Status: 200):**\n\nArray of `Push rule bypass request`:\n  * `id`: integer\n  * `number`: integer\n  * `repository`: object:\n    * `id`: integer or null\n    * `name`: string or null\n    * `full_name`: string or null\n  * `organization`: object:\n    * `id`: integer or null\n    * `name`: string or null\n  * `requester`: object:\n    * `actor_id`: integer\n    * `actor_name`: string\n  * `request_type`: string\n  * `data`: array of objects or null:\n    * `ruleset_id`: integer\n    * `ruleset_name`: string\n    * `total_violations`: integer\n    * `rule_type`: string\n  * `resource_identifier`: string\n  * `status`: string, enum: `pending`, `denied`, `approved`, `cancelled`, `completed`, `expired`, `deleted`, `open`\n  * `requester_comment`: string or null\n  * `expires_at`: string, format: date-time\n  * `created_at`: string, format: date-time\n  * `responses`: array of `Bypass response` or null:\n    * `id`: integer\n    * `reviewer`: object:\n      * `actor_id`: integer\n      * `actor_name`: string\n    * `status`: string, enum: `approved`, `denied`, `dismissed`\n    * `created_at`: string, format: date-time\n  * `url`: string, format: uri\n  * `html_url`: string, format: uri\n\n## Get a repository push bypass request\n\n```\nGET /repos/{owner}/{repo}/bypass-requests/push-rules/{bypass_request_number}\n```\n\nGet information about a request to bypass push protection rules for a repository.\n\n### Parameters\n\n#### Headers\n\n- **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n- **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n- **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n- **`bypass_request_number`** (integer) (required)\n  The number that identifies the bypass request within the context of the given repository.\n\n### HTTP response status codes\n\n- **200** - OK\n\n- **404** - Resource not found\n\n- **500** - Internal Error\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/repos/OWNER/REPO/bypass-requests/push-rules/BYPASS_REQUEST_NUMBER\n```\n\n**Response schema (Status: 200):**\n\n* `id`: integer\n* `number`: integer\n* `repository`: object:\n  * `id`: integer or null\n  * `name`: string or null\n  * `full_name`: string or null\n* `organization`: object:\n  * `id`: integer or null\n  * `name`: string or null\n* `requester`: object:\n  * `actor_id`: integer\n  * `actor_name`: string\n* `request_type`: string\n* `data`: array of objects or null:\n  * `ruleset_id`: integer\n  * `ruleset_name`: string\n  * `total_violations`: integer\n  * `rule_type`: string\n* `resource_identifier`: string\n* `status`: string, enum: `pending`, `denied`, `approved`, `cancelled`, `completed`, `expired`, `deleted`, `open`\n* `requester_comment`: string or null\n* `expires_at`: string, format: date-time\n* `created_at`: string, format: date-time\n* `responses`: array of `Bypass response` or null:\n  * `id`: integer\n  * `reviewer`: object:\n    * `actor_id`: integer\n    * `actor_name`: string\n  * `status`: string, enum: `approved`, `denied`, `dismissed`\n  * `created_at`: string, format: date-time\n* `url`: string, format: uri\n* `html_url`: string, format: uri"}