Integrations API
Connect external services via OAuth, sync email and calendar, and manage document storage.
All endpoints prefixed with /api/v1/integrations
OAuth provider authorization and management.
/api/v1/integrations/oauth/providers Get list of available OAuth providers and their configuration status.
Auth: Bearer token
/api/v1/integrations/oauth/:provider/authorize Initiate OAuth flow — redirects to provider's consent screen.
Auth: Bearer token
/api/v1/integrations/oauth/:provider/callback Handle OAuth callback from provider.
Auth: None (OAuth redirect)
/api/v1/integrations/oauth/:provider Disconnect an OAuth provider.
Auth: Bearer token
Manage OAuth connections and sync operations.
/api/v1/integrations/connections List all OAuth connections for the current user.
Auth: Bearer token
/api/v1/integrations/connections/:id/status Get detailed status of a specific connection.
Auth: Bearer token
/api/v1/integrations/connections/:id/sync Trigger manual sync for a connection (email, calendar, or all).
Auth: Bearer token
Request Body
{
"type": "email"
} /api/v1/integrations/connections/:id/refresh Manually refresh OAuth token.
Auth: Bearer token
Email integration — inbox, send, thread tracking, and entity matching.
/api/v1/integrations/email/inbox Paginated inbox with folder, search, and unread filters.
Auth: Bearer token
Query Parameters
| Parameter | Type | Description |
|---|---|---|
| folder | string | Folder name (inbox, sent, archive) |
| q | string | Search query |
| unread | boolean | Filter unread only |
| page | number | Page number |
| limit | number | Items per page |
/api/v1/integrations/email/folders/counts Get aggregate email counts per folder.
Auth: Bearer token
/api/v1/integrations/email/:id/read Toggle email read status.
Auth: Bearer token
/api/v1/integrations/email/:id/star Toggle email star status.
Auth: Bearer token
/api/v1/integrations/email/:id/archive Toggle email archive status.
Auth: Bearer token
/api/v1/integrations/email/send Send an email via the user's OAuth connection.
Auth: Bearer token
Request Body
{
"to": ["recipient@company.com"],
"subject": "Follow up",
"body": "...",
"cc": [],
"bcc": []
} /api/v1/integrations/email/threads/:entityType/:entityId Get email threads linked to a CRM entity.
Auth: Bearer token
/api/v1/integrations/email/thread/:threadId Get all emails in a thread.
Auth: Bearer token
/api/v1/integrations/email/match Manually match an email address to a CRM entity.
Auth: Bearer token
Request Body
{
"emailAddress": "contact@company.com",
"entityType": "contact",
"entityId": 42
} /api/v1/integrations/email/sync Trigger manual email sync.
Auth: Bearer token
Calendar integration — events, CRM linking, and sync.
/api/v1/integrations/calendar/events Get calendar events in a date range.
Auth: Bearer token
Query Parameters
| Parameter | Type | Description |
|---|---|---|
| start | string | Start date (ISO) |
| end | string | End date (ISO) |
/api/v1/integrations/calendar/events/:id Get a single calendar event.
Auth: Bearer token
/api/v1/integrations/calendar/events Create a new calendar event.
Auth: Bearer token
Request Body
{
"title": "Client Meeting",
"start": "2026-07-01T14:00:00Z",
"end": "2026-07-01T15:00:00Z",
"description": "Quarterly review",
"attendees": ["contact@company.com"]
} /api/v1/integrations/calendar/events/:id Update a calendar event.
Auth: Bearer token
/api/v1/integrations/calendar/events/:id Delete a calendar event.
Auth: Bearer token
/api/v1/integrations/calendar/events/entity/:entityType/:entityId Get calendar events linked to a CRM entity.
Auth: Bearer token
/api/v1/integrations/calendar/sync Trigger manual calendar sync.
Auth: Bearer token
Document storage with upload, download, and entity linking.
/api/v1/integrations/documents/config Get document storage configuration status.
Auth: Bearer token
/api/v1/integrations/documents/upload Initiate a document upload (returns presigned URL).
Auth: Bearer token
Request Body
{
"fileName": "contract.pdf",
"contentType": "application/pdf",
"entityType": "account",
"entityId": 1
} /api/v1/integrations/documents/:id/confirm Confirm that upload has completed.
Auth: Bearer token
/api/v1/integrations/documents List documents with pagination and filtering.
Auth: Bearer token
/api/v1/integrations/documents/entity/:entityType/:entityId Get documents for a specific CRM entity.
Auth: Bearer token
/api/v1/integrations/documents/:id Get a specific document.
Auth: Bearer token
/api/v1/integrations/documents/:id/download Get download URL for a document.
Auth: Bearer token
/api/v1/integrations/documents/:id Delete a document.
Auth: Bearer token
/api/v1/integrations/documents/:id/archive Archive a document.
Auth: Bearer token