# Share a page with someone by email

`POST /v1/documents/{documentId}/invite`

Members get a grant. Someone with an account who is not a member is added as a guest. Anyone else is emailed an invitation that makes them a guest with this access.

Scope: `docs:write`.

## Request

```bash
curl -X POST "https://api.lydie.co/v1/documents/01JCQ3V5MZ8G4ZK2X7T9R6N1PB/invite" \
  -H "Authorization: Bearer $LYDIE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "ada@example.com",
    "level": "view"
  }'
```

## Path parameters

- `documentId` (ULID, required)

## Body

- `email` (string, required): (≤ 320 chars)
- `level` (string, required): One of: `view`, `comment`, `edit`, `full`.

## Response

- `status` (string, required): One of: `granted`, `added_as_guest`, `invited`.
- `userId` (string, required, nullable): (1–64 chars)
- `invitationId` (string, required, nullable)

```json
{
  "status": "granted",
  "userId": null,
  "invitationId": null
}
```

Errors use the envelope described at https://developers.lydie.co/errors.md.
