Skip to content

Create a push protection bypass

POST
/repos/{owner}/{repo}/secret-scanning/push-protection-bypasses

Creates a bypass for a previously push protected secret.

The authenticated user must be the original author of the committed secret.

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

API method documentation

owner
required
string

The account owner of the repository. The name is not case sensitive.

repo
required
string

The name of the repository without the .git extension. The name is not case sensitive.

Media type application/json
object
reason
required

The reason for bypassing push protection.

string
Allowed values: false_positive used_in_tests will_fix_later
placeholder_id
required

The ID of the push protection bypass placeholder. This value is returned on any push protected routes.

string
Examples
Example default
{
"reason": "will_fix_later",
"placeholder_id": "2k4dM4tseyC5lPIsjl5emX9sPNk"
}

Response

Media type application/json
object
reason

The reason for bypassing push protection.

string
Allowed values: false_positive used_in_tests will_fix_later
expire_at

The time that the bypass will expire in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.

string format: date-time
nullable
token_type

The token type this bypass is for.

string
Examples
Example default
{
"reason": "will_fix_later",
"expire_at": "2020-11-06T18:18:30Z",
"token_type": "mailchimp_api_key"
}

User does not have enough permissions to perform this action.

Placeholder ID not found, or push protection is disabled on this repository.

Bad request, input data missing or incorrect.

Service unavailable

Media type application/json
object
code
string
message
string
documentation_url
string
Example generated
{
"code": "example",
"message": "example",
"documentation_url": "example"
}