GitButler Logo
API Reference

Patches

Operations about patches

GET
/patch_stack/{uuid}/patch/{change_id}/section/{section_code}

Get Patch Stack Uuid Patch Change Id Section Section Code

Return section for a patch

/patch_stack/{uuid}/patch/{change_id}/section/{section_code}

Path Parameters

uuid
Required
string

Patch Stack UUID

change_id
Required
string

Patch Change ID

section_code
Required
string

Patch Section Code

curl -X GET "https://app.gitbutler.com/api/patch_stack/string/patch/string/section/string"

Return section for a patch

{
  "id": "string",
  "section_type": "string",
  "identifier": "string",
  "title": "string",
  "version": "string",
  "type": "string",
  "code": "string",
  "data": "string",
  "position": "string"
}

PATCH
/patch_stack/{uuid}/patch/{change_id}/section/{section_code}

Patch Patch Stack Uuid Patch Change Id Section Section Code

Update section for a patch

/patch_stack/{uuid}/patch/{change_id}/section/{section_code}

Request Body

application/jsonOptional

textstring

Section markdown text

Path Parameters

uuid
Required
string

Patch Stack UUID

change_id
Required
string

Patch Change ID

section_code
Required
string

Patch Section Code

curl -X PATCH "https://app.gitbutler.com/api/patch_stack/string/patch/string/section/string" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "string"
  }'

Update section for a patch

{
  "id": "string",
  "section_type": "string",
  "identifier": "string",
  "title": "string",
  "version": "string",
  "type": "string",
  "code": "string",
  "data": "string",
  "position": "string"
}

DELETE
/patch_stack/{uuid}/patch/{change_id}/section/{section_code}

Delete Patch Stack Uuid Patch Change Id Section Section Code

Delete section for a patch

/patch_stack/{uuid}/patch/{change_id}/section/{section_code}

Path Parameters

uuid
Required
string

Patch Stack UUID

change_id
Required
string

Patch Change ID

section_code
Required
string

Patch Section Code

curl -X DELETE "https://app.gitbutler.com/api/patch_stack/string/patch/string/section/string"

Delete section for a patch

POST
/patch_stack/{uuid}/patch/{change_id}/section

Post Patch Stack Uuid Patch Change Id Section

Create new section for a patch

/patch_stack/{uuid}/patch/{change_id}/section

Request Body

application/jsonRequired

type
Required
string

Section type

Value in: "text"

textstring

Section markdown text

positioninteger

Where to insert the section

Format: "int32"

Path Parameters

uuid
Required
string

Patch Stack UUID

change_id
Required
string

Patch Change ID

curl -X POST "https://app.gitbutler.com/api/patch_stack/string/patch/string/section" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "text",
    "text": "string",
    "position": 0
  }'

Create new section for a patch

{
  "id": "string",
  "section_type": "string",
  "identifier": "string",
  "title": "string",
  "version": "string",
  "type": "string",
  "code": "string",
  "data": "string",
  "position": "string"
}

GET
/patch_stack/{uuid}/patch/{change_id}

Get Patch Stack Uuid Patch Change Id

Return sections for a patch

/patch_stack/{uuid}/patch/{change_id}

Path Parameters

uuid
Required
string

Patch Stack UUID

change_id
Required
string

Patch Change ID

curl -X GET "https://app.gitbutler.com/api/patch_stack/string/patch/string"

Return sections for a patch

{
  "change_id": "string",
  "commit_sha": "string",
  "patch_sha": "string",
  "title": "string",
  "description": "string",
  "position": "string",
  "version": "string",
  "created_at": "string",
  "contributors": "string",
  "statistics": "string",
  "review": "string",
  "review_all": "string",
  "sections": "string"
}

PATCH
/patch_stack/{uuid}/patch/{change_id}

Patch Patch Stack Uuid Patch Change Id

Update patch in a patch stack

/patch_stack/{uuid}/patch/{change_id}

Request Body

application/jsonOptional

section_orderarray<string>

Order of sections in a patch stack (array of file paths and section codes)

sign_offboolean

Sign off on the patch

Path Parameters

uuid
Required
string

Patch Stack UUID

change_id
Required
string

Patch Change ID

curl -X PATCH "https://app.gitbutler.com/api/patch_stack/string/patch/string" \
  -H "Content-Type: application/json" \
  -d '{
    "section_order": [
      "string"
    ],
    "sign_off": true
  }'

Update patch in a patch stack

{
  "change_id": "string",
  "commit_sha": "string",
  "patch_sha": "string",
  "title": "string",
  "description": "string",
  "position": "string",
  "version": "string",
  "created_at": "string",
  "contributors": "string",
  "statistics": "string",
  "review": "string",
  "review_all": "string",
  "sections": "string"
}