REST API Endpoints
Clients, Products, Services, Invoices, Payments, Servers, API Keys, Webhooks, Audit Log
What it is
The Public REST API provides endpoints for clients, products, services, invoices, payments, servers, API keys, webhooks, and audit log. All endpoints use JSON for request and response bodies.
Endpoint overview
| Resource | Methods | Path |
|---|---|---|
| Clients | GET, POST, PUT, DELETE | /api/v1/clients |
| Products | GET, POST, PUT, DELETE | /api/v1/products |
| Products (pricing) | GET | /api/v1/products/pricing |
| Services | GET, POST, PUT, DELETE | /api/v1/services |
| Invoices | GET, POST, PUT, DELETE | /api/v1/invoices |
| Payments | GET, POST | /api/v1/payments |
| Servers | GET, POST, PUT, DELETE | /api/v1/servers |
| API Keys | GET, POST, PUT, DELETE | /api/v1/api-keys |
| Webhooks | GET, POST, PUT, DELETE | /api/v1/webhooks |
| Audit Log | GET | /api/v1/audit-log |
Example: Create a client
curl -X POST "https://yourdomain.com/api/v1/clients" \
-H "Authorization: Bearer your_api_key" \
-H "Content-Type: application/json" \
-d '{"first_name":"John","last_name":"Doe","email":"[email protected]"}'
Example: Get product pricing
curl -X GET "https://yourdomain.com/api/v1/products/pricing" \
-H "Authorization: Bearer your_api_key"
Pagination
List endpoints typically support ?page=1 and ?per_page=20 for pagination.
Clients API – Full examples
List clients: GET /api/v1/clients?page=1&per_page=50&search=acme&status=active
Create client:
POST /api/v1/clients
Content-Type: application/json
{
"email": "[email protected]",
"first_name": "John",
"last_name": "Doe",
"company_name": "Acme Ltd",
"password": "optional-auto-generated-if-omitted"
}
Response 201: {"success":true,"data":{"id":1,"uuid":"..."},"message":"Client created"}
Update client: PUT /api/v1/clients/1 or PUT /api/v1/clients/{uuid} with JSON body (email, first_name, last_name, company_name, status).
Delete client: DELETE /api/v1/clients/1 – soft delete (sets deleted_at or status=inactive).
Services API – Provisioning
POST /api/v1/services/{id}/provision – triggers server module create. POST /api/v1/services/{id}/suspend, /unsuspend, /terminate for lifecycle actions.
Invoices API – Record payment
POST /api/v1/invoices/{id}/pay with {"amount":29.99,"gateway":"manual","transaction_id":"TXN-001"} – marks invoice as paid and triggers activation if applicable.
Was this helpful?