POST
/
repos
/
{repo_id}
/
shelves
curl --request POST \
  --url https://api.diversion.dev/v0/repos/{repo_id}/shelves \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "<string>",
  "workspace_id": "<string>",
  "reset_workspace": true
}'
{
  "id": "<string>",
  "name": "<string>",
  "created_timestamp": 123,
  "branch_id": "<string>"
}

Authorizations

Authorization
string
headerrequired

This API uses OAuth 2 with the implicit grant flow

Path Parameters

repo_id
string
required

The repo ID of the repository. Repo name can be used instead of the ID, but usage of ID for permanent linking and API requests is preferred.

Body

application/json
name
string
required

Display name of the shelf

workspace_id
string
required

Workspace ID from which to shelve changes

reset_workspace
boolean
default: true

Should reset workspace changes after creating the shelf

Response

201 - application/json
id
string
required

Shelf identifier in Diversion

name
string
required

Display name of the shelf

created_timestamp
integer
required

Seconds since epoch UTC

branch_id
string

Optional branch ID from which the changes were shelved