---
metadata:
  - name: generator
    content: Diplodoc Platform v5.70.0
alternate:
  - https://yandex.ru/dev/api360/doc/ru/federations/patch-organization-federation.md
  - href: https://yandex.ru/dev/api360/doc/ru/federations/patch-organization-federation.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/federations/patch-organization-federation.md
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.ru/dev/api360/doc/ru/llms.txt?revision=r22091678

<!-- source: ru/openapi/v1directoryorganizationsorganization_idfederationsfederation_id-patch.md -->
<div class="openapi">

# Изменение участия организации в федерации

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

Позволяет организации принять или отклонить приглашение в федерацию, выйти из федерации или скрыть своих сотрудников от участников федерации. В теле запроса передайте `status` или `blacklist_scope`. В режиме только для чтения доступно изменение только скрытия сотрудников.

Если из федерации выходит последний принятый участник, федерация удаляется автоматически.

Требуется разрешение `directory:write_federations` — управление федерациями.

Отправить запрос может администратор организации или сотрудник с ролью **Менеджер федераций**.


## Request

<div class="openapi__requests">

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

<div class="openapi__request">

PATCH {.openapi__method}
```text translate=no
https://cloud-api.yandex.net/v1/directory/organizations/{organization_id}/federations/{federation_id}
```

</div>

</div>

</div>

### Path parameters

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

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

Идентификатор федерации (UUID).

_Pattern:_{.json-schema-reset .json-schema-assertion} `^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$`

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

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

Идентификатор организации-участника.

_Min value:_{.json-schema-reset .json-schema-assertion} `1`
{.table-cell}
||
|#{.json-schema-properties}

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "status": "example"
}
```

{% endcut %}

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

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

Какие сотрудники организации скрыты от участников федерации:
- `none` — сотрудники не скрыты;
- `group` — скрыта группа сотрудников;
- `organization` — скрыты все сотрудники организации.

Поле можно изменить отдельно от статуса.


_Pattern:_{.json-schema-reset .json-schema-assertion} `^(none&#124;group&#124;organization)$`

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

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

Действие организации — `accepted` (принять приглашение), `rejected` (отклонить приглашение) или `terminated` (выйти из федерации).

_Pattern:_{.json-schema-reset .json-schema-assertion} `^(accepted&#124;rejected&#124;terminated)$`

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

{% cut "**Any of 2 types**" %}{.json-schema-combinators data-marker=or}

- {% cut "**Type**: object" %}

  #|
  ||

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

  Действие организации — `accepted` (принять приглашение), `rejected` (отклонить приглашение) или `terminated` (выйти из федерации).

  _Pattern:_{.json-schema-reset .json-schema-assertion} `^(accepted&#124;rejected&#124;terminated)$`

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

  {% endcut %}

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

  ```json translate=no
  {
    "status": "example"
  }
  ```

  {% endcut %}

- {% cut "**Type**: object" %}

  #|
  ||

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

  Какие сотрудники организации скрыты от участников федерации:
  - `none` — сотрудники не скрыты;
  - `group` — скрыта группа сотрудников;
  - `organization` — скрыты все сотрудники организации.

  Поле можно изменить отдельно от статуса.


  _Pattern:_{.json-schema-reset .json-schema-assertion} `^(none&#124;group&#124;organization)$`

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

  {% endcut %}

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

  ```json translate=no
  {
    "blacklist_scope": "example"
  }
  ```

  {% endcut %}

{% endcut %}

</div>

## Responses

<div class="openapi__response__code__200">

## 200 OK

Участие изменено. Ответ содержит публичные поля участия и скрытия сотрудников.

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "membership_id": "example",
  "federation_id": "example",
  "member_organization_id": 0,
  "initiator_organization_id": 0,
  "status": "requested",
  "created_at": "example",
  "updated_at": "example",
  "blacklist_scope": "none",
  "blacklist_group_id": 0
}
```

{% endcut %}

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

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

Дата и время создания участия.

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

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

Идентификатор федерации (UUID).

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

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

Идентификатор организации-инициатора приглашения.
{.table-cell}
||
||

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

Идентификатор организации-участника.
{.table-cell}
||
||

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

Идентификатор участия (UUID).

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

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

Статус участия организации в федерации.

_Enum:_{.json-schema-reset .json-schema-value} `requested`, `accepted`, `rejected`, `terminated`
{.table-cell}
||
||

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

Дата и время последнего изменения участия.

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

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

Идентификатор группы скрытых сотрудников. Присутствует в ответе, если скрыта группа сотрудников (`group`).
{.table-cell}
||
||

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

Какие сотрудники организации скрыты от участников федерации:
- `none` — сотрудники не скрыты;
- `group` — скрыта группа сотрудников;
- `organization` — скрыты все сотрудники организации.


_Enum:_{.json-schema-reset .json-schema-value} `none`, `group`, `organization`
{.table-cell}
||
|#{.json-schema-properties}

</div>

</div>

<div class="openapi__response__code__400">

## 400 Bad Request

Некорректный запрос.

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "error": "bad_request",
  "description": "Bad request",
  "message": "Bad request",
  "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} `Bad request`
{.table-cell}
||
||

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

Код ошибки

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

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

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

_Example:_{.json-schema-reset .json-schema-example} `Bad request`
{.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__401">

## 401 Unauthorized

Пользователь не авторизован.

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "error": "unauthorized",
  "description": "Unauthorized",
  "message": "Unauthorized",
  "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} `Unauthorized`
{.table-cell}
||
||

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

Код ошибки

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

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

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

_Example:_{.json-schema-reset .json-schema-example} `Unauthorized`
{.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__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

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

- Federation membership already exists
- Federation membership already exists

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "error": "conflict",
  "description": "Conflict",
  "message": "Conflict",
  "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} `Conflict`
{.table-cell}
||
||

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

Код ошибки

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

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

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

_Example:_{.json-schema-reset .json-schema-example} `Conflict`
{.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/v1directoryorganizationsorganization_idfederationsfederation_id-patch.md -->


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