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

<!-- source: ru/openapi/admin/v1adminorgorg_idmail-listsmail_list_idupdate-permissions-post.md -->
<div class="openapi">

# Изменение списка разрешенных отправителей рассылок на группы и подразделения

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

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

Поддерживает три типа операций:
- `grant` — добавить новых отправителей;
- `revoke` — удалить существующих отправителей;
- `overwrite` — полностью заменить текущий список.

{% note info "" %}

Для выполнения запроса требуется одно из перечисленных прав: `ya360_admin:mail_read_mail_list_permissions` или `ya360_admin:mail_write_mail_list_permissions`.

{% endnote %}

## Request

<div class="openapi__requests">

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

<div class="openapi__request">

POST {.openapi__method}
```text translate=no
https://cloud-api.yandex.net/v1/admin/org/{org_id}/mail-lists/{mail_list_id}/update-permissions
```

</div>

</div>

</div>

### Path parameters

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

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

Идентификатор рассылки.

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

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

Идентификатор организации.

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

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "role_actions": [
    {
      "type": "grant",
      "roles": [
        "mail_list_sender"
      ],
      "subjects": [
        {
          "type": "user",
          "id": 1230000000000001,
          "org_id": 1234567
        }
      ]
    }
  ]
}
```

{% endcut %}

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

_role_actions_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: [RoleActions](#entity-RoleActions)

Массив операций с разрешениями RoleAction.

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

```json translate=no
[
  {
    "type": "grant",
    "roles": [
      "mail_list_sender"
    ],
    "subjects": [
      {
        "type": "user",
        "id": 1230000000000001,
        "org_id": 1234567
      }
    ]
  }
]
```

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

</div>

<div class="openapi-entity">

### A360subjectType {#entity-A360subjectType}

Информация о субъекте, имеющем разрешение.

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

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

Идентификатор субъекта. Для типа `anonymous` — всегда `null`.
{.table-cell}
||
||

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

Тип субъекта:

- `user` — пользователь;
- `shared_mailbox` — общий почтовый ящик;
- `group` — группа;
- `department` — подразделение;
- `organization` — вся организация;
- `anonymous` — любой пользователь.


_Enum:_{.json-schema-reset .json-schema-value} `organization`, `user`, `group`, `department`, `anonymous`, `shared_mailbox`
{.table-cell}
||
||

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

Идентификатор организации (`0` — если пользователь не относится ни к одной организации). Необязателен для `anonymous`.
{.table-cell}
||
|#{.json-schema-properties}

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

```json translate=no
{
  "type": "user",
  "id": 1230000000000001,
  "org_id": 1234567
}
```

{% endcut %}

</div>

<div class="openapi-entity">

### A360subjectArray {#entity-A360subjectArray}

Массив объектов Subject с информацией о субъектах, имеющих разрешение.

**Type**: [A360subjectType](#entity-A360subjectType)[]

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

```json translate=no
[
  {
    "type": "user",
    "id": 1230000000000001,
    "org_id": 1234567
  }
]
```

{% endcut %}

</div>

<div class="openapi-entity">

### RoleActionItem {#entity-RoleActionItem}

Массив операций с разрешениями RoleAction.

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

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

Всегда `["mail_list_sender"]`.

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

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

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

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

Тип операции:

- `grant` — добавить новых отправителей к существующему списку;
- `revoke` — удалить указанных отправителей из списка;
- `overwrite` — заменить текущий список для указанных типов субъектов.

{% note info "" %}

При выполнении операции `overwrite` нужно заново указать всех разрешенных отправителей выбранных типов — текущие списки отправителей для этих типов будут удалены.
Например, при выполнении `overwrite` для типа субъектов `group` (группа) будут удалены все существующие разрешения для групп и заново добавлены разрешения для тех групп, которые вы укажете в `permissions-list.json`. При этом списки других типов — например, пользователей — останутся без изменений после этой операции.

{% endnote %}


_Enum:_{.json-schema-reset .json-schema-value} `grant`, `revoke`, `overwrite`
{.table-cell}
||
||

_subjects_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: [A360subjectArray](#entity-A360subjectArray)

Массив объектов Subject с информацией о субъектах, имеющих разрешение.

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

```json translate=no
[
  {
    "type": "user",
    "id": 1230000000000001,
    "org_id": 1234567
  }
]
```

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

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

```json translate=no
{
  "type": "grant",
  "roles": [
    "mail_list_sender"
  ],
  "subjects": [
    {
      "type": "user",
      "id": 1230000000000001,
      "org_id": 1234567
    }
  ]
}
```

{% endcut %}

</div>

<div class="openapi-entity">

### RoleActions {#entity-RoleActions}

Массив операций с разрешениями RoleAction.

**Type**: [RoleActionItem](#entity-RoleActionItem)[]

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

```json translate=no
[
  {
    "type": "grant",
    "roles": [
      "mail_list_sender"
    ],
    "subjects": [
      {
        "type": "user",
        "id": 1230000000000001,
        "org_id": 1234567
      }
    ]
  }
]
```

{% endcut %}

</div>

## Responses

<div class="openapi__response__code__204">

## 204 No Content

Список разрешенных отправителей обновлен.

</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": "Неверный формат запроса",
  "message": "Неверный формат запроса",
  "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} `Неверный формат запроса`
{.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} `Неверный формат запроса`
{.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": "Доступ запрещен",
  "message": "Доступ запрещен",
  "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} `Доступ запрещен`
{.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} `Доступ запрещен`
{.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": "Один из переданных параметров не существует",
  "message": "Один из переданных параметров не существует",
  "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} `Один из переданных параметров не существует`
{.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} `Один из переданных параметров не существует`
{.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

Невозможно назначить права по какой-то причине (например, попытались назначить админом анонима или субъектов, принадлежащих разным организациям)

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "error": "conflict",
  "description": "Невозможно назначить права по какой-то причине (например, попытались назначить админом анонима или субъектов, принадлежащих разным организациям)",
  "message": "Невозможно назначить права по какой-то причине (например, попытались назначить админом анонима или субъектов, принадлежащих разным организациям)",
  "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} `Невозможно назначить права по какой-то причине (например, попытались назначить админом анонима или субъектов, принадлежащих разным организациям)`
{.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} `Невозможно назначить права по какой-то причине (например, попытались назначить админом анонима или субъектов, принадлежащих разным организациям)`
{.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/admin/v1adminorgorg_idmail-listsmail_list_idupdate-permissions-post.md -->


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