API Endpoints
All endpoints are prefixed with the Edge Function base URL. See API Overview for the full base URL format.
Clients
| Method | Endpoint | Description |
|---|---|---|
GET | /clients | List all clients |
POST | /clients | Create a new client |
GET | /clients/:id | Get a single client |
PATCH | /clients/:id | Update a client |
DELETE | /clients/:id | Delete a client |
Sessions
| Method | Endpoint | Description |
|---|---|---|
GET | /sessions | List all sessions |
POST | /sessions | Create a new session |
GET | /sessions/:id | Get a single session |
PATCH | /sessions/:id | Update a session |
Invoices
| Method | Endpoint | Description |
|---|---|---|
GET | /invoices | List all invoices |
POST | /invoices | Create a new invoice |
GET | /invoices/:id | Get a single invoice |
PATCH | /invoices/:id | Update an invoice |
POST | /invoices/:id/send | Send invoice to client |
Finalized Invoice Immutability
Finalized (sent or paid) invoices cannot be deleted. To reverse a charge, create a Credit Note via POST /invoices/:id/credit-note.
Contracts
| Method | Endpoint | Description |
|---|---|---|
GET | /contracts | List all contracts |
POST | /contracts | Create a contract |
GET | /contracts/:id | Get a single contract |
POST | /contracts/:id/send | Send for signature |
POST | /contracts/:id/sign | Record a signature |
Quotes
| Method | Endpoint | Description |
|---|---|---|
GET | /quotes | List all quotes |
POST | /quotes | Create a quote |
GET | /quotes/:id | Get a single quote |
POST | /quotes/:id/convert | Convert to invoice |
Account
| Method | Endpoint | Description |
|---|---|---|
GET | /account | Get current user account |
PATCH | /account | Update account settings |
DELETE | /account | Delete account and all data |
Admin
| Method | Endpoint | Description |
|---|---|---|
DELETE | /admin/delete-test-data | Purge test-generated data (superadmin only) |
Error Responses
All errors return a JSON body:
{
"error": "Human-readable error message",
"code": "ERROR_CODE"
}
| HTTP Status | Meaning |
|---|---|
400 | Bad request — invalid input |
401 | Unauthorized — missing or expired token |
403 | Forbidden — insufficient permissions |
404 | Not found |
409 | Conflict — e.g., duplicate email |
503 | Service temporarily unavailable — retry with backoff |