---
metadata:
  - name: generator
    content: Diplodoc Platform v5.50.6
alternate:
  - https://appmetrica.yandex.com/docs/en/mobile-api/management/applications/access/edit.md
  - https://appmetrica.yandex.com/docs/ru/mobile-api/management/applications/access/edit.md
---
> **Documentation Index:** Fetch the complete configuration index at https://appmetrica.yandex.com/docs/en/llms.txt

# Editing access

Edits previously granted access permissions.

## Request format {#request-format}

```
PUT https://api.appmetrica.yandex.com/management/v1/application/{id}/grant
```
#|
|| `id` | App ID ||
|#

### Request body {#request-body}

```json translate=no
{
  "grant": {
    "user_login": "string",
    "perm": "string",
    "partners": [ int, int ],
    "event_labels": ["string", "string"]
  }
}
```
#|
|| `user_login` | Yandex email address (login) of the user who is granted access. ||
|| `perm` | Access level.

Possible values:

- `view`: Read only.
- `edit`: Read/Edit.
- `agency_view`: Agency read only.
- `agency_edit`: Agency read/edit.

To learn more about access levels, see [Managing access](https://appmetrica.yandex.com/docs/en/common/access.md).
||
|| `partners` | IDs of advertising partners that are granted access. To get a list of all partners, use the [Partner list](https://appmetrica.yandex.com/docs/en/mobile-api/management/applications/access/list-partners.md) method.

This is a required field when granting `agency_view` and `agency_edit` permissions.

{% note info %}

If you're granting agency-level access, be sure to specify at least one advertising partner ID.

{% endnote %}

||
|| `event_labels` | Target events for which agencies can view statistics.

This is an additional field when granting `agency_view` and `agency_edit` permissions.

||
|#

## Response format {#response-body}

```json translate=no
{
  "grant" : {
    "user_login" : "string",
    "user_uid" : int,
    "perm" : "string",
    "comment" : "string",
    "partners" : [ int, int ],
    "event_labels" : [ "string", "string" ]
  }
```
#|
|| `user_login` | Yandex email address (login) of the user who is granted access. ||
|| `uid` | ID of the user who is granted access. ||
|| `perm` | Access level.

Possible values:

- `view`: Read only.
- `edit`: Read/Edit.
- `agency_view`: Agency read only.
- `agency_edit`: Agency read/edit.

To learn more about access levels, see [Managing app access](https://appmetrica.yandex.com/docs/en/common/access.md). ||
|| `comment` | A comment. ||
|| `partners` | IDs of advertising partners that are granted access. To get a list of all partners, use the [Partner list](https://appmetrica.yandex.com/docs/en/mobile-api/management/applications/access/list-partners.md) method. ||
|| `event_labels` | Target events for which agencies can view statistics. ||
|#

## Example {#example}

{% list tabs %}

- cURL

   ```bash translate=no
   curl -X PUT \
     'https://api.appmetrica.yandex.com/management/v1/application/1111/grant' \
     -H 'Content-Type: application/json' \
     -H 'Authorization: OAuth <your_token>' \
     -d '{
     "grant": {
       "user_login": "user_login",
       "perm": "agency_view",
       "partners": [ 145375, 148711 ],
       "event_labels": ["Checkout", "Proceed to cart"]
     }
   }'
   ```

   where `<your_token>` is an OAuth token that can be obtained using [instructions](https://appmetrica.yandex.com/docs/en/mobile-api/intro/authorization.md#get-oauth-token).

- HTTP

   ```http translate=no
   PUT /management/v1/application/1111/grant HTTP/1.1
   Host: api.appmetrica.yandex.com
   Content-Type: application/json
   Authorization: OAuth <your_token>

   {
     "grant": {
       "user_login": "user_login",
       "perm": "agency_view",
       "partners": [ 145375, 148711 ],
       "event_labels": ["Checkout", "Proceed to cart"]
     }
   }
   ```

   where `<your_token>` is an OAuth token that can be obtained using [instructions](https://appmetrica.yandex.com/docs/en/mobile-api/intro/authorization.md#get-oauth-token).

{% endlist %}

<!-- source: en/_includes/feedback-button-4.md -->
If you didn't find the answer you were looking for, you can use the feedback form to submit your question. Please describe the problem in as much detail as possible. Attach a screenshot if possible.

<a href="../../../../troubleshooting/feedback-new">
  <span class="button">Contact support</span>
</a>

<a href="../../../../troubleshooting/feedback-docs">
  <span class="button">Suggest an improvement for documentation</span>
</a>
<!-- endsource: en/_includes/feedback-button-4.md -->
