Skip to main content

Documentation Index

Fetch the complete documentation index at: https://code.storage/docs/llms.txt

Use this file to discover all available pages before exploring further.

Delete a branch from the repository. The current branch tip is resolved server-side, so the request does not need to know the branch SHA.
DELETE /api/v1/repos/branches
Authorization: Bearer YOUR_JWT_TOKEN
Content-Type: application/json

{
  "name": "feature/old-onboarding"
}

Request Body

name
string
required
Branch name to delete (e.g. feature/old-onboarding). Must not start with refs/.

JWT Requirements

  • The JWT must include the repository in the repo claim
  • Requires git:write scope

Response

{
  "name": "feature/old-onboarding",
  "message": "branch deleted"
}

Notes

  • The repository’s default branch cannot be deleted; attempts return 409 Conflict.
  • If the repository is connected to a GitHub base, branch deletion triggers a sync automatically.

Error Responses

400 Bad Request
string
Invalid branch name or missing required fields
401 Unauthorized
string
Invalid JWT or missing authorization header
403 Forbidden
string
Missing git:write scope
404 Not Found
string
Branch does not exist
409 Conflict
string
Attempted to delete the repository’s default branch