# DocGate — Complete LLM Reference > Secure document sharing and analytics platform. Upload PDFs, share with granular access controls, and get page-by-page analytics on how recipients engage with every page. ## Overview DocGate is a secure document sharing and analytics platform — a modern DocSend alternative. Users upload documents (primarily PDFs), share them via trackable links with granular access controls, and get deep analytics on how recipients interact with every page. **Core value:** Know exactly who opened your document, how long they spent on each page, what they focused on, and whether they forwarded it. ## Key Features ### Document Sharing - Upload and process PDF documents with automatic page rendering - Generate shareable links with customizable access controls - Email-gated access requiring viewer identification - Download controls (allow or prevent downloads) - Expiration dates for time-limited access - Password protection for sensitive documents - Watermarking with viewer identification ### Analytics - Real-time page-by-page engagement tracking - Time spent per page with attention heatmaps - Drop-off analysis showing where readers lose interest - Unique viewer identification and session tracking - Bot detection to filter non-human traffic - Engagement scoring for each viewing session - Forwarding detection ### Data Rooms - Virtual data rooms for due diligence and deal management - Organize multiple documents with custom ordering - Aggregate analytics across all room documents - Per-document and per-viewer analytics within rooms ### Organization - Folder-based document organization - Team workspaces with member management - Custom branding (logo, colors) on shared documents ## Authentication All API requests require a Bearer token. Generate an API key in your dashboard under Settings > Developer. ```bash curl -H "Authorization: Bearer dg_live_..." https://docgate.io/api/v1/documents ``` API keys use the prefix `dg_live_` for production and `dg_test_` for test environments. ## REST API Base URL: `https://docgate.io/api/v1` ### Endpoints - `GET /api/v1/health` — Health check - `GET /api/v1/documents` — List documents - `POST /api/v1/documents` — Upload a document - `GET /api/v1/documents/{id}` — Get a document - `PUT /api/v1/documents/{id}` — Update a document - `DELETE /api/v1/documents/{id}` — Delete a document - `GET /api/v1/documents/{id}/links` — List links for a document - `POST /api/v1/documents/{id}/links` — Create a link for a document - `GET /api/v1/links/{id}` — Get a link - `PUT /api/v1/links/{id}` — Update a link - `DELETE /api/v1/links/{id}` — Delete a link - `GET /api/v1/folders` — List folders - `POST /api/v1/folders` — Create a folder - `PUT /api/v1/folders/{id}` — Update a folder - `DELETE /api/v1/folders/{id}` — Delete a folder - `GET /api/v1/documents/{id}/analytics` — Get document analytics overview - `GET /api/v1/documents/{id}/analytics/pages` — Get per-page analytics for a document - `GET /api/v1/links/{id}/views` — List views for a link - `GET /api/v1/views` — Search views across the workspace - `GET /api/v1/data-rooms` — List data rooms - `POST /api/v1/data-rooms` — Create a data room - `GET /api/v1/data-rooms/{id}` — Get a data room - `PUT /api/v1/data-rooms/{id}` — Update a data room - `DELETE /api/v1/data-rooms/{id}` — Delete a data room - `GET /api/v1/data-rooms/{id}/documents` — List documents in a data room - `POST /api/v1/data-rooms/{id}/documents` — Add a document to a data room - `DELETE /api/v1/data-rooms/{id}/documents/{documentId}` — Remove a document from a data room - `GET /api/v1/data-rooms/{id}/analytics` — Get data room analytics ### Pagination List endpoints support cursor-based pagination: - `limit` (integer, 1-100, default 20): Number of items per page - `starting_after` (string): ID of the last item from the previous page Response format: ```json { "data": [...], "has_more": true, "next_cursor": "uuid-of-last-item" } ``` ### Error Format ```json { "error": { "type": "invalid_request_error", "message": "Document not found", "code": "not_found" } } ``` Error types: `authentication_error`, `invalid_request_error`, `rate_limit_error`, `api_error` ### Rate Limits - Free tier: 100 requests/minute - Pro: 1,000 requests/minute - Team: 5,000 requests/minute Rate limit headers are included in every response: - `X-RateLimit-Limit`: Maximum requests per window - `X-RateLimit-Remaining`: Requests remaining - `X-RateLimit-Reset`: Unix timestamp when the window resets ## MCP Server (Model Context Protocol) DocGate provides an MCP server for AI agent integration, enabling agents to manage documents, links, analytics, and data rooms programmatically. ### Available Tools **Documents:** - `documents_list` — List all documents in the workspace with pagination - `documents_get` — Get a specific document by ID - `documents_update` — Update document title or folder - `documents_delete` — Delete a document - `documents_links_list` — List all links for a document **Folders:** - `folders_list` — List all folders in the workspace - `folders_create` — Create a new folder - `folders_update` — Rename a folder - `folders_delete` — Delete a folder **Links:** - `links_get` — Get a specific link by ID - `links_update` — Update link settings (name, active status, download permission) - `links_delete` — Delete a link - `links_create` — Create a new shareable link for a document **Analytics:** - `analytics_overview` — Get document analytics overview (views, avg time, completion rate) - `analytics_pages` — Get per-page engagement data and drop-off analysis **Views:** - `views_list` — List viewing sessions for a link with viewer details **Data Rooms:** - `data_rooms_list` — List all data rooms - `data_rooms_get` — Get data room details - `data_rooms_create` — Create a new data room - `data_rooms_update` — Update data room name/description - `data_rooms_delete` — Delete a data room - `data_rooms_documents_list` — List documents in a data room - `data_rooms_documents_add` — Add a document to a data room - `data_rooms_documents_remove` — Remove a document from a data room - `data_rooms_analytics` — Get aggregate analytics for a data room ## TypeScript SDK ```bash npm install @docgate/sdk ``` ```typescript import { DocGate } from "@docgate/sdk"; const client = new DocGate({ apiKey: "dg_live_..." }); // List documents const docs = await client.documents.list({ limit: 10 }); // Get analytics const analytics = await client.documents.analytics("doc-uuid"); ``` ## Pricing | Plan | Price | Documents | Views/mo | Features | |------|-------|-----------|----------|----------| | Free | $0 | 5 | 100 | Basic analytics | | Pro | $19/mo | Unlimited | Unlimited | Full analytics, custom branding | | Team | $39/mo | Unlimited | Unlimited | Workspaces, API, data rooms, priority support | ## Links - Website: https://docgate.io - API Documentation: https://docgate.io/api/docs - OpenAPI Specification: https://docgate.io/api/openapi/public - Concise LLM Reference: https://docgate.io/llms.txt