On this page▾

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.

400The request is malformed or missing something. The body says what.
401No token, an expired token, or a bad webhook signature.
403Signed in, but your role or workspace doesn't allow this.
404Nothing with that ID in your workspace.
410It existed but is gone, such as a cancelled booking.
429Too many requests. Back off and retry.
500Our fault. Safe to retry; webhooks are retried by the provider.

Service

No sign-in needed.

Status

GET/status

Whether 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

GET/authenticated/invoices/{id}/pdf

Download an invoice as a PDF.

Parameters

id
Invoice ID

Returns application/pdf · 401, 403, 404

Receipt download

GET/authenticated/receipts/{id}/download

Download a receipt you've issued.

Parameters

id
Receipt ID

Returns The receipt file · 401, 404

Expense receipt

GET/authenticated/expense-receipts/download

Download 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

GET/authenticated/stripe-connect/account

The 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

GET/authenticated/stripe-connect/balance

Available 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

GET/authenticated/stripe-connect/charges

Recent 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

POST/authenticated/agent

Talk 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

GET/public/bookings/{bookingId}/ics

Add 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

GET/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

POST/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

POST/public/webhooks/stripe

Subscription, checkout and payment events. Verified with the Stripe-Signature header.

Returns 200 · 400 bad signature · 429 rate limited

WhatsApp verification

GET/public/webhooks/whatsapp

Meta's subscription handshake (hub.mode, hub.verify_token, hub.challenge).

Returns The challenge · 403

WhatsApp messages

POST/public/webhooks/whatsapp

Incoming WhatsApp messages. Verified with the X-Hub-Signature-256 header.

Returns 200 · 400 · 401 bad signature · 429 rate limited

Resend

POST/public/webhooks/resend

Delivery, bounce and complaint events. Verified with the Svix signature headers.

Returns 200 · 400 bad signature