API

RepoBookmarkProtection

Operations

Every route this entity exposes. Each route links to its own reference on this page.

Method Route SDK operation Returns
POST /api/v1/organizations/{org_slug}/repos/{repo_slug}/bookmark_protections create Success
POST /api/v1/organizations/{org_slug}/repos/{repo_slug}/bookmark_protections/simulate create Bookmark protection evaluation
GET /api/v1/organizations/{org_slug}/repos/{repo_slug}/bookmark_protections list Bookmark protection rules
GET /api/v1/organizations/{org_slug}/repos/{repo_slug}/bookmark_protections/{id} load Bookmark protection rule
PATCH /api/v1/organizations/{org_slug}/repos/{repo_slug}/bookmark_protections/{id} patch Bookmark protection rule updated
DELETE /api/v1/organizations/{org_slug}/repos/{repo_slug}/bookmark_protections/{id} remove Success
PUT /api/v1/organizations/{org_slug}/repos/{repo_slug}/bookmark_protections/{id} update Bookmark protection rule updated

Examples

One example per SDK, generated from the API model. The argument names are the parameters and fields of this entity, and the values are placeholders. The examples are not compiled or executed.

Golang

Construct client as shown in the Golang setup, then call the operations:

repo_bookmark_protections, err := client.RepoBookmarkProtection(nil).List(map[string]any{"organization_id": "example", "repo_id": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(repo_bookmark_protections)
repo_bookmark_protection, err := client.RepoBookmarkProtection(nil).Load(map[string]any{"id": "example_id", "organization_id": "example", "repo_id": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(repo_bookmark_protection)
created, err := client.RepoBookmarkProtection(nil).Create(map[string]any{"organization_id": "example", "repo_id": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(created)
updated, err := client.RepoBookmarkProtection(nil).Update(map[string]any{"id": "example_id", "organization_id": "example", "repo_id": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(updated)
patched, err := client.RepoBookmarkProtection(nil).Patch(map[string]any{"id": "example_id", "organization_id": "example", "repo_id": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(patched)
removed, err := client.RepoBookmarkProtection(nil).Remove(map[string]any{"id": "example_id", "organization_id": "example", "repo_id": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(removed)

Lua

Construct client as shown in the Lua setup, then call the operations:

local repo_bookmark_protections, err = client:RepoBookmarkProtection():list({ organization_id = "example", repo_id = "example" })
local repo_bookmark_protection, err = client:RepoBookmarkProtection():load({ id = "example_id", organization_id = "example", repo_id = "example" })
local created, err = client:RepoBookmarkProtection():create({ organization_id = "example", repo_id = "example" })
local updated, err = client:RepoBookmarkProtection():update({ id = "example_id", organization_id = "example", repo_id = "example" })
local patched, err = client:RepoBookmarkProtection():patch({ id = "example_id", organization_id = "example", repo_id = "example" })
local removed, err = client:RepoBookmarkProtection():remove({ id = "example_id", organization_id = "example", repo_id = "example" })

PHP

Construct client as shown in the PHP setup, then call the operations:

$repo_bookmark_protections = $client->RepoBookmarkProtection()->list(["organization_id" => "example", "repo_id" => "example"]);
$repo_bookmark_protection = $client->RepoBookmarkProtection()->load(["id" => "example_id", "organization_id" => "example", "repo_id" => "example"]);
$created = $client->RepoBookmarkProtection()->create(["organization_id" => "example", "repo_id" => "example"]);
$updated = $client->RepoBookmarkProtection()->update(["id" => "example_id", "organization_id" => "example", "repo_id" => "example"]);
$patched = $client->RepoBookmarkProtection()->patch(["id" => "example_id", "organization_id" => "example", "repo_id" => "example"]);
$client->RepoBookmarkProtection()->remove(["id" => "example_id", "organization_id" => "example", "repo_id" => "example"]);

Python

Construct client as shown in the Python setup, then call the operations:

repo_bookmark_protections = client.RepoBookmarkProtection().list({"organization_id": "example", "repo_id": "example"})
repo_bookmark_protection = client.RepoBookmarkProtection().load({"id": "example_id", "organization_id": "example", "repo_id": "example"})
created = client.RepoBookmarkProtection().create({ "organization_id": "example", "repo_id": "example" })
updated = client.RepoBookmarkProtection().update({"id": "example_id", "organization_id": "example", "repo_id": "example"})
patched = client.RepoBookmarkProtection().patch({"id": "example_id", "organization_id": "example", "repo_id": "example"})
client.RepoBookmarkProtection().remove({"id": "example_id", "organization_id": "example", "repo_id": "example"})

Ruby

Construct client as shown in the Ruby setup, then call the operations:

repo_bookmark_protections = client.RepoBookmarkProtection.list({ "organization_id" => "example", "repo_id" => "example" })
repo_bookmark_protection = client.RepoBookmarkProtection.load({ "id" => "example_id", "organization_id" => "example", "repo_id" => "example" })
created = client.RepoBookmarkProtection.create({ "organization_id" => "example", "repo_id" => "example" })
updated = client.RepoBookmarkProtection.update({ "id" => "example_id", "organization_id" => "example", "repo_id" => "example" })
patched = client.RepoBookmarkProtection.patch({ "id" => "example_id", "organization_id" => "example", "repo_id" => "example" })
client.RepoBookmarkProtection.remove({ "id" => "example_id", "organization_id" => "example", "repo_id" => "example" })

TypeScript

Construct client as shown in the TypeScript setup, then call the operations:

const repo_bookmark_protections = await client.RepoBookmarkProtection().list({ organization_id: "example", repo_id: "example" })
const repo_bookmark_protection = await client.RepoBookmarkProtection().load({ id: "example_id", organization_id: "example", repo_id: "example" })
const created = await client.RepoBookmarkProtection().create({ organization_id: "example", repo_id: "example" })
const updated = await client.RepoBookmarkProtection().update({ id: "example_id", organization_id: "example", repo_id: "example" })
const patched = await client.RepoBookmarkProtection().patch({ id: "example_id", organization_id: "example", repo_id: "example" })
await client.RepoBookmarkProtection().remove({ id: "example_id", organization_id: "example", repo_id: "example" })

Fields

Field Type Required Description
actor_policy object Yes Actor Policy
bypass_mode string Yes Bypass Mode
created_at string Yes Created At
created_by_user_id one,string,null Yes Created By User Id
enabled boolean Yes Enabled
id string Yes Id
name string Yes Name
organization_id string Yes Organization Id
priority integer Yes Priority
repository_id string Yes Repository Id
requirements object Yes Requirements
target_kind string Yes Target Kind
target_pattern one,string,null Yes Target Pattern
updated_at string Yes Updated At
updated_by_user_id one,string,null Yes Updated By User Id

create

POST /api/v1/organizations/{org_slug}/repos/{repo_slug}/bookmark_protections

Operation ID: post_api_v1_organizations_org_slug_repos_repo_slug_bookmark_protections.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
org_slug path string Yes
repo_slug path string Yes

Request body

application/json

Property Type Required Description
actor_policy object No
bypass_mode enum: admins, none No
enabled boolean No
name string No
priority integer No
requirements object No
requirements.ci object No
requirements.ci.mode enum: none, explicit, follow_github Yes
requirements.ci.require_all boolean Yes
requirements.ci.required_checks array of string or object Yes
target_kind enum: exact, pattern, default_branch No
target_pattern string No

Responses

200: Success

application/json

The response is object.

201: Bookmark protection rule created

application/json

Property Type Required Description
actor_policy object Yes
bypass_mode enum: admins, none Yes
created_at string (date-time) Yes
created_by_user_id string Yes
enabled boolean Yes
id string Yes
name string Yes
organization_id string Yes
priority integer Yes
repository_id string Yes
requirements object Yes
requirements.ci object No
requirements.ci.mode enum: none, explicit, follow_github Yes
requirements.ci.require_all boolean Yes
requirements.ci.required_checks array of string or object Yes
target_kind enum: exact, pattern, default_branch Yes
target_pattern string Yes
updated_at string (date-time) Yes
updated_by_user_id string Yes
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway

POST /api/v1/organizations/{org_slug}/repos/{repo_slug}/bookmark_protections/simulate

Operation ID: simulate_api_v1_bookmark_protections.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
org_slug path string Yes
repo_slug path string Yes

Request body

application/json

Property Type Required Description
actor_kind string No
bookmark string Yes
change_id string No
from string No
intent string No
to string Yes

Responses

200: Bookmark protection evaluation

application/json

Property Type Required Description
evaluation object Yes
evaluation.action string Yes
evaluation.allowed boolean Yes
evaluation.bypassed boolean Yes
evaluation.metadata object Yes
evaluation.reasons array of object Yes
evaluation.reasons[].code string Yes
evaluation.reasons[].details object Yes
evaluation.reasons[].message string Yes
evaluation.reasons[].severity string Yes
evaluation.rule_id string Yes
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway

list

GET /api/v1/organizations/{org_slug}/repos/{repo_slug}/bookmark_protections

Operation ID: api_v1_bookmark_protections.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
org_slug path string Yes
repo_slug path string Yes

Responses

200: Bookmark protection rules

application/json

Property Type Required Description
[].actor_policy object Yes
[].bypass_mode enum: admins, none Yes
[].created_at string (date-time) Yes
[].created_by_user_id string Yes
[].enabled boolean Yes
[].id string Yes
[].name string Yes
[].organization_id string Yes
[].priority integer Yes
[].repository_id string Yes
[].requirements object Yes
[].requirements.ci object No
[].requirements.ci.mode enum: none, explicit, follow_github Yes
[].requirements.ci.require_all boolean Yes
[].requirements.ci.required_checks array of string or object Yes
[].target_kind enum: exact, pattern, default_branch Yes
[].target_pattern string Yes
[].updated_at string (date-time) Yes
[].updated_by_user_id string Yes
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway

load

GET /api/v1/organizations/{org_slug}/repos/{repo_slug}/bookmark_protections/{id}

Operation ID: api_v1_bookmark_protection.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
org_slug path string Yes
repo_slug path string Yes
id path string Yes

Responses

200: Bookmark protection rule

application/json

Property Type Required Description
actor_policy object Yes
bypass_mode enum: admins, none Yes
created_at string (date-time) Yes
created_by_user_id string Yes
enabled boolean Yes
id string Yes
name string Yes
organization_id string Yes
priority integer Yes
repository_id string Yes
requirements object Yes
requirements.ci object No
requirements.ci.mode enum: none, explicit, follow_github Yes
requirements.ci.require_all boolean Yes
requirements.ci.required_checks array of string or object Yes
target_kind enum: exact, pattern, default_branch Yes
target_pattern string Yes
updated_at string (date-time) Yes
updated_by_user_id string Yes
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway

patch

PATCH /api/v1/organizations/{org_slug}/repos/{repo_slug}/bookmark_protections/{id}

Operation ID: patch_api_v1_organizations_org_slug_repos_repo_slug_bookmark_protections_id_.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
org_slug path string Yes
repo_slug path string Yes
id path string Yes

Request body

application/json

Property Type Required Description
actor_policy object No
bypass_mode enum: admins, none No
enabled boolean No
name string No
priority integer No
requirements object No
requirements.ci object No
requirements.ci.mode enum: none, explicit, follow_github Yes
requirements.ci.require_all boolean Yes
requirements.ci.required_checks array of string or object Yes
target_kind enum: exact, pattern, default_branch No
target_pattern string No

Responses

200: Bookmark protection rule updated

application/json

Property Type Required Description
actor_policy object Yes
bypass_mode enum: admins, none Yes
created_at string (date-time) Yes
created_by_user_id string Yes
enabled boolean Yes
id string Yes
name string Yes
organization_id string Yes
priority integer Yes
repository_id string Yes
requirements object Yes
requirements.ci object No
requirements.ci.mode enum: none, explicit, follow_github Yes
requirements.ci.require_all boolean Yes
requirements.ci.required_checks array of string or object Yes
target_kind enum: exact, pattern, default_branch Yes
target_pattern string Yes
updated_at string (date-time) Yes
updated_by_user_id string Yes
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway

remove

DELETE /api/v1/organizations/{org_slug}/repos/{repo_slug}/bookmark_protections/{id}

Operation ID: delete_api_v1_organizations_org_slug_repos_repo_slug_bookmark_protections_id_.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
org_slug path string Yes
repo_slug path string Yes
id path string Yes

Responses

200: Success

application/json

The response is object.

204: Bookmark protection rule deleted
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway

update

PUT /api/v1/organizations/{org_slug}/repos/{repo_slug}/bookmark_protections/{id}

Operation ID: put_api_v1_organizations_org_slug_repos_repo_slug_bookmark_protections_id_.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
org_slug path string Yes
repo_slug path string Yes
id path string Yes

Request body

application/json

Property Type Required Description
actor_policy object No
bypass_mode enum: admins, none No
enabled boolean No
name string No
priority integer No
requirements object No
requirements.ci object No
requirements.ci.mode enum: none, explicit, follow_github Yes
requirements.ci.require_all boolean Yes
requirements.ci.required_checks array of string or object Yes
target_kind enum: exact, pattern, default_branch No
target_pattern string No

Responses

200: Bookmark protection rule updated

application/json

Property Type Required Description
actor_policy object Yes
bypass_mode enum: admins, none Yes
created_at string (date-time) Yes
created_by_user_id string Yes
enabled boolean Yes
id string Yes
name string Yes
organization_id string Yes
priority integer Yes
repository_id string Yes
requirements object Yes
requirements.ci object No
requirements.ci.mode enum: none, explicit, follow_github Yes
requirements.ci.require_all boolean Yes
requirements.ci.required_checks array of string or object Yes
target_kind enum: exact, pattern, default_branch Yes
target_pattern string Yes
updated_at string (date-time) Yes
updated_by_user_id string Yes
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway