---
title: "Invite viewers (restricted mode; 1 credit per call)"
method: POST
path: "/api/v1/projects/{id}/share/invites"
tags: ["workspace"]
---

# Invite viewers (restricted mode; 1 credit per call)

`POST /api/v1/projects/{id}/share/invites`

## Request

- Base URL: `https://mdtidy.com`
- URL: `https://mdtidy.com/api/v1/projects/{id}/share/invites`
- Auth: HTTP bearer

## Headers

- `Idempotency-Key` string

## Request body

- InviteRequest
  - `emails` string[], required: Up to 25 viewer emails. 1 credit per call; already-invited emails are free.

## Response `200`

Invitees added; share is now restricted.

- Share
  - `project_id` string, uuid, required
  - `visibility` 'private' | 'public' | 'restricted', required
  - `public_url` string, nullable, required: `https://mdtidy.com/p/{slug}` when the link is the active mode.
  - `project_url` string, nullable, required: `https://mdtidy.com/p/{slug}` whenever the project is shared (public OR restricted); null when private. Append `/{fileId}` for a direct file link.
  - `invitees` ShareInvitee[], required
    - `email` string, email, required
    - `role` 'viewer', required
  - `credits_remaining` integer

## Other responses

- `401`: X-API-KEY is malformed, unknown, or revoked.
- `402`: Wallet has insufficient credits to satisfy the request.
- `404`: Resource not found, or not owned by the caller (IDOR-safe).
- `409`: Name collision, stale write, or a resource limit was reached.
- `413`: Request body exceeds the 1 MB cap.
- `422`: Request body failed validation.
- `429`: Per-key rate limit (60/min) exceeded.

---

[API](https://skmtc.dev/mdtidy/apis/markdown-tidy-api.md) · [All operations](https://skmtc.dev/mdtidy/apis/markdown-tidy-api/llms.txt) · [OpenAPI document](https://skmtc.dev/mdtidy/apis/markdown-tidy-api/revisions/caeec6fad155?raw)
