API

VcBranch

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}/vcs/branches create Success
GET /api/v1/organizations/{org_slug}/repos/{repo_slug}/vcs/branches list Repository bookmarks
DELETE /api/v1/organizations/{org_slug}/repos/{repo_slug}/vcs/branches/{branch_name} remove Success

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:

vc_branchs, err := client.VcBranch(nil).List(map[string]any{"organization_id": "example", "repo_id": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(vc_branchs)
created, err := client.VcBranch(nil).Create(map[string]any{"organization_id": "example", "repo_id": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(created)
removed, err := client.VcBranch(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 vc_branchs, err = client:VcBranch():list({ organization_id = "example", repo_id = "example" })
local created, err = client:VcBranch():create({ organization_id = "example", repo_id = "example" })
local removed, err = client:VcBranch():remove({ id = "example_id", organization_id = "example", repo_id = "example" })

PHP

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

$vc_branchs = $client->VcBranch()->list(["organization_id" => "example", "repo_id" => "example"]);
$created = $client->VcBranch()->create(["organization_id" => "example", "repo_id" => "example"]);
$client->VcBranch()->remove(["id" => "example_id", "organization_id" => "example", "repo_id" => "example"]);

Python

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

vc_branchs = client.VcBranch().list({"organization_id": "example", "repo_id": "example"})
created = client.VcBranch().create({ "organization_id": "example", "repo_id": "example" })
client.VcBranch().remove({"id": "example_id", "organization_id": "example", "repo_id": "example"})

Ruby

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

vc_branchs = client.VcBranch.list({ "organization_id" => "example", "repo_id" => "example" })
created = client.VcBranch.create({ "organization_id" => "example", "repo_id" => "example" })
client.VcBranch.remove({ "id" => "example_id", "organization_id" => "example", "repo_id" => "example" })

TypeScript

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

const vc_branchs = await client.VcBranch().list({ organization_id: "example", repo_id: "example" })
const created = await client.VcBranch().create({ organization_id: "example", repo_id: "example" })
await client.VcBranch().remove({ id: "example_id", organization_id: "example", repo_id: "example" })

Fields

Field Type Required Description
id string No Id
name string Yes Name
target_commit_id string Yes Target Commit Id

create

POST /api/v1/organizations/{org_slug}/repos/{repo_slug}/vcs/branches

Operation ID: post_api_v1_organizations_org_slug_repos_repo_slug_vcs_branches.

Authentication: bearer token (bearerAuth).

Parameters

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

Request body

application/json

The request body is object.

Responses

200: Success

application/json

The response is object.

401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway

list

GET /api/v1/organizations/{org_slug}/repos/{repo_slug}/vcs/branches

Operation ID: api_v1_org_repo_vcs_branches.

Authentication: bearer token (bearerAuth).

Parameters

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

Responses

200: Repository bookmarks

application/json

Property Type Required Description
branches array of object Yes
branches[].name string Yes
branches[].target_commit_id string Yes
branches_count_label string Yes
default_branch string Yes
protected_bookmarks array of string Yes
setup_required boolean Yes True when the repository has no jj-backend counterpart yet, so the client should offer first-time setup instead of browsing.
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway

remove

DELETE /api/v1/organizations/{org_slug}/repos/{repo_slug}/vcs/branches/{branch_name}

Operation ID: api_v1_org_repo_vcs.

Authentication: bearer token (bearerAuth).

Parameters

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

Responses

200: Success

application/json

The response is object.

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