post/estimates/{estimateId}/handoffsexperimentalSession required
Records that a hand-off happened; it does not send anything itself, the caller performs the copy, share or open action and reports it here afterward. None of kind, tone or aiDrafted is verified against anything that actually happened, they are trusted as given. The body is strict, an unknown field is a 400. When pdfExportId is given it must identify an existing pdf export on this estimate; if it does not, this also responds 400, but with an empty body, not the ValidationError JSON a schema violation sends - the two 400 causes are otherwise indistinguishable from the status code alone. Responds 403 when the caller is not a member of the estimate's workshop and 404 when no such estimate exists.
Path parameters
| Name | Type | Required | Constraints | Description |
|---|
| estimateId | string | Yes | - | Estimate id |
Request body
| Field | Type | Required | Constraints | Description |
|---|
| kind | HandoffKind | Yes | - | How a crafter delivered an estimate to its recipient, one of these five values: message-copied, message-shared, pdf-shared, pdf-and-message-shared or email-opened. Caller-supplied and not verified against anything that actually happened, see the hand-off endpoint's own description. |
| locale | DocumentLocale | Yes | - | The language a generated estimate PDF or hand-off message is written in: pl (Polish) or en (English). |
| preliminary | boolean | Yes | - | - |
| tone | MessageTone | Yes | - | The tone of a hand-off message, formal or friendly. Recorded on every hand-off regardless of aiDrafted, not just ones whose text came from the AI draft endpoint. |
| aiDrafted | boolean | Yes | - | - |
| pdfExportId | string | No | minLength: 1 | An existing pdf export to associate with this hand-off, when one was involved. |
Example
{
"kind": "pdf-shared",
"locale": "pl",
"preliminary": false,
"tone": "friendly",
"aiDrafted": false,
"pdfExportId": "pdf-export-1"
}Responses
201Created
| Field | Type | Required | Constraints | Description |
|---|
| id | string | Yes | - | - |
| kind | HandoffKind | Yes | - | How a crafter delivered an estimate to its recipient, one of these five values: message-copied, message-shared, pdf-shared, pdf-and-message-shared or email-opened. Caller-supplied and not verified against anything that actually happened, see the hand-off endpoint's own description. |
| locale | DocumentLocale | Yes | - | The language a generated estimate PDF or hand-off message is written in: pl (Polish) or en (English). |
| preliminary | boolean | Yes | - | - |
| tone | MessageTone | Yes | - | The tone of a hand-off message, formal or friendly. Recorded on every hand-off regardless of aiDrafted, not just ones whose text came from the AI draft endpoint. |
| aiDrafted | boolean | Yes | - | Whether the delivered message text came from POST .../message-draft rather than being hand-written. |
| revisionNumber | number | Yes | - | The estimate's latest revision number at the time of hand-off. |
| createdAt | string | Yes | format: "date-time" | - |
| createdByUid | string | Yes | - | - |
| pdfExportId | string | No | - | The pdf export this hand-off refers to, when one was involved. Absent otherwise. |
Example
{
"id": "handoff-1",
"kind": "pdf-shared",
"locale": "pl",
"preliminary": false,
"tone": "friendly",
"aiDrafted": false,
"revisionNumber": 1,
"createdAt": "2026-08-10T14:40:00.000Z",
"createdByUid": "uid-1",
"pdfExportId": "pdf-export-1"
}400Either the body fails schema validation (ValidationError JSON) or pdfExportId does not identify a pdf export belonging to this estimate (empty body) - see this endpoint's description.
The shared validation error body, see Validation errors.
401Not authenticated
No body.
403Forbidden
No body.
404Not found
No body.
Example request
curl -X POST 'https://mercastra.cloud/api/estimates/<estimateId>/handoffs' \
-H 'Cookie: session=<session cookie>' \
-H 'X-CSRF-Token: <csrf-token cookie value>' \
-H 'Content-Type: application/json' \
-d '{"kind":"pdf-shared","locale":"pl","preliminary":false,"tone":"friendly","aiDrafted":false,"pdfExportId":"pdf-export-1"}'