{"meta":{"title":"Pontos de extremidade da API REST para solicitações de descarte de alerta do code scanning","intro":"Use a API REST para interagir com solicitações de descarte de alerta do code scanning de um repositório.","product":"API REST","breadcrumbs":[{"href":"/pt/enterprise-server@3.22/rest","title":"API REST"},{"href":"/pt/enterprise-server@3.22/rest/code-scanning","title":"Varredura de código"},{"href":"/pt/enterprise-server@3.22/rest/code-scanning/alert-dismissal-requests","title":"Solicitações de dispensa de alerta"}],"documentType":"article"},"body":"# Pontos de extremidade da API REST para solicitações de descarte de alerta do {% data variables.product.prodname_code_scanning %}\n\nUse a API REST para interagir com solicitações de descarte de alerta do code scanning de um repositório.\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 dismissal requests for code scanning alerts for an organization\n\n```\nGET /orgs/{org}/dismissal-requests/code-scanning\n```\n\nLists dismissal requests for code scanning alerts for all repositories in an organization.\nThe user must be authorized to review dismissal requests for the organization.\nPersonal access tokens (classic) need the security_events scope to use this endpoint.\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- **`org`** (string) (required)\n  The organization name. The name is not case sensitive.\n\n- **`reviewer`** (string)\n  Filter alert dismissal requests by the handle of the GitHub user who reviewed the dismissal request.\n\n- **`requester`** (string)\n  Filter alert dismissal requests by the handle of the GitHub user who requested the dismissal.\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 insights that occurred in the past 7 days (168 hours).\n  Default: `month`\n  Can be one of: `hour`, `day`, `week`, `month`\n\n- **`request_status`** (string)\n  Filter alert dismissal requests by status. When specified, only requests with this status will be returned.\n  Default: `all`\n  Can be one of: `open`, `approved`, `expired`, `denied`, `all`\n\n- **`repository_name`** (string)\n  The name of the repository to filter on.\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** - A list of alert dismissal requests.\n\n- **403** - Forbidden\n\n- **404** - Resource not found\n\n- **422** - Validation failed, or the endpoint has been spammed.\n\n- **500** - Internal Error\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  http(s)://HOSTNAME/api/v3/orgs/ORG/dismissal-requests/code-scanning\n```\n\n**Response schema (Status: 200):**\n\nArray of `Code scanning alert dismissal request`:\n  * `id`: integer, format: int64\n  * `number`: integer, format: int64\n  * `repository`: object:\n    * `id`: integer, format: int64\n    * `name`: string\n    * `full_name`: string\n  * `organization`: object:\n    * `id`: integer, format: int64\n    * `name`: string\n  * `requester`: object:\n    * `actor_id`: integer, format: int64\n    * `actor_name`: string\n  * `request_type`: string\n  * `data`: array of objects or null:\n    * `reason`: string\n    * `alert_number`: string\n    * `pr_review_thread_id`: string\n  * `resource_identifier`: string\n  * `status`: string, enum: `pending`, `denied`, `approved`, `expired`\n  * `requester_comment`: string or null\n  * `expires_at`: string, format: date-time\n  * `created_at`: string, format: date-time\n  * `responses`: array of `Dismissal request response` or null:\n    * `id`: integer, format: int64\n    * `reviewer`: object:\n      * `actor_id`: integer, format: int64\n      * `actor_name`: string\n    * `message`: string or null\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## List dismissal requests for code scanning alerts for a repository\n\n```\nGET /repos/{owner}/{repo}/dismissal-requests/code-scanning\n```\n\nLists dismissal requests for code scanning alerts for a repository.\nDelegated alert dismissal must be enabled on the repository.\nPersonal access tokens (classic) need the security_events scope to use this endpoint.\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 alert dismissal requests by the handle of the GitHub user who reviewed the dismissal request.\n\n- **`requester`** (string)\n  Filter alert dismissal requests by the handle of the GitHub user who requested the dismissal.\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 insights that occurred in the past 7 days (168 hours).\n  Default: `month`\n  Can be one of: `hour`, `day`, `week`, `month`\n\n- **`request_status`** (string)\n  Filter alert dismissal requests by status. When specified, only requests with this status will be returned.\n  Default: `all`\n  Can be one of: `open`, `approved`, `expired`, `denied`, `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** - A list of alert dismissal requests.\n\n- **403** - Forbidden\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  http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/dismissal-requests/code-scanning\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [List dismissal requests for code scanning alerts for an organization](#list-dismissal-requests-for-code-scanning-alerts-for-an-organization).\n\n## Get a dismissal request for a code scanning alert for a repository\n\n```\nGET /repos/{owner}/{repo}/dismissal-requests/code-scanning/{alert_number}\n```\n\nGets a dismissal request to dismiss a code scanning alert in a repository.\nDelegated alert dismissal must be enabled on the repository.\nPersonal access tokens (classic) need the security_events scope to use this endpoint.\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- **`alert_number`** (integer) (required)\n  The number that identifies the code scanning alert.\n\n### HTTP response status codes\n\n- **200** - A single dismissal request.\n\n- **403** - Forbidden\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  http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/dismissal-requests/code-scanning/ALERT_NUMBER\n```\n\n**Response schema (Status: 200):**\n\n* `id`: integer, format: int64\n* `number`: integer, format: int64\n* `repository`: object:\n  * `id`: integer, format: int64\n  * `name`: string\n  * `full_name`: string\n* `organization`: object:\n  * `id`: integer, format: int64\n  * `name`: string\n* `requester`: object:\n  * `actor_id`: integer, format: int64\n  * `actor_name`: string\n* `request_type`: string\n* `data`: array of objects or null:\n  * `reason`: string\n  * `alert_number`: string\n  * `pr_review_thread_id`: string\n* `resource_identifier`: string\n* `status`: string, enum: `pending`, `denied`, `approved`, `expired`\n* `requester_comment`: string or null\n* `expires_at`: string, format: date-time\n* `created_at`: string, format: date-time\n* `responses`: array of `Dismissal request response` or null:\n  * `id`: integer, format: int64\n  * `reviewer`: object:\n    * `actor_id`: integer, format: int64\n    * `actor_name`: string\n  * `message`: string or null\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## Review a dismissal request for a code scanning alert for a repository\n\n```\nPATCH /repos/{owner}/{repo}/dismissal-requests/code-scanning/{alert_number}\n```\n\nApprove or deny a dismissal request to dismiss a code scanning alert in a repository.\nDelegated alert dismissal must be enabled on the repository and the user must be a dismissal reviewer to access this endpoint.\nPersonal access tokens (classic) need the security_events scope to use this endpoint.\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- **`alert_number`** (integer) (required)\n  The number that identifies the code scanning alert.\n\n#### Body parameters\n\n- **`status`** (string) (required)\n  The review action to perform on the bypass request.\n  Can be one of: `approve`, `deny`\n\n- **`message`** (string) (required)\n  A message to include with the review. Has a maximum character length of 2048.\n\n### HTTP response status codes\n\n- **204** - Successful update\n\n- **403** - Forbidden\n\n- **404** - Resource not found\n\n- **422** - Validation failed, or the endpoint has been spammed.\n\n- **500** - Internal Error\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X PATCH \\\n  http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/dismissal-requests/code-scanning/ALERT_NUMBER \\\n  -d '{\n  \"status\": \"approve\",\n  \"message\": \"Used in tests.\"\n}'\n```\n\n**Response schema (Status: 204):**"}