# Invite someone by email

`POST /v1/workspaces/{workspaceId}/invitations`

Emails an invitation link (valid for 7 days). Inviting an email that already has a pending invitation sends a fresh link. Owners and admins only.

Scope: `docs:write`.

## Request

```bash
curl -X POST "https://api.lydie.co/v1/workspaces/01JCQ3TZ0WJ8K4M2X7T9R6N1PA/invitations" \
  -H "Authorization: Bearer $LYDIE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "ada@example.com"
  }'
```

## Path parameters

- `workspaceId` (string, required): (1–64 chars)

## Body

- `email` (string, required): (≤ 320 chars)
- `role` (string, optional): One of: `admin`, `member`, `guest`. Default: `"member"`.
- `teamspaceIds` (string[], optional): Teamspaces the invitee joins on accepting (not for guests). Default: `[]`. (≤ 50 items)

## Response

- `id` (string, required): (1–64 chars)
- `workspaceId` (string, required): (1–64 chars)
- `email` (string, required)
- `role` (string, required): One of: `owner`, `admin`, `member`, `guest`.
- `status` (string, required): One of: `pending`, `accepted`, `declined`, `revoked`.
- `expiresAt` (timestamp, required)
- `documentId` (string, required, nullable)
- `documentLevel` (string, required, nullable): One of: `view`, `comment`, `edit`, `full`.
- `teamspaceIds` (string[], required)
- `invitedBy` (string, required, nullable)
- `createdAt` (timestamp, required)

```json
{
  "id": "string",
  "workspaceId": "01JCQ3TZ0WJ8K4M2X7T9R6N1PA",
  "email": "ada@example.com",
  "role": "owner",
  "status": "pending",
  "expiresAt": "2026-11-12T09:30:00.000Z",
  "documentId": null,
  "documentLevel": null,
  "teamspaceIds": [
    "string"
  ],
  "invitedBy": null,
  "createdAt": "2026-11-12T09:30:00.000Z"
}
```

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