---
title: "SyncOrganization is used by processes that monitor the identity providers to synchronize the users and teams with the ones in TSB."
method: POST
path: "/v2/organizations/{organization}/sync"
tags: ["Organizations"]
---

# SyncOrganization is used by processes that monitor the identity providers to synchronize the users and teams with the ones in TSB.

`POST /v2/organizations/{organization}/sync`

## Request

- Base URL: `https://docs.tetrate.io` (the document declares no server; this is the origin it was published from)
- URL: `https://docs.tetrate.io/v2/organizations/{organization}/sync`
- Auth: none declared
- TypeScript: <https://skmtc.dev/tetrate/apis/tetrate-service-bridge-api/docs/v2/organizations/:organization/sync/post.ts> (a function with typed inputs; its response is checked against the schema)

This method will update the state of users and groups in the organization and will create, modify, and
delete groups according to the incoming request.
Sync requests are assumed to be a full-sync and to contain all existing users and groups. Existing TSB users and groups
that are not contained in a sync request will be deleted from the platform, as it will assume they have been removed
from the Identity Provider.

## Path parameters

- `organization` string, required

## Request body

- object: Request to synchronize the users and teams in an organization from the configured identity provider.
  - `sourceType` 'INVALID' | 'LDAP' | 'LOCAL' | 'AZURE' | 'MANUAL': `SourceType` describes where teams come from. Teams can be synchronized from the Identity Provider but can also be manually created using the Team API to create convenient groupings of users and other teams in order to configure fine-grained permissions in the Management Plane. - LDAP: LDAP is used for users and teams that are automatically synchronized from LDAP. - LOCAL: LOCAL is used for local teams that are manually created using the TSB Team API and do not exist in the Identity Provider. Deprecated. This value is deprecated and will be removed in future releases. Use 'MANUAL' instead. - AZURE: AZURE is used for users synchronized from an Azure Active Directory. - MANUAL: MANUAL is used for users and teams that exist in the Identity Provider that have been manually populated. MANUAL users are deprecated and Service Accounts should be used instead. Support for MANUAL users will be removed in future versions.
  - `teams` SyncOrganizationRequestSyncTeam[]
    - `id` string, required: Unique ID for the group.
    - `description` string: Optional description for the group.
    - `memberUserIds` string[]: List of user ids for the users that belong to this group.
    - `memberGroupIds` string[]: List of group ids for the groups that are nested into this group.
    - `displayName` string: Friendly name to show the group in the different UIs.
  - `users` SyncOrganizationRequestSyncUser[]
    - `id` string, required: Unique ID for the user.
    - `description` string: Optional description for the user.
    - `email` string
    - `loginName` string: The login username for the user.
    - `displayName` string: Friendly name to show the user in the different UIs.

## Response `200`

A successful response.

- V2SyncOrganizationResponse: Result of the organization users and team synchronization.
  - `failedUsers` SyncOrganizationResponseFailedIds
    - `removal` string[]
    - `addition` string[]
    - `update` string[]
  - `failedTeams` SyncOrganizationResponseFailedIds
    - `removal` string[]
    - `addition` string[]
    - `update` string[]

## Other responses

- `default`: An unexpected error response.

---

[API](https://skmtc.dev/tetrate/apis/tetrate-service-bridge-api.md) - [All operations](https://skmtc.dev/tetrate/apis/tetrate-service-bridge-api/llms.txt) - [OpenAPI document](https://skmtc.dev/tetrate/apis/tetrate-service-bridge-api/revisions/2f19c3a1ae57?raw)
