Skip to content
  • Auto
  • Light
  • Dark
Get Started
View as Markdown
Copy Markdown

Open in Claude
Open in ChatGPT

Retrieve

client.vals.branches.retrieve(stringbranchID, BranchRetrieveParams { val_id } params, RequestOptionsoptions?): BranchRetrieveResponse { id, createdAt, forkedBranchId, 4 more }
get/v2/vals/{val_id}/branches/{branch_id}

Get a branch by id

ParametersExpand Collapse
branchID: string
params: BranchRetrieveParams { val_id }
val_id: string

Id of a val

formatuuid
ReturnsExpand Collapse
BranchRetrieveResponse { id, createdAt, forkedBranchId, 4 more }

A Branch

id: string

The id of the branch

formatuuid
createdAt: string
forkedBranchId: string | null

The id of the branch this branch was forked from

The URL of this resource on Val Town

formaturi

The URL of this resource on this API

formaturi
name: string
updatedAt: string
version: number
import ValTown from "npm:@valtown/sdk";

const client = new ValTown();

const branch = await client.vals.branches.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
  val_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
});

console.log(branch.id);
{
  "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "createdAt": "2019-12-27T18:11:19.117Z",
  "forkedBranchId": "forkedBranchId",
  "links": {
    "html": "https://example.com",
    "self": "https://example.com"
  },
  "name": "name",
  "updatedAt": "2019-12-27T18:11:19.117Z",
  "version": 0
}
Returns Examples
{
  "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "createdAt": "2019-12-27T18:11:19.117Z",
  "forkedBranchId": "forkedBranchId",
  "links": {
    "html": "https://example.com",
    "self": "https://example.com"
  },
  "name": "name",
  "updatedAt": "2019-12-27T18:11:19.117Z",
  "version": 0
}