[Yandex Cloud documentation](../../../../../index.md) > [Yandex Identity Hub](../../../../index.md) > API reference > gRPC > [Identity Provider API](../index.md) > [Synchronization](index.md) > CreateSynchronizationSettings

# Identity Provider API, gRPC: SynchronizationService.CreateSynchronizationSettings

Creates synchronization settings for a subject container.

## gRPC request

**rpc CreateSynchronizationSettings ([CreateSynchronizationSettingsRequest](#yandex.cloud.organizationmanager.v1.idp.CreateSynchronizationSettingsRequest)) returns ([operation.Operation](#yandex.cloud.operation.Operation))**

## CreateSynchronizationSettingsRequest {#yandex.cloud.organizationmanager.v1.idp.CreateSynchronizationSettingsRequest}

```json
{
  "subject_container_id": "string",
  "filter": {
    "domain": "string",
    "groups": [
      "string"
    ],
    "organization_units": [
      "string"
    ]
  },
  "replacement_domain": "string",
  "remove_user_behavior": "RemoveUserBehavior",
  "synchronization_interval": "google.protobuf.Duration",
  "allow_to_capture_users": "bool",
  "allow_to_capture_groups": "bool",
  "user_attribute_mappings": [
    {
      "source": "string",
      "target": "UserTargetAttribute",
      "type": "MappingType"
    }
  ],
  "group_attribute_mappings": [
    {
      "source": "string",
      "target": "GroupTargetAttribute",
      "type": "MappingType"
    }
  ],
  "enable_password_writeback": "bool"
}
```

Request to create synchronization settings.

#|
||Field | Description ||
|| subject_container_id | **string**

Required field. ID of the subject container.

The maximum string length in characters is 50. ||
|| filter | **[SynchronizationFilter](#yandex.cloud.organizationmanager.v1.idp.SynchronizationFilter)**

Required field. Filter configuration for synchronization. ||
|| replacement_domain | **string**

Domain replacement configuration.

The string length in characters must be 0-253. ||
|| remove_user_behavior | enum **RemoveUserBehavior**

Behavior when removing users.

- `REMOVE`: Remove the user.
- `BLOCK`: Block the user. ||
|| synchronization_interval | **[google.protobuf.Duration](https://developers.google.com/protocol-buffers/docs/reference/csharp/class/google/protobuf/well-known-types/duration)**

Interval between synchronization runs. ||
|| allow_to_capture_users | **bool**

Whether users can be captured during synchronization. ||
|| allow_to_capture_groups | **bool**

Whether groups can be captured during synchronization. ||
|| user_attribute_mappings[] | **[UserAttributeMapping](#yandex.cloud.organizationmanager.v1.idp.UserAttributeMapping)**

User attribute mappings.

The maximum number of elements is 50. ||
|| group_attribute_mappings[] | **[GroupAttributeMapping](#yandex.cloud.organizationmanager.v1.idp.GroupAttributeMapping)**

Group attribute mappings.

The maximum number of elements is 50. ||
|| enable_password_writeback | **bool**

Enables password writeback feature. ||
|#

## SynchronizationFilter {#yandex.cloud.organizationmanager.v1.idp.SynchronizationFilter}

Filter configuration for synchronization.

#|
||Field | Description ||
|| domain | **string**

Required field. Domain to synchronize.

The string length in characters must be 1-253. ||
|| groups[] | **string**

List of groups to synchronize.

The string length in characters for each value must be 1-253. The maximum number of elements is 10. ||
|| organization_units[] | **string**

List of organizational units to synchronize.

The string length in characters for each value must be 1-253. The maximum number of elements is 10. ||
|#

## UserAttributeMapping {#yandex.cloud.organizationmanager.v1.idp.UserAttributeMapping}

User attribute mapping configuration.

#|
||Field | Description ||
|| source | **string**

Source attribute name.

The string length in characters must be 0-253. ||
|| target | enum **UserTargetAttribute**

Required field. Target attribute to map to.

- `FULL_NAME`: Full name attribute.
- `GIVEN_NAME`: Given name attribute.
- `FAMILY_NAME`: Family name attribute.
- `EMAIL`: Email attribute.
- `PHONE_NUMBER`: Phone number attribute.
- `USERNAME`: Username attribute.
- `COMPANY_NAME`: Company name attribute.
- `JOB_TITLE`: Job title attribute.
- `DEPARTMENT`: Department attribute.
- `EMPLOYEE_ID`: Employee ID attribute. ||
|| type | enum **MappingType**

Required field. Type of mapping.

- `DIRECT`: Direct mapping from source to target.
- `EMPTY`: Empty mapping (no source attribute). ||
|#

## GroupAttributeMapping {#yandex.cloud.organizationmanager.v1.idp.GroupAttributeMapping}

Group attribute mapping configuration.

#|
||Field | Description ||
|| source | **string**

Source attribute name.

The string length in characters must be 0-253. ||
|| target | enum **GroupTargetAttribute**

Required field. Target attribute to map to.

- `NAME`: Name attribute.
- `DESCRIPTION`: Description attribute. ||
|| type | enum **MappingType**

Required field. Type of mapping.

- `DIRECT`: Direct mapping from source to target.
- `EMPTY`: Empty mapping (no source attribute). ||
|#

## operation.Operation {#yandex.cloud.operation.Operation}

```json
{
  "id": "string",
  "description": "string",
  "created_at": "google.protobuf.Timestamp",
  "created_by": "string",
  "modified_at": "google.protobuf.Timestamp",
  "done": "bool",
  "metadata": "google.protobuf.Any",
  // Includes only one of the fields `error`, `response`
  "error": "google.rpc.Status",
  "response": "google.protobuf.Any"
  // end of the list of possible fields
}
```

An Operation resource. For more information, see [Operation](../../../../../api-design-guide/concepts/operation.md).

#|
||Field | Description ||
|| id | **string**

ID of the operation. ||
|| description | **string**

Description of the operation. 0-256 characters long. ||
|| created_at | **[google.protobuf.Timestamp](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#timestamp)**

Creation timestamp. ||
|| created_by | **string**

ID of the user or service account who initiated the operation. ||
|| modified_at | **[google.protobuf.Timestamp](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#timestamp)**

The time when the Operation resource was last modified. ||
|| done | **bool**

If the value is `false`, it means the operation is still in progress.
If `true`, the operation is completed, and either `error` or `response` is available. ||
|| metadata | **[google.protobuf.Any](https://developers.google.com/protocol-buffers/docs/proto3#any)**

Service-specific metadata associated with the operation.
It typically contains the ID of the target resource that the operation is performed on.
Any method that returns a long-running operation should document the metadata type, if any. ||
|| error | **[google.rpc.Status](https://cloud.google.com/tasks/docs/reference/rpc/google.rpc#status)**

The error result of the operation in case of failure or cancellation.

Includes only one of the fields `error`, `response`.

The operation result.
If `done == false` and there was no failure detected, neither `error` nor `response` is set.
If `done == false` and there was a failure detected, `error` is set.
If `done == true`, exactly one of `error` or `response` is set. ||
|| response | **[google.protobuf.Any](https://developers.google.com/protocol-buffers/docs/proto3#any)**

The normal response of the operation in case of success.
If the original method returns no data on success, such as Delete,
the response is [google.protobuf.Empty](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Empty).
If the original method is the standard Create/Update,
the response should be the target resource of the operation.
Any method that returns a long-running operation should document the response type, if any.

Includes only one of the fields `error`, `response`.

The operation result.
If `done == false` and there was no failure detected, neither `error` nor `response` is set.
If `done == false` and there was a failure detected, `error` is set.
If `done == true`, exactly one of `error` or `response` is set. ||
|#