Developers
API reference
Overview
The API is what the SoloPilot app and mobile app run on, plus the links in our emails and the webhooks our providers call. Responses are JSON unless noted.
- Base URL
https://api.solopilot.co.uk- Also at
https://solopilot.co.uk/api, same endpoints
Authentication
Sign in through SoloPilot (email code or Google) and send the session's access token as a Bearer token. Tokens expire, so refresh them with the Supabase client the way the app does. A missing or expired token gets 401.
curl https://api.solopilot.co.uk/authenticated/invoices/INVOICE_ID/pdf \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -o invoice.pdf
Errors
Standard HTTP status codes. Where there's a body, it explains what went wrong.
| 400 | The request is malformed or missing something. The body says what. |
| 401 | No token, an expired token, or a bad webhook signature. |
| 403 | Signed in, but your role or workspace doesn't allow this. |
| 404 | Nothing with that ID in your workspace. |
| 410 | It existed but is gone, such as a cancelled booking. |
| 429 | Too many requests. Back off and retry. |
| 500 | Our fault. Safe to retry; webhooks are retried by the provider. |
Service
No sign-in needed.
Status
/statusWhether the API is up, and the server's current time. Point uptime monitors here. It doesn't check the database or payment providers.
Returns 200 · { "status": "ok", "time": "2026-11-16T09:30:00.000Z" }
Your account
These act on the signed-in user's workspace and need a Bearer token. Team members get what their role allows; someone who can't see the books gets 403.
Invoice PDF
/authenticated/invoices/{id}/pdfDownload an invoice as a PDF.
Parameters
- id
- Invoice ID
Returns application/pdf · 401, 403, 404
Receipt download
/authenticated/receipts/{id}/downloadDownload a receipt you've issued.
Parameters
- id
- Receipt ID
Returns The receipt file · 401, 404
Expense receipt
/authenticated/expense-receipts/downloadDownload the receipt image attached to an expense. Files are stored encrypted; this returns the original.
Parameters
- path
- Storage path of the expense receipt (query string)
Returns The original image or PDF · 400, 401, 403, 404
Payments account
/authenticated/stripe-connect/accountThe workspace's connected Stripe account: details, capabilities and onboarding status.
Parameters
- accountId
- Optional. Must belong to your workspace (query string)
Returns JSON · 401, 403, 404 if no Stripe account is connected
Payments balance
/authenticated/stripe-connect/balanceAvailable and pending balance on the connected account.
Parameters
- accountId
- Optional (query string)
Returns JSON · 401, 403, 404 if no Stripe account is connected
Payments charges
/authenticated/stripe-connect/chargesRecent charges on the connected account.
Parameters
- accountId
- Optional (query string)
- limit
- How many to return, default 50 (query string)
Returns JSON · 401, 403, 404 if no Stripe account is connected
Assistant
/authenticated/agentTalk to the SoloPilot assistant. One endpoint; the action field picks what to do.
Request body
{ "action": "conversation" } // current conversation
{ "action": "sessions" } // past sessions
{ "action": "new" } // start a fresh session
{ "action": "resume", "sessionId": "…" }
{ "action": "send", "text": "Invoice Acme £500 for design work" }Returns JSON · 400 with a readable error for bad input
Public links
Links SoloPilot puts in emails and booking confirmations. No sign-in: the ID or token in the link is the credential.
Booking calendar file
/public/bookings/{bookingId}/icsAdd a booking to a calendar (Apple, Google, Outlook).
Parameters
- bookingId
- Booking ID from the confirmation email
Returns text/calendar · 404, 410 if cancelled
Unsubscribe page
/public/email/unsubscribe?token=…Shows an unsubscribe confirmation. Nothing changes until the button is pressed, so link scanners can't unsubscribe anyone.
Returns HTML page
Unsubscribe
/public/email/unsubscribe?token=…Confirms the unsubscribe. Also handles one-click unsubscribe from mail clients (RFC 8058).
Returns HTML page
Webhooks
Where Stripe, Meta and Resend deliver events. Every request must carry the provider's signature; anything unsigned or altered is rejected. Set these URLs in each provider's dashboard.
Stripe
/public/webhooks/stripeSubscription, checkout and payment events. Verified with the Stripe-Signature header.
Returns 200 · 400 bad signature · 429 rate limited
WhatsApp verification
/public/webhooks/whatsappMeta's subscription handshake (hub.mode, hub.verify_token, hub.challenge).
Returns The challenge · 403
WhatsApp messages
/public/webhooks/whatsappIncoming WhatsApp messages. Verified with the X-Hub-Signature-256 header.
Returns 200 · 400 · 401 bad signature · 429 rate limited
Resend
/public/webhooks/resendDelivery, bounce and complaint events. Verified with the Svix signature headers.
Returns 200 · 400 bad signature