---
metadata:
  - name: generator
    content: Diplodoc Platform v5.52.0
alternate:
  - https://yandex.ru/dev/api360/doc/ru/ref/AuditLogService/AuditLogService_Mail.md
  - href: ru/ref/AuditLogService/AuditLogService_Mail.md
    type: text/markdown
    title: Markdown version
  - href: ../../llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.ru/dev/api360/doc/ru/llms.txt

<div class="openapi">

# Получить аудит-лог Почты

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

Возвращает список событий в аудит-логе Почты организации.

{% note info %}

Чтобы выполнить запрос, приложению требуется разрешение на чтение событий аудит-лога Почты.
Убедитесь, что вы включили его при [настройке приложения](https://yandex.ru/dev/api360/doc/ru/access.md) на OAuth-сервере Яндекса.

{% endnote %}

## Request

<div class="openapi__requests">

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

<div class="openapi__request">

GET {.openapi__method}
```text translate=no
https://api360.yandex.net/security/v1/org/{orgId}/audit_log/mail
```

</div>

</div>

</div>

### Path parameters

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

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

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

### Query parameters

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

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

Количество событий на странице. Максимальное значение — `100`.
{.table-cell}
||
||

_afterDate_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string&lt;date-time&gt;

Дата и время начала периода выборки в формате ISO 8601, например `2022-12-31T23:59:59+03:00` или `2022-12-31T12:00:00Z`.

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

_beforeDate_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string&lt;date-time&gt;

Дата и время окончания периода выборки в формате ISO 8601, например `2022-12-31T23:59:59+03:00` или `2022-12-31T12:00:00Z`. Значение по умолчанию — текущее время.

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

_excludeUids_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string&lt;uint64&gt;[]

Идентификаторы пользователей, действия которых должны быть исключены из списка событий.

Чтобы указать несколько человек, задайте их идентификаторы отдельными параметрами, например `excludeUids={uid1}&excludeUids={uid2}`.

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

_includeUids_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string&lt;uint64&gt;[]

Идентификаторы пользователей, действия которых должны быть включены в список событий.

Чтобы указать несколько человек, задайте их идентификаторы отдельными параметрами, например `includeUids={uid1}&includeUids={uid2}`.

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

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

Токен постраничной навигации.

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

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

Типы событий, которые должны быть включены в список.

Возможные значение приведены в [MailEventMailEventType](#maileventmaileventtype). Чтобы указать несколько типов, задайте их отдельными параметрами, например `types={type1}&types={type2}`.
Если параметр не указан, то включаются все события.

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

## Responses

<div class="openapi__response__code__200">

## 200 OK

Запрос успешно выполнен.

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "events": [
    {
      "eventType": "mailbox_send",
      "date": "2025-01-01T00:00:00Z",
      "orgId": 0,
      "userUid": "example",
      "userLogin": "example",
      "userName": "example",
      "requestId": "example",
      "uniqId": "example",
      "source": "example",
      "actorUid": "example",
      "clientIp": "example",
      "mid": "example",
      "destMid": "example",
      "folderName": "example",
      "folderType": "example",
      "labels": [
        "example"
      ],
      "msgId": "example",
      "subject": "example",
      "from": "example",
      "to": "example",
      "cc": "example",
      "bcc": "example"
    }
  ],
  "nextPageToken": "example"
}
```

{% endcut %}

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

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

Список событий.

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

```json translate=no
[
  {
    "eventType": "mailbox_send",
    "date": "2025-01-01T00:00:00Z",
    "orgId": 0,
    "userUid": "example",
    "userLogin": "example",
    "userName": "example",
    "requestId": "example",
    "uniqId": "example",
    "source": "example",
    "actorUid": "example",
    "clientIp": "example",
    "mid": "example",
    "destMid": "example",
    "folderName": "example",
    "folderType": "example",
    "labels": [
      "example"
    ],
    "msgId": "example",
    "subject": "example",
    "from": "example",
    "to": "example",
    "cc": "example",
    "bcc": "example"
  }
]
```

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

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

Токен для получения следующей страницы постраничной навигации.

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

</div>

<div class="openapi-entity">

### MailEventMailEventType {#entity-MailEventMailEventType}

Тип события.
Возможные значения:
- `mailbox_send` — отправка письма;
- `message_receive` — прием письма;
- `message_seen` — отметка письма прочитанным;
- `message_unseen` — отметка письма непрочитанным;
- `message_forward` — пересылка письма;
- `message_purge` — удаление письма;
- `message_trash` — перемещение письма в папку «Удаленные»;
- `message_spam` — перемещение письма в папку «Спам»;
- `message_unspam` — перемещение письма из папки «Спам»;
- `message_move` — перемещение письма между папками;
- `message_copy` — копирование письма;
- `message_answer` — ответ на письмо.

**Type**: string

_Default:_{.json-schema-reset .json-schema-value} `mailbox_send`

_Enum:_{.json-schema-reset .json-schema-value} `mailbox_send`, `message_receive`, `message_seen`, `message_unseen`, `message_forward`, `message_purge`, `message_trash`, `message_spam`, `message_unspam`, `message_move`, `message_copy`, `message_answer`

</div>

<div class="openapi-entity">

### v1MailEvent {#entity-v1MailEvent}

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

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

IP клиента.

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

_date_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string&lt;date-time&gt;

Дата и время события по UTC в формате ISO 8601: `YYYY-MM-DDThh:mm:ssZ`.

_Example:_{.json-schema-reset .json-schema-example} `2025-01-01T00:00:00Z`
{.table-cell}
||
||

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

Тип события.
Возможные значения:
- `mailbox_send` — отправка письма;
- `message_receive` — прием письма;
- `message_seen` — отметка письма прочитанным;
- `message_unseen` — отметка письма непрочитанным;
- `message_forward` — пересылка письма;
- `message_purge` — удаление письма;
- `message_trash` — перемещение письма в папку «Удаленные»;
- `message_spam` — перемещение письма в папку «Спам»;
- `message_unspam` — перемещение письма из папки «Спам»;
- `message_move` — перемещение письма между папками;
- `message_copy` — копирование письма;
- `message_answer` — ответ на письмо.

_Default:_{.json-schema-reset .json-schema-value} `mailbox_send`

_Enum:_{.json-schema-reset .json-schema-value} `mailbox_send`, `message_receive`, `message_seen`, `message_unseen`, `message_forward`, `message_purge`, `message_trash`, `message_spam`, `message_unspam`, `message_move`, `message_copy`, `message_answer`
{.table-cell}
||
||

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

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

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

Идентификатор запроса в системе. Может быть неуникальным, например при групповых операциях.

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

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

Источник события.

Возможные значения:
- `server` — событие без определенного типа клиента;
- `imap` — событие от imap;
- `pop3` — событие от pop3;
- `native` — событие от нативных клиентов (web/mobile).

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

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

Уникальный идентификатор события.

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

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

Логин пользователя.

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

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

Имя пользователя.

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

_userUid_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string&lt;uint64&gt;

Идентификатор пользователя.

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

_actorUid_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string&lt;uint64&gt;

Исполнитель операции от имени ящика.

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

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

Адресат из поля «Скрытая копия».

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

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

Адресат из поля «Копия».

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

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

Идентификатор нового письма при копировании.

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

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

Название личной (созданной пользователем) папки.

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

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

Тип папки.

Возможные значения:
- `inbox` — «Входящие»;
- `sent` — «Отправленные»;
- `trash` — «Корзина»;
- `spam` — «Спам»;
- `drafts` — «Черновики»;
- `outbox` — «Исходящие»;
- `archive` — «Архив»;
- `template_` — «Шаблоны»;
- `discount` — «Скрытые рассылки»;
- `restored` — «Восстановленные»;
- `reply_later` — «Напомнить позже»;
- `user` — папка не является системной (стандартной), а создана пользователем.

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

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

Отправитель (значение поля «От кого»).

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

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

Системные метки письма.

Массив из возможных значений:
- `seen` — письмо просмотренно;
- `attached` — письмо с вложением;
- `undo` — письмо отправлено с возможностью отмены отправки;
- `delayed` — письмо отправлено с использованием отложенной отправки.

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

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

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

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

Идентификатор письма.

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

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

Заголовок  `Message-ID`  письма.

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

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

Тема письма.

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

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

Получатели (значение поля «Кому»).

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

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

```json translate=no
{
  "eventType": "mailbox_send",
  "date": "2025-01-01T00:00:00Z",
  "orgId": 0,
  "userUid": "example",
  "userLogin": "example",
  "userName": "example",
  "requestId": "example",
  "uniqId": "example",
  "source": "example",
  "actorUid": "example",
  "clientIp": "example",
  "mid": "example",
  "destMid": "example",
  "folderName": "example",
  "folderType": "example",
  "labels": [
    "example"
  ],
  "msgId": "example",
  "subject": "example",
  "from": "example",
  "to": "example",
  "cc": "example",
  "bcc": "example"
}
```

{% endcut %}

</div>

</div>

<div class="openapi__response__code__400">

## 400 Bad Request

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

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "code": 0,
  "message": "example",
  "details": [
    {
      "@type": "example"
    }
  ]
}
```

{% endcut %}

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

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

Код ошибки.
{.table-cell}
||
||

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

Дополнительные сведения об ошибке.

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

```json translate=no
[
  {
    "@type": "example"
  }
]
```

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

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

Описание ошибки.

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

</div>

<div class="openapi-entity">

### protobufAny {#entity-protobufAny}

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

_@type_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

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

_[additional]_{.json-schema-reset .json-schema-additional-property}
{.table-cell}|
**Type**: unknown

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

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

```json translate=no
{
  "@type": "example"
}
```

{% endcut %}

</div>

</div>

<div class="openapi__response__code__401">

## 401 Unauthorized

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

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "code": 0,
  "message": "example",
  "details": [
    {
      "@type": "example"
    }
  ]
}
```

{% endcut %}

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

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

Код ошибки.
{.table-cell}
||
||

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

Дополнительные сведения об ошибке.

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

```json translate=no
[
  {
    "@type": "example"
  }
]
```

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

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

Описание ошибки.

_Example:_{.json-schema-reset .json-schema-example} `example`
{.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
{
  "code": 0,
  "message": "example",
  "details": [
    {
      "@type": "example"
    }
  ]
}
```

{% endcut %}

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

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

Код ошибки.
{.table-cell}
||
||

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

Дополнительные сведения об ошибке.

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

```json translate=no
[
  {
    "@type": "example"
  }
]
```

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

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

Описание ошибки.

_Example:_{.json-schema-reset .json-schema-example} `example`
{.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
{
  "code": 0,
  "message": "example",
  "details": [
    {
      "@type": "example"
    }
  ]
}
```

{% endcut %}

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

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

Код ошибки.
{.table-cell}
||
||

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

Дополнительные сведения об ошибке.

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

```json translate=no
[
  {
    "@type": "example"
  }
]
```

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

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

Описание ошибки.

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

</div>

</div>

<div class="openapi__response__code__500">

## 500 Internal Server Error

Внутренняя ошибка сервиса. Попробуйте повторно отправить запрос через некоторое время.

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "code": 0,
  "message": "example",
  "details": [
    {
      "@type": "example"
    }
  ]
}
```

{% endcut %}

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

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

Код ошибки.
{.table-cell}
||
||

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

Дополнительные сведения об ошибке.

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

```json translate=no
[
  {
    "@type": "example"
  }
]
```

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

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

Описание ошибки.

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

</div>

</div>

</div>

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