Custom API functions let you expose your own business logic over the REST surface, without modifying the platform's core. They're how you add company-specific endpoints — bulk operations, aggregations, calculations, integrations — to the standard CRUD API.
What They Look Like
Each custom function is registered with:
- An HTTP method (GET, POST, PATCH, DELETE).
- A path under
/api/custom/…. - Required scopes (which API clients/users can call it).
- Input validation (required fields, types).
- Server-side code that runs to produce the response.
Common Use Cases
- Bulk operations: Apply a discount to 1000 orders in one call.
- Aggregations: Return a custom-shaped report rather than separate field queries.
- Business workflows: Approve a record + send emails + update accounting system in one atomic transaction.
- External integrations: A custom endpoint that fans out to multiple external APIs.
Worked Examples
- POST /api/custom/orders/{id}/recalculate — recalculate the order's pricing after a config change.
- POST /api/custom/users/import — bulk-import users from a custom CSV format, mapping fields per the import contract.
- GET /api/custom/reports/monthly-revenue — return aggregated monthly revenue + breakdown by tier in a single response.
- POST /api/custom/notifications/blast — broadcast a notification to a filtered audience with custom merge logic.
Tip: Prefix custom paths with /api/custom/ so they never collide with future standard endpoints when the platform adds new ones.