---
metadata:
  - name: generator
    content: Diplodoc Platform v5.52.0
alternate:
  - https://yandex.com/dev/metrika/en/management/openapi/grant/addPublicGrant.md
  - https://yandex.com/dev/metrika/ru/management/openapi/grant/addPublicGrant.md
  - href: en/management/openapi/grant/addPublicGrant.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.com/dev/metrika/en/llms.txt

<!-- source: en/management-src/Managing-access/addPublicGrant.md -->
<div class="openapi">

# Create public permissions

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

Creates public viewing permissions for statistics.

## 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}/public_grant
```

</div>

</div>

</div>

### Path parameters

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

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

ID of the tag for which you want to create permissions.
{.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
{
  "grant": {
    "user_login": "example",
    "perm": "example",
    "created_at": "2025-01-01T00:00:00Z",
    "comment": "example",
    "partner_data_access": true
  }
}
```

{% endcut %}

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

_grant_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
{% cut "**One of 2 types**" %}{.json-schema-combinators data-marker=or}

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

  List of structures with information on access rights to the tag.

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

  ```json translate=no
  {
    "user_login": "example",
    "perm": "example",
    "created_at": "2025-01-01T00:00:00Z",
    "comment": "example",
    "partner_data_access": true
  }
  ```

  {% endcut %}

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

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

  ```json translate=no
  {
    "user_login": "example",
    "perm": "example",
    "created_at": "2025-01-01T00:00:00Z",
    "comment": "example",
    "partner_data_access": true,
    "access_filters": [
      {
        "id": 0,
        "name": "example"
      }
    ]
  }
  ```

  {% endcut %}

{% endcut %}

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

```json translate=no
{
  "user_login": "example",
  "perm": "example",
  "created_at": "2025-01-01T00:00:00Z",
  "comment": "example",
  "partner_data_access": true
}
```

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

</div>

<div class="openapi-entity">

### CounterGrantE {#entity-CounterGrantE}

List of structures with information on access rights to the tag.

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

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

Access level:
- `public_stat`: Public access to statistics.
- `view`: Read only.
- `edit`: Full access.
- `analyst`: Analyst.
- `analyst_access_filter`: Data analyst with filter-based access.


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

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

Custom comment. The maximum number of characters is 255.

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

_Max length:_{.json-schema-reset .json-schema-assertion} `255`

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

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

Date when the permission was granted in YYYY-MM-DD'T'hh:mm:ssZ format.

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

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

Access to the Monetization report group. The user can view reports and add dimensions and metrics from the Monetization group to other reports.
Users with edit permissions already have access to the reports within the "Monetization" group.
Possible values:
- `true`: Access granted.
- `false`: Access denied.
{.table-cell}
||
||

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

Login of a user with tag management rights. This parameter contains an empty string if tag statistics are in public access (`perm = public_stat`).

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

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

```json translate=no
{
  "user_login": "example",
  "perm": "example",
  "created_at": "2025-01-01T00:00:00Z",
  "comment": "example",
  "partner_data_access": true
}
```

{% endcut %}

</div>

<div class="openapi-entity">

### AccessFiltersShortE {#entity-AccessFiltersShortE}

List of access filters granted to the user.

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

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

Access filter ID.
{.table-cell}
||
||

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

Access filter name.

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

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

```json translate=no
{
  "id": 0,
  "name": "example"
}
```

{% endcut %}

</div>

<div class="openapi-entity">

### AccessFiltersGrantE {#entity-AccessFiltersGrantE}

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

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

  List of structures with information on access rights to the tag.

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

  ```json translate=no
  {
    "user_login": "example",
    "perm": "example",
    "created_at": "2025-01-01T00:00:00Z",
    "comment": "example",
    "partner_data_access": true
  }
  ```

  {% endcut %}

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

  #|
  ||

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

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

  _Max items:_{.json-schema-reset .json-schema-assertion} `1`

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

  ```json translate=no
  [
    {
      "id": 0,
      "name": "example"
    }
  ]
  ```

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

  {% endcut %}

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

  ```json translate=no
  {
    "access_filters": [
      {
        "id": 0,
        "name": "example"
      }
    ]
  }
  ```

  {% endcut %}

{% endcut %}

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

```json translate=no
{
  "user_login": "example",
  "perm": "example",
  "created_at": "2025-01-01T00:00:00Z",
  "comment": "example",
  "partner_data_access": true,
  "access_filters": [
    {
      "id": 0,
      "name": "example"
    }
  ]
}
```

{% endcut %}

</div>

</div>

</div>
<!-- endsource: en/management-src/Managing-access/addPublicGrant.md -->

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