Search documentation
karat

+

K

User Documentation ↗
Version 2.0

Create Branch

POST/api/v2/datasets/{datasetRid}/branches

Creates a branch on an existing dataset. A branch may optionally point to a (committed) transaction.

Third-party applications using this endpoint via OAuth2 must request the following operation scope: api:datasets-write.

Path parameters

datasetRid
string

The Resource Identifier (RID) of a Dataset.

Request body

CreateBranchRequest
object
Hide child attributes

Hide child attributes

transactionRid
string
optional

The most recent OPEN or COMMITTED transaction on the branch. This will never be an ABORTED transaction.

name
string

The name of a Branch.

Response body

Branch
object

The created Branch

Hide child attributes

Hide child attributes

name
string

The name of a Branch.

transactionRid
string
optional

The most recent OPEN or COMMITTED transaction on the branch. This will never be an ABORTED transaction.

Examples

Request

Copied!
1 2 3 4 5 curl -X POST \ -H "Content-type: application/json" \ -H "Authorization: Bearer $TOKEN" \ "https://$HOSTNAME/api/v2/datasets/ri.foundry.main.dataset.c26f11c8-cdb3-4f44-9f5d-9816ea1c82da/branches" \ -d '{"transactionRid":"ri.foundry.main.transaction.0a0207cb-26b7-415b-bc80-66a3aa3933f4","name":"master"}'

Response

Copied!
1 2 3 4 { "transactionRid": "ri.foundry.main.transaction.0a0207cb-26b7-415b-bc80-66a3aa3933f4", "name": "master" }

Error responses

Error Name
BranchNotFoundError CodeNOT_FOUND
Status Code404
DescriptionThe requested branch could not be found, or the client token does not have access to it.
ParametersdatasetRid, branchName
DatasetNotFoundError CodeNOT_FOUND
Status Code404
DescriptionThe requested dataset could not be found, or the client token does not have access to it.
ParametersdatasetRid
TransactionNotCommittedError CodeINVALID_ARGUMENT
Status Code400
DescriptionThe given transaction has not been committed.
ParametersdatasetRid, transactionRid, transactionStatus
TransactionNotFoundError CodeNOT_FOUND
Status Code404
DescriptionThe requested transaction could not be found on the dataset, or the client token does not have access to it.
ParametersdatasetRid, transactionRid
CreateBranchPermissionDeniedError CodePERMISSION_DENIED
Status Code403
DescriptionThe provided token does not have permission to create a branch of this dataset.
ParametersdatasetRid, branchName
BranchAlreadyExistsError CodeCONFLICT
Status Code409
DescriptionThe branch cannot be created because a branch with that name already exists.
ParametersdatasetRid, branchName
InvalidBranchNameError CodeINVALID_ARGUMENT
Status Code400
DescriptionThe requested branch name cannot be used. Branch names cannot be empty and must not look like RIDs or UUIDs.
ParametersbranchName