Granting a user or group access to a page

Grants personal access to the page to the specified user or group.

You can grant one of the following roles:

  • reader: Read.
  • editor: Edit.
  • extra_editor: Extended editing.
  • author: Author (full access).

The available roles depend on the organization's access mode.
Legacy mode supports editor and author. The author role can be assigned only to a user.

For common headers and authentication methods, see Access to the API. For sample scenarios, see API usage examples.

Request

POST

https://api.wiki.yandex.net/v1/pages/{idx}/access

Path parameters

Name

Description

idx

Type: integer

Page ID. The value of idx is the same as the id field value in the response to GET /v1/pages?slug=… or POST /v1/pages.

Body

application/json
{
  "user": {
    "uid": "example",
    "cloud_uid": "example"
  },
  "group": {
    "src": "dir",
    "id": "example"
  },
  "role": "reader",
  "inheritance": "inherited"
}

Name

Description

role

Type: RoleAPI

Access role: reader (read), editor (edit), extra_editor (extended edit), author (author)

Page access role:

  • reader: Read.
  • editor: Edit.
  • extra_editor: Extended editing.
  • author: Author (full access).

Enum: reader, editor, extra_editor, author

group

Any of 2 types
  • ComIdentitySchema

    Type: ComIdentitySchema

    Group identifier

    Example
    {
      "src": "dir",
      "id": "example"
    }
    
  • Type: null

    Example: null

ID of the group to grant access to. Specify either user or group

Example
{
  "src": "dir",
  "id": "example"
}

inheritance

Any of 2 types
  • InheritanceAPI

    Type: InheritanceAPI

    Access inheritance for subpages:

    • inherited: Subpages inherit the access permission.
    • not_inherited: Subpages do not inherit the access permission.

    Enum: inherited, not_inherited

  • Type: null

    Example: null

Access inheritance for subpages: inherited (inherited), not_inherited (not inherited)

Example: inherited

user

Any of 2 types
  • UserIdentity

    Type: UserIdentity

    User ID

    Example
    {
      "uid": "example",
      "cloud_uid": "example"
    }
    
  • Type: null

    Example: null

ID of the user to grant access to. Specify either user or group

Example
{
  "uid": "example",
  "cloud_uid": "example"
}

UserIdentity

User ID

Name

Description

cloud_uid

Any of 2 types
  • Type: string

    Example: example

  • Type: null

    Example: null

User identifier in the cloud

Example: example

uid

Any of 2 types
  • Type: string

    Example: example

  • Type: null

    Example: null

Yandex user ID

Example: example

Example
{
  "uid": "example",
  "cloud_uid": "example"
}

ComSource

Source of the group ID:

  • dir: IAM.
  • cloud: Yandex Cloud.
  • com: Local database.
  • staff: Internal employee directory.

Type: string

Enum: dir, cloud, com, staff

ComIdentitySchema

Group identifier

Name

Description

id

Type: string

Group identifier in the specified source

Example: example

src

Type: ComSource

Identifier source

Source of the group ID:

  • dir: IAM.
  • cloud: Yandex Cloud.
  • com: Local database.
  • staff: Internal employee directory.

Enum: dir, cloud, com, staff

Example
{
  "src": "dir",
  "id": "example"
}

RoleAPI

Page access role:

  • reader: Read.
  • editor: Edit.
  • extra_editor: Extended editing.
  • author: Author (full access).

Type: string

Enum: reader, editor, extra_editor, author

InheritanceAPI

Access inheritance for subpages:

  • inherited: Subpages inherit the access permission.
  • not_inherited: Subpages do not inherit the access permission.

Type: string

Enum: inherited, not_inherited

Responses

200 OK

OK

Body

application/json
{
  "id": "example",
  "created_at": "2025-01-01T00:00:00Z",
  "user": {
    "id": 0,
    "identity": {
      "uid": null,
      "cloud_uid": null
    },
    "username": "example",
    "display_name": "example",
    "is_dismissed": true,
    "affiliation": "example"
  },
  "group": {
    "id": "example",
    "identity": {
      "src": "dir",
      "id": "example"
    },
    "name": "example",
    "type": "wiki",
    "metadata": {
      "url": null,
      "externals_count": null
    },
    "members_count": 0
  },
  "role": "reader",
  "inheritance": "inherited"
}

Name

Description

id

Type: string

Unique access identifier

Example: example

role

Type: RoleAPI

Access role

Page access role:

  • reader: Read.
  • editor: Edit.
  • extra_editor: Extended editing.
  • author: Author (full access).

Enum: reader, editor, extra_editor, author

created_at

Any of 2 types
  • Type: string<date-time>

    Example: 2025-01-01T00:00:00Z

  • Type: null

    Example: null

Date and time the access was created

Example: 2025-01-01T00:00:00Z

group

Any of 2 types
  • GroupSchema

    Type: GroupSchema

    Group information

    Example
    {
      "id": "example",
      "identity": {
        "src": "dir",
        "id": "example"
      },
      "name": "example",
      "type": "wiki",
      "metadata": {
        "url": "example",
        "externals_count": 0
      },
      "members_count": 0
    }
    
  • Type: null

    Example: null

Group granted access (populated if access was granted to a group)

Example
{
  "id": "example",
  "identity": {
    "src": "dir",
    "id": "example"
  },
  "name": "example",
  "type": "wiki",
  "metadata": {
    "url": "example",
    "externals_count": 0
  },
  "members_count": 0
}

inheritance

Any of 2 types
  • InheritanceAPI

    Type: InheritanceAPI

    Access inheritance for subpages:

    • inherited: Subpages inherit the access permission.
    • not_inherited: Subpages do not inherit the access permission.

    Enum: inherited, not_inherited

  • Type: null

    Example: null

Access inheritance setting for subpages

Example: inherited

user

Any of 2 types
  • UserSchema

    Type: UserSchema

    User information

    Example
    {
      "id": 0,
      "identity": {
        "uid": "example",
        "cloud_uid": "example"
      },
      "username": "example",
      "display_name": "example",
      "is_dismissed": true,
      "affiliation": "example"
    }
    
  • Type: null

    Example: null

User granted access (populated if access was granted to a user)

Example
{
  "id": 0,
  "identity": {
    "uid": "example",
    "cloud_uid": "example"
  },
  "username": "example",
  "display_name": "example",
  "is_dismissed": true,
  "affiliation": "example"
}

UserSchema

User information

Name

Description

affiliation

Type: string

User affiliation

Example: example

display_name

Type: string

User display name

Example: example

id

Type: integer

Internal user identifier

is_dismissed

Type: boolean

The user is dismissed

username

Type: string

User login

Example: example

identity

Any of 2 types
  • UserIdentity

    Type: UserIdentity

    User ID

    Example
    {
      "uid": "example",
      "cloud_uid": "example"
    }
    
  • Type: null

    Example: null

User identifier in the system

Example
{
  "uid": "example",
  "cloud_uid": "example"
}
Example
{
  "id": 0,
  "identity": {
    "uid": "example",
    "cloud_uid": "example"
  },
  "username": "example",
  "display_name": "example",
  "is_dismissed": true,
  "affiliation": "example"
}

GroupType

Group type:

  • wiki: Wiki group.
  • service: Service group.
  • servicerole: Service role.
  • group: Regular group.
  • department: Department.

Type: string

Enum: wiki, service, servicerole, group, department

IntranetGroupMetadata

Group metadata from the internal directory

Name

Description

externals_count

Any of 2 types
  • Type: integer

  • Type: null

    Example: null

Number of external consultants in the group

Example: 0

url

Any of 2 types
  • Type: string

    Example: example

  • Type: null

    Example: null

Group URL in the directory

Example: example

Example
{
  "url": "example",
  "externals_count": 0
}

IamGroupMetadata

Group metadata from IAM (Identity and Access Management)

Name

Description

dir_id

Type: string

Directory identifier

Example: example

Example
{
  "dir_id": "example"
}

GroupSchema

Group information

Name

Description

identity

Type: ComIdentitySchema

Group identifier in the system

Group identifier

Example
{
  "src": "dir",
  "id": "example"
}

name

Type: string

Group name

Example: example

type

Type: GroupType

Group type

Group type:

  • wiki: Wiki group.
  • service: Service group.
  • servicerole: Service role.
  • group: Regular group.
  • department: Department.

Enum: wiki, service, servicerole, group, department

id

Any of 2 types
  • Type: string

    Example: example

  • Type: null

    Example: null

Group ID. Uses dir_id in the external version and staff_id in the internal version.

Example: example

members_count

Type: integer

Number of group members

Default: 0

metadata

Any of 3 types
  • IntranetGroupMetadata

    Type: IntranetGroupMetadata

    Group metadata from the internal directory

    Example
    {
      "url": "example",
      "externals_count": 0
    }
    
  • IamGroupMetadata

    Type: IamGroupMetadata

    Group metadata from IAM (Identity and Access Management)

    Example
    {
      "dir_id": "example"
    }
    
  • Type: null

    Example: null

Additional group metadata

Example
{
  "url": "example",
  "externals_count": 0
}
Example
{
  "id": "example",
  "identity": {
    "src": "dir",
    "id": "example"
  },
  "name": "example",
  "type": "wiki",
  "metadata": {
    "url": "example",
    "externals_count": 0
  },
  "members_count": 0
}