---
title: "Make a branch the Head office"
description: "Other routes API"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.certinvo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Make a branch the Head office

{/* Generated by apps/docs/scripts/generate.ts from contracts/api/openapi.yaml. Do not edit. */}
<div class="cvo-op">
<div class="cvo-op-main">

<div class="cvo-op-header">
<div class="cvo-op-path-row">
<span class="cvo-method" data-method="post">POST</span>
<code class="cvo-op-path-code">/v1/establishments/&#123;id&#125;/head-office</code>
</div>
</div>

Makes this branch the Head office and the Head office a branch, both as new versions naming the key or the person, in one step: the company has exactly one Head office before and after. Earlier versions are kept unchanged. Only a branch becomes the Head office. A VAT registration only is not established in its country, and an establishment whose `kind` is not stated must first be saved as a branch. Asked of the Head office itself, nothing is saved. The answer is the establishments as `GET /v1/establishments` lists them, the Head office first.

## Path parameters

## Response

A `200` answer carries these fields.

## Status codes

| Status | Meaning |
|---|---|
| `200` | The establishments after the move. |
| `400` | The establishment is not a branch (`invalid_establishment`). The message names the kind. Nothing was saved. |
| `401` | No usable credential was sent (`invalid_credentials`). |
| `404` | This company has no establishment by that id (`not_found`). |
| `409` | Someone saved the branch or the Head office meanwhile (`version_conflict`). Nothing was saved. Read them again, then try again. |
| `501` | This deployment has no database, so it keeps no establishments (`no_database`). Sending the same request again will not help. |

</div>
<div class="cvo-op-aside">

</div>
</div>

Source: https://docs.certinvo.com/reference/api/other/make-a-branch-the-head-office/index.mdx
