---
metadata:
  - name: generator
    content: Diplodoc Platform v5.48.2
alternate:
  - https://yandex.com.tr/dev/metrika/en/logs/openapi/createLogRequest.md
  - https://yandex.com.tr/dev/metrika/ru/logs/openapi/createLogRequest.md
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com.tr/dev/metrika/en/llms.txt

<div class="openapi">

# Creating a log request

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

Creates a log request.

{% note info %}

The Logs API doesn't support filtering at the request level.

{% 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://api-metrika.yandex.net/management/v1/counter/{counterId}/logrequests
```

</div>

</div>

</div>

### Path parameters

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

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

Tag ID.
{.table-cell}
||
|#{.json-schema-properties}

### Query parameters

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

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

First day.

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

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

Last day (can't be the current day).

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

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

List of fields separated by commas.

_Example:_{.json-schema-reset .json-schema-example} `ym:pv:dateTime,ym:pv:referer`
{.table-cell}
||
||

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

Log source.
Log source. Possible values:
- `hits` — Events.
- `visits` — Sessions.


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

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

Attribution model. Possible values:

- `FIRST`: First click.
- `LAST`: Last click.
- `LASTSIGN`: Last non-direct click.
- `LAST_YANDEX_DIRECT_CLICK`: Last click from Yandex Direct.
- `CROSS_DEVICE_LAST_SIGNIFICANT`: Last non-direct click (cross-device), including sessions from all the user's devices.
- `CROSS_DEVICE_FIRST`: First non-direct click (cross-device), including sessions from all the user's devices.
- `CROSS_DEVICE_LAST_YANDEX_DIRECT_CLICK`: Last click from Yandex Direct (cross-device), including sessions from all the user's devices.
- `CROSS_DEVICE_LAST`: Last click (cross-device), including sessions from all the user's devices.
- `AUTOMATIC`: Automatic attribution.

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

## Responses

<div class="openapi__response__code__200">

## 200 OK

OK

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "log_request": {
    "request_id": 0,
    "counter_id": 0,
    "source": [
      "example"
    ],
    "date1": "example",
    "date2": "example",
    "fields": [
      "example"
    ],
    "status": "example",
    "size": 0,
    "parts": [
      {
        "part_number": 0,
        "size": 0
      }
    ],
    "attribution": "example"
  }
}
```

{% endcut %}

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

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

Log request

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

```json translate=no
{
  "request_id": 0,
  "counter_id": 0,
  "source": [
    "example"
  ],
  "date1": "example",
  "date2": "example",
  "fields": [
    "example"
  ],
  "status": "example",
  "size": 0,
  "parts": [
    {
      "part_number": 0,
      "size": 0
    }
  ],
  "attribution": "example"
}
```

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

</div>

<div class="openapi-entity">

### LogRequestPart {#entity-LogRequestPart}

Part of the response

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

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

Part number.
{.table-cell}
||
||

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

Size in bytes.
{.table-cell}
||
|#{.json-schema-properties}

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

```json translate=no
{
  "part_number": 0,
  "size": 0
}
```

{% endcut %}

</div>

<div class="openapi-entity">

### LogRequest {#entity-LogRequest}

Log request

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

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

Attribution model. Possible values:
- `FIRST`: First click.
- `LAST`: Last click.
- LASTSIGN: Last non-direct click.
- `LAST_YANDEX_DIRECT_CLICK`: Last click from Yandex Direct.
- `CROSS_DEVICE_LAST_SIGNIFICANT`: Last non-direct click (cross-device), including sessions from all the user's devices.
- `CROSS_DEVICE_FIRST`: First non-direct click (cross-device), including sessions from all the user's devices.
- `CROSS_DEVICE_LAST_YANDEX_DIRECT_CLICK`: Last click from Yandex Direct (cross-device), including sessions from all the user's devices.
- `CROSS_DEVICE_LAST`: Last click (cross-device), including sessions from all the user's devices.
- `AUTOMATIC`: Automatic attribution.


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

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

Tag ID.
{.table-cell}
||
||

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

First day.

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

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

Last day.

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

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

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

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

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

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

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

```json translate=no
[
  {
    "part_number": 0,
    "size": 0
  }
]
```

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

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

Log request ID.
{.table-cell}
||
||

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

Size of logs in the request in bytes.
{.table-cell}
||
||

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

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

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

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

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

Request status:
- `created`: Created.
- `canceled`: Canceled.
- `processed`: Processed.
- `cleaned_by_user`: Cleared by the user.
- `cleaned_automatically_as_too_old`: Cleared automatically.
- `processing_failed`: Processing error.
- `awaiting_retry`: To be restarted.


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

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

```json translate=no
{
  "request_id": 0,
  "counter_id": 0,
  "source": [
    "example"
  ],
  "date1": "example",
  "date2": "example",
  "fields": [
    "example"
  ],
  "status": "example",
  "size": 0,
  "parts": [
    {
      "part_number": 0,
      "size": 0
    }
  ],
  "attribution": "example"
}
```

{% endcut %}

</div>

</div>

</div>

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