API Documentation
Integrate ClientPortal into your own tools and workflows. All endpoints return JSON.
Authentication
Include your JWT token in the Authorization header for all protected endpoints:
Authorization: Bearer YOUR_JWT_TOKEN
Get your token by calling POST /api/auth/login. Tokens expire after 30 days.
Base URL
https://clientportal.appAll API requests are HTTPS. HTTP requests are redirected to HTTPS.
/api/auth/registerCreate a new agency account
{ name, email, password, agencyName }{ token, user, agency }/api/auth/loginGet a JWT token
{ email, password }{ token, user, agency }/api/auth/me🔒 auth requiredGet current user + agency
{ user, agency }/api/auth/logout🔒 auth requiredClear session cookie
/api/clients🔒 auth requiredList all clients for the agency
[{ id, name, email, company, token, _count }]/api/clients🔒 auth requiredCreate a client (sends welcome email)
{ name, email, company? }{ id, name, email, company, token }/api/projects🔒 auth requiredList projects (filter by ?clientId)
/api/projects🔒 auth requiredCreate a project
{ name, description?, clientId }/api/projects/:id🔒 auth requiredGet project by ID
/api/projects/:id🔒 auth requiredUpdate project name, description, or status
/api/projects/:id🔒 auth requiredDelete a project
/api/projects/:id/complete🔒 auth requiredMark complete + notify client
{ message? }/api/files?projectId=🔒 auth requiredList files for a project
/api/files🔒 auth requiredUpload a file (multipart/form-data)
FormData: { file, projectId, notify? }/api/files/:id/approveMark file as approved
/api/invoices🔒 auth requiredList all invoices
/api/invoices🔒 auth requiredCreate invoice + Stripe payment link
{ amount, currency, dueDate, clientId, sendEmail? }/api/invoices/:id/pdf🔒 auth requiredGet printable HTML invoice
/api/ai🔒 auth requiredGenerate AI project update (GPT-4o-mini)
{ projectId }{ id, content, aiGenerated: true }/api/portal?token=Get all portal data for a client token
/api/portal/messages?token=&projectId=Get project messages
/api/portal/messagesSend message as client
{ content, projectId, token }/api/portal/sign/:fileIdSign a document
{ token, signatureData, clientName?, clientEmail? }/api/zapier🔒 auth requiredList registered webhooks
/api/zapier🔒 auth requiredRegister a webhook endpoint
{ url, events: string[] }/api/zapier?id=🔒 auth requiredDeactivate a webhook
Rate Limits
Rate limit headers are included in every response: X-RateLimit-Remaining, X-RateLimit-Reset