Granting access

Grants access to statistics to a specific user or agency.

Request format

POST https://api.appmetrica.yandex.ru/management/v1/application/{id}/grants

id

App ID

Request body

{
  "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 app access.

partners

IDs of advertising partners that are granted access. To get a list of all partners, use the Partner list method.

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

Note

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

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

{
  "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.

comment

A comment.

partners

IDs of advertising partners that are granted access. To get a list of all partners, use the Partner list method.

event_labels

Target events for which agencies can view statistics.

Example

curl -X POST \
  'https://api.appmetrica.yandex.ru/management/v1/application/1111/grants' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: OAuth 05dd3dd84ff948fdae2bc4fb91f13e22bb1f289ceef0037' \
  -d '{
  "grant": {
    "user_login": "user_login",
    "perm": "agency_view",
    "partners": [ 145375 ],
    "event_labels": ["Checkout", "Proceed to cart"]
  }
}'
POST /management/v1/application/1111/grants HTTP/1.1
Host: api.appmetrica.yandex.ru
Content-Type: application/json
Authorization: OAuth 05dd3dd84ff948fdae2bc4fb91f13e22bb1f289ceef0037

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

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.

Contact support