---
title: "Repair Tenant Group"
method: POST
path: "/tenants/{tenant_id}/group"
tags: ["tenants"]
---

# Repair Tenant Group

`POST /tenants/{tenant_id}/group`

## Request

- Base URL: `https://api.b2metric.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.b2metric.com/tenants/{tenant_id}/group`
- Auth: none declared

Re-run the Keycloak group sync for an existing tenant. Idempotent.

Create provisions the group best-effort, so a KC outage leaves a tenant
with none — and every member operation then 400s. Re-POSTing the same name
used to paper over that by creating a second row; `uq_tenants_name` (0012)
now rejects it, so the sync needs a door of its own. Failures surface here
rather than being logged and swallowed: syncing the group is the only thing
this call does.

## Path parameters

- `tenant_id` string, uuid, required

## Headers

- `authorization` string, nullable

## Response `200`

Successful Response

- TenantOut
  - `id` string, uuid, required
  - `name` string, required
  - `workspace_id` string, uuid, required
  - `kc_group_id` string, nullable
  - `timezone` string
  - `locale` string
  - `legal_name` string, nullable
  - `contact_name` string, nullable
  - `contact_email` string, nullable

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/b2metric/apis/b2metric-license-api.md) - [All operations](https://skmtc.dev/b2metric/apis/b2metric-license-api/llms.txt) - [OpenAPI document](https://skmtc.dev/b2metric/apis/b2metric-license-api/revisions/5c26e11e8b53?raw)
