Public REST API
The REST API the Mercastra app itself uses, described from the API contract at build time. Endpoint summaries, descriptions and field descriptions come from that contract and are in English only.
Authentication
Requests authenticate with the session cookie the app sets at sign-in. Every request other than a GET must also send the X-CSRF-Token header, echoing the value of the csrf-token cookie.
There is no API key or token for third-party integrations yet.
Stability
Each endpoint carries one of two stability levels.
- experimental
- May change without notice.
- stable
- Stays as documented.
Endpoints
Every public endpoint, in path order. Each one links to its full description on its resource's page.
- post
/authenticateSign in with email and password - get
/estimates/{estimateId}Read an estimate - patch
/estimates/{estimateId}Update an estimate's name, recipient, markup or discount - delete
/estimates/{estimateId}Delete an estimate - post
/estimates/{estimateId}/confirmSnapshot an estimate's current content as a new revision - post
/estimates/{estimateId}/duplicateDuplicate an estimate - get
/estimates/{estimateId}/handoffsList an estimate's hand-offs - post
/estimates/{estimateId}/handoffsRecord that an estimate was handed off to its recipient - post
/estimates/{estimateId}/line-itemsAdd a line item to an estimate - patch
/estimates/{estimateId}/line-items/{lineItemId}Update a line item - delete
/estimates/{estimateId}/line-items/{lineItemId}Remove a line item - get
/estimates/{estimateId}/pdf-exportsList an estimate's PDF exports - post
/estimates/{estimateId}/pdf-exportsGenerate a PDF export of an estimate - get
/estimates/{estimateId}/pdf-exports/{pdfExportId}Download a PDF export's bytes - delete
/estimates/{estimateId}/pdf-exports/{pdfExportId}Delete a PDF export - get
/estimates/{estimateId}/revisionsList an estimate's revisions - get
/filesList files in a category and scope - post
/filesUpload a file - get
/files/{fileId}Download a file's bytes - get
/grids/{gridId}Read a grid - patch
/grids/{gridId}Rename a grid or change its icon size - delete
/grids/{gridId}Delete a grid - post
/grids/{gridId}/buttonsAdd a button to a grid - patch
/grids/{gridId}/buttons/{buttonId}Update a button - delete
/grids/{gridId}/buttons/{buttonId}Remove a button - post
/grids/{gridId}/duplicateDuplicate a grid - post
/logoutEnd the caller's session - get
/meRead the signed-in account's profile - patch
/meUpdate the signed-in account's profile - get
/me/data-exportExport everything stored about the account - get
/orders/{orderId}Read an order - patch
/orders/{orderId}Update an order's title, customer name or notes - patch
/orders/{orderId}/statusChange an order's status - get
/predefined-itemsList the catalog of predefined grid items, domains and templates - get
/workshopsList the caller's workshops - patch
/workshops/{workshopId}Update the workshop's profile - put
/workshops/{workshopId}/contextReplace the workshop's context notes - get
/workshops/{workshopId}/entitlementsRead the workshop's plan entitlements and quota usage - get
/workshops/{workshopId}/estimatesList a workshop's estimates - post
/workshops/{workshopId}/estimatesCreate an estimate in a workshop - get
/workshops/{workshopId}/estimates/most-used-line-itemsList the workshop's most-used line items - delete
/workshops/{workshopId}/grid-icons/{fileId}Delete a grid button icon - get
/workshops/{workshopId}/gridsList a workshop's grids - post
/workshops/{workshopId}/gridsCreate a grid in a workshop - get
/workshops/{workshopId}/ordersList a workshop's orders - post
/workshops/{workshopId}/ordersCreate an order in a workshop
Schemas
The named shapes a field's type links to: every entity and model, documented once on its own page.
Validation errors
Every endpoint that validates its request body answers a 400 with the same shape.
Sent with status 400 when the request body does not match the endpoint's schema. Each issue names the offending path and says what is wrong with it.
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
| status | string | Yes | const: "fail" | - |
| message | array of object | Yes | - | - |
| message[].path | array of string | number | Yes | - | - |
| message[].message | string | Yes | - | - |