---
title: "Sync Tenant From App"
method: POST
path: "/admin/tenants/sync-from-app"
tags: ["Tenants"]
---

# Sync Tenant From App

`POST /admin/tenants/sync-from-app`

## Request

- Base URL: `https://developer.claimmind.life` (the document declares no server; this is the origin it was published from)
- URL: `https://developer.claimmind.life/admin/tenants/sync-from-app`
- Auth: OAuth 2
  - Password
  - Token URL: `token`

Sync tenant from Claim Mind App to Open API.

This operation:
- Moves all data (claims, sftp_sync_log, users) from old tenant to new tenant
- Transfers hospital_group_id from old to new tenant
- Updates Keycloak group attributes

**Requires mtk-admin role.**

## Request body

- TenantSyncRequest: Request schema for syncing tenant from App.
  - `tenant_id_app` string, required: Tenant ID from Claim Mind App
  - `tenant_id_old` string, required: Tenant ID to replace in Open API

## Response `200`

Successful Response

- TenantSyncResponse: Response schema for tenant sync.
  - `success` boolean, required
  - `message` string, required
  - `details` TenantSyncDetails: Details of sync operation.
    - `hospital_group_id` string, nullable
    - `claims_updated` integer
    - `sftp_sync_log_updated` integer
    - `configs_merged` integer
    - `api_keys_updated` integer
    - `keycloak_updated` boolean
    - `old_tenant_deleted` boolean

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/claimmind/apis/claimmind-open-api-service.md) - [All operations](https://skmtc.dev/claimmind/apis/claimmind-open-api-service/llms.txt) - [OpenAPI document](https://skmtc.dev/claimmind/apis/claimmind-open-api-service/revisions/ee8bfbeadb8a?raw)
