---
title: "Sync connected rosters"
method: POST
path: "/v1/members/sync"
tags: ["members"]
---

# Sync connected rosters

`POST /v1/members/sync`

## Request

- Base URL: `https://api.patricia.app` (the document declares no server; this is the origin it was published from)
- URL: `https://api.patricia.app/v1/members/sync`
- Auth: HTTP bearer

Trigger Slack and Teams roster syncs for the authenticated tenant.

Both services use ``enroll_new_members=True``. This is the only roster path that adds new
people. Background roster tasks only refresh identities and existing memberships.

The counters sum the platform results. Slack commits before Teams starts. The Teams sync runs
inside a savepoint; a contained Teams failure returns the committed Slack counters.

## Headers

- `X-Tenant-Id` string, nullable

## Response `200`

Successful Response

- SyncResultResponse: Counters returned from a roster sync run. ``excluded`` is how many members were skipped this run by the roster policy (e.g. guests when guests are off); ``policy_deactivated`` is how many previously-synced members the policy now excludes were deactivated. ``teams_outcome`` says what the Teams half DID, which the counters cannot. All four of "no Teams install", "installed but no Entra group bound", "read the roster and nobody changed" and "the run raised" produce the same zeros, and only the second is a fault the admin can act on: the team owner reinstalls so resource-specific consent binds the group id. A caller that reads only the counters cannot tell those apart, which is how an install stays broken without anybody noticing.
  - `added` integer, required
  - `updated` integer, required
  - `deactivated` integer, required
  - `excluded` integer
  - `policy_deactivated` integer
  - `adopted` integer
  - `teams_outcome` 'not_installed' | 'not_configured' | 'synced' | 'failed': What one Teams roster sync DID, which zero counters cannot say on their own. Four states because the world has four, and collapsing them is how the p0 tenant stayed broken in silence: a workspace with no Teams install, one whose team was never bound, and one whose team is bound and simply has nobody new all return the same zeros. Only the second is a fault, and its remedy is specific — the team owner reinstalls so resource-specific consent binds the Entra group id — so it has to be tellable from the other two by the admin who clicks Sync.
  - `teams_unattested` integer
  - `teams_foreign_tenant_refused` integer

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/patricia/apis/patricia-api.md) · [All operations](https://skmtc.dev/patricia/apis/patricia-api/llms.txt) · [OpenAPI document](https://skmtc.dev/patricia/apis/patricia-api/revisions/0dfb44495ea1?raw)
