# Verzeichnis-Synchronisation konfigurieren

`PUT https://{tenant}.stamp.eu/rest/sso/sync/{provider}`

Idempotent upsert — always 200, also on the first write.

## Pfadparameter

| Name | Typ | Pflicht |
| --- | --- | --- |
| `provider` | string | ja |

## Request-Body

| Feld | Typ | Pflicht | Beschreibung |
| --- | --- | --- | --- |
| `enabled` | boolean | nein |  |
| `auto_commit` | boolean | nein |  |
| `group_id` | string \| null | nein | Entra takes the group object id (a GUID), Google the groupKey — its mail address or its numeric id. |
| `admin_email` | string | nein | Google has no app-only directory access: the service account impersonates this administrator. Entra needs no counterpart. |
| `default_schedule_model_id` | string \| null | nein |  |
| `default_holiday_calendar_id` | string \| null | nein |  |

## Antworten

### 200: `DirectorySyncConfigResource`

| Feld | Typ | Pflicht | Beschreibung |
| --- | --- | --- | --- |
| `data` | object | ja |  |
| `data.id` | string \| null | ja |  |
| `data.provider` | string | ja |  |
| `data.configured` | boolean | ja |  |
| `data.enabled` | boolean | ja |  |
| `data.auto_commit` | boolean | ja |  |
| `data.group_id` | string \| null | ja |  |
| `data.admin_email` | string \| null | ja |  |
| `data.default_schedule_model_id` | string \| null | ja |  |
| `data.default_holiday_calendar_id` | string \| null | ja |  |
| `data.runnable` | boolean | ja | Whether a run could actually read the directory right now. |
| `data.requires_admin_email` | boolean | ja | Google impersonates a Workspace administrator; Entra uses an app-only token. The flag saves the client a provider switch. |
| `data.credentials_configured` | boolean | ja |  |
| `data.synced_at` | string \| null | ja |  |
| `data.last_error` | string \| null | ja |  |
| `data.last_run` | null \| object | ja |  |
| `data.updated_at` | string \| null | ja |  |

### 401: Unauthenticated

| Feld | Typ | Pflicht | Beschreibung |
| --- | --- | --- | --- |
| `message` | string | ja | Error overview. |

### 422: Validation error

| Feld | Typ | Pflicht | Beschreibung |
| --- | --- | --- | --- |
| `message` | string | ja | Errors overview. |
| `errors` | object | ja | A detailed description of each field that failed validation. |
