# Accept an invitation

`POST /v1/invitations/accept`

The signed-in account's email must match the invitation.

Needs a signed-in session; API and OAuth tokens get 403.

## Request

```bash
curl -X POST "https://api.lydie.co/v1/invitations/accept" \
  -H "Authorization: Bearer $LYDIE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "token": "string"
  }'
```

## Body

- `token` (string, required): (20–200 chars)

## Response

- `workspaceId` (string, required): (1–64 chars)
- `role` (string, required): One of: `owner`, `admin`, `member`, `guest`.
- `documentId` (string, required, nullable)

```json
{
  "workspaceId": "01JCQ3TZ0WJ8K4M2X7T9R6N1PA",
  "role": "owner",
  "documentId": null
}
```

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