---
metadata:
  - name: generator
    content: Diplodoc Platform v5.70.0
alternate:
  - https://yandex.ru/dev/api360/doc/ru/sso/put-sso.md
  - href: https://yandex.ru/dev/api360/doc/ru/sso/put-sso.md
    type: text/markdown
    title: Markdown version
  - href: https://yandex.ru/dev/api360/doc/ru/llms.txt?revision=r22091678
    rel: describedby
sourcePath: docs/dev/api360/concepts/gw/sso/put-sso.md
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.ru/dev/api360/doc/ru/llms.txt?revision=r22091678

<!-- source: ru/openapi/v1directoryorganizationsorg_idsettingssso-put.md -->
<div class="openapi">

# Сохранение настроек SSO организации

<!-- markdownlint-disable-file -->

Создает или обновляет настройки SSO организации. Для создания и обновления нужны подтвержденный основной домен и доступность SSO — проверьте их с помощью запроса «Проверить доступность SSO организации».

Если SSO настроен сразу для нескольких организаций, при обновлении общей конфигурации изменения затрагивают все связанные с ней организации.

Требуется разрешение `directory:write_organization` — редактирование организации.

Отправить запрос может администратор организации.


## Request

<div class="openapi__requests">

<div class="openapi__request__wrapper" style="--method: var(--dc-openapi-methods-put);margin-bottom: 12px">

<div class="openapi__request">

PUT {.openapi__method}
```text translate=no
https://cloud-api.yandex.net/v1/directory/organizations/{org_id}/settings/sso
```

</div>

</div>

</div>

### Path parameters

#|
|| **Name** | **Description** ||
||

_org_id_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: integer

Идентификатор организации.
{.table-cell}
||
|#{.json-schema-properties}

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "entity_id": "example",
  "single_sign_on_service_url": "example",
  "certs": [
    "example"
  ],
  "client_id": "example",
  "is_department_sync_enabled": true
}
```

{% endcut %}

#|
|| **Name** | **Description** ||
||

_certs_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string[]

Публичные сертификаты поставщика удостоверений. Используются первые два сертификата — новый и старый.

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
[
  "example"
]
```

{% endcut %}
{.table-cell}
||
||

_entity_id_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

Идентификатор конфигурации поставщика удостоверений (IdP).

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_single_sign_on_service_url_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

URL сервиса единого входа поставщика удостоверений.

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_client_id_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

Идентификатор OAuth-клиента. Если поле не передать, значение `client_id` сбросится, а provisioning (автоматическое создание учетных записей) отключится. Явный `null` и пустая строка не принимаются.

_Min length:_{.json-schema-reset .json-schema-assertion} `1`

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_is_department_sync_enabled_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: boolean

Синхронизация подразделений. При обновлении, если поле не передать, сохранится текущее значение; при создании значение по умолчанию — `false`.
{.table-cell}
||
|#{.json-schema-properties}

</div>

## Responses

<div class="openapi__response__code__200">

## 200 OK

Настройки созданы или обновлены. Ответ имеет тот же формат, что и GET настроек SSO:
entity_id (строка) — идентификатор конфигурации поставщика удостоверений (IdP);
single_sign_on_service_url (строка) — URL сервиса единого входа поставщика удостоверений;
client_id (строка) — идентификатор OAuth-клиента, пустая строка при отсутствии;
certs (массив строк) — публичные сертификаты поставщика удостоверений: новый и старый;
is_enabled и is_department_sync_enabled — boolean.


</div>

<div class="openapi__response__code__403">

## 403 Forbidden

Доступ к ресурсу запрещен. У пользователя или приложения недостаточно прав.

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "error": "forbidden",
  "description": "Forbidden",
  "message": "Forbidden",
  "details": {}
}
```

{% endcut %}

#|
|| **Name** | **Description** ||
||

_description_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

Техническое описание ошибки.

_Example:_{.json-schema-reset .json-schema-example} `Forbidden`
{.table-cell}
||
||

_error_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

Код ошибки

_Example:_{.json-schema-reset .json-schema-example} `forbidden`
{.table-cell}
||
||

_message_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

Сообщение об ошибке.

_Example:_{.json-schema-reset .json-schema-example} `Forbidden`
{.table-cell}
||
||

_details_{.json-schema-reset .json-schema-property}
{.table-cell}|
{% cut "**Type**: object" %}

#|
|#{.json-schema-properties}

{% endcut %}

Дополнительные детали ошибки

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{}
```

{% endcut %}
{.table-cell}
||
|#{.json-schema-properties}

</div>

</div>

<div class="openapi__response__code__404">

## 404 Not Found

Запрашиваемый ресурс не найден.

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "error": "not_found",
  "description": "Not found",
  "message": "Not found",
  "details": {}
}
```

{% endcut %}

#|
|| **Name** | **Description** ||
||

_description_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

Техническое описание ошибки.

_Example:_{.json-schema-reset .json-schema-example} `Not found`
{.table-cell}
||
||

_error_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

Код ошибки

_Example:_{.json-schema-reset .json-schema-example} `not_found`
{.table-cell}
||
||

_message_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

Сообщение об ошибке.

_Example:_{.json-schema-reset .json-schema-example} `Not found`
{.table-cell}
||
||

_details_{.json-schema-reset .json-schema-property}
{.table-cell}|
{% cut "**Type**: object" %}

#|
|#{.json-schema-properties}

{% endcut %}

Дополнительные детали ошибки

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{}
```

{% endcut %}
{.table-cell}
||
|#{.json-schema-properties}

</div>

</div>

<div class="openapi__response__code__409">

## 409 Conflict

SSO configuration exists with different settings

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "error": "config_exists",
  "description": "SSO configuration exists with different settings",
  "message": "SSO configuration exists with different settings",
  "details": {}
}
```

{% endcut %}

#|
|| **Name** | **Description** ||
||

_description_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

Техническое описание ошибки.

_Example:_{.json-schema-reset .json-schema-example} `SSO configuration exists with different settings`
{.table-cell}
||
||

_error_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

Код ошибки

_Example:_{.json-schema-reset .json-schema-example} `config_exists`
{.table-cell}
||
||

_message_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

Сообщение об ошибке.

_Example:_{.json-schema-reset .json-schema-example} `SSO configuration exists with different settings`
{.table-cell}
||
||

_details_{.json-schema-reset .json-schema-property}
{.table-cell}|
{% cut "**Type**: object" %}

#|
|#{.json-schema-properties}

{% endcut %}

Дополнительные детали ошибки

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{}
```

{% endcut %}
{.table-cell}
||
|#{.json-schema-properties}

</div>

</div>

<div class="openapi__response__code__422">

## 422 Unprocessable Entity

Возможные ошибки:

- Feature unavailable
- Invalid data

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "error": "feature_unavailable",
  "description": "Feature unavailable",
  "message": "Feature unavailable",
  "details": {}
}
```

{% endcut %}

#|
|| **Name** | **Description** ||
||

_description_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

Техническое описание ошибки.

_Example:_{.json-schema-reset .json-schema-example} `Feature unavailable`
{.table-cell}
||
||

_error_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

Код ошибки

_Example:_{.json-schema-reset .json-schema-example} `feature_unavailable`
{.table-cell}
||
||

_message_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

Сообщение об ошибке.

_Example:_{.json-schema-reset .json-schema-example} `Feature unavailable`
{.table-cell}
||
||

_details_{.json-schema-reset .json-schema-property}
{.table-cell}|
{% cut "**Type**: object" %}

#|
|#{.json-schema-properties}

{% endcut %}

Дополнительные детали ошибки

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{}
```

{% endcut %}
{.table-cell}
||
|#{.json-schema-properties}

</div>

</div>

</div>
<!-- endsource: ru/openapi/v1directoryorganizationsorg_idsettingssso-put.md -->


[*Deprecated]: No longer supported, please use an alternative and newer version.