# Share A Page Or Folder With Someone

`POST /shares/entity/{entityType}/{entityId}/grants`

Grants access to an existing Metakip user or queues an email invitation for a new user. Only an owner or administrator can share an entity; only the owner can grant Admin access.
## Authentication

Use one of the following authentication alternatives:

- **API token** (`bearerToken`) : Send a named API token in the Authorization header. Send it in the `Authorization: Bearer <token>` header.
- **Better Auth browser session** (`browserSession`) : Use the Better Auth session cookie from a signed-in browser session. Send it in the `better-auth.session_token` cookie.
## Token permissions

API tokens must include `pages:write`.
## Parameters

- `entityType` (path, required): The kind of Metakip entity to share.
- `entityId` (path, required): The UUID of the entity.
## Request Body

Required.

### `application/json`

```json
{
  "email": "string",
  "permission": "view"
}
```
## Responses

### 200

Access granted to an existing user.


### `application/json`

```json
{
  "ok": false,
  "message": "string"
}
```

### 202

An invitation was queued for an email address without an account.


### `application/json`

```json
{
  "ok": false,
  "message": "string",
  "invitation": {
    "id": "00000000-0000-0000-0000-000000000000",
    "targetType": "page",
    "targetId": "00000000-0000-0000-0000-000000000000",
    "email": "string",
    "permission": "view",
    "canManage": false,
    "deliveryStatus": "pending",
    "expiresAt": "string",
    "createdAt": "string"
  }
}
```

### 403

The API token is missing a required scope: pages:write.


### `application/json`

```json
{
  "error": {
    "code": "string",
    "message": "string"
  }
}
```
