Rename a branch
Change the name of a live branch. The branch keeps its identity and its head commit. The rename adds an event to the branch history. You must have permission to rename branches.
bearerAuthAuthorizationBearer <token>project_id*stringOwning project identifier. Nonempty, at most 128 UTF-8 bytes, with no control characters. Project creation belongs to the project service.
branch_id*stringStable UUIDv7 branch identity. Rename preserves identity; deletion tombstones it.
uuidapplication/json- body
idempotencyKey*catalog.IdempotencyKeyNonempty opaque retry key, at most 128 UTF-8 bytes, scoped to project and authenticated actor. Identical retries return the saved result; reuse for a different operation or request is rejected.
newName*catalog.BranchNameSlash-separated branch name, at most 255 UTF-8 bytes. Empty, dot, trailing-dot, .lock, and control segments are rejected by the service.
Success
application/json- response
branchId*catalog.BranchIdStable UUIDv7 branch identity. Rename preserves identity; deletion tombstones it.
uuidcreatedAtMicros*|deletedAtMicros?||nullheadCommitId*catalog.CommitIdImmutable UUIDv7 project commit identity.
uuidlastBranchEventId*catalog.BranchEventIdImmutable UUIDv7 branch event identity.
uuidname*catalog.BranchNameSlash-separated branch name, at most 255 UTF-8 bytes. Empty, dot, trailing-dot, .lock, and control segments are rejected by the service.
curl -X POST 'https://api.spiraldb.dev/api/catalog/projects/string/branches/497f6eca-6276-4993-bfeb-53cbbbba6f08/rename' \ -H 'Content-Type: application/json' \ -d '{ "idempotencyKey": "string", "newName": "string"}'{ "branchId": "712f308d-801e-48bc-b072-9c404734ceb7", "createdAtMicros": "string", "deletedAtMicros": "string", "headCommitId": "ccbbf3ab-15f4-491f-bfd0-0193cd890679", "lastBranchEventId": "26c3ae27-e158-44c2-95aa-45b0c7e8349c", "name": "string"}