post/estimates/{estimateId}/handoffsexperimentalWymagana sesja
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.
Parametry ścieżki
| Nazwa | Typ | Wymagane | Ograniczenia | Opis |
|---|
| estimateId | string | Tak | - | Estimate id |
Treść żądania
| Pole | Typ | Wymagane | Ograniczenia | Opis |
|---|
| kind | HandoffKind | Tak | - | 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 | Tak | - | The language a generated estimate PDF or hand-off message is written in: pl (Polish) or en (English). |
| preliminary | boolean | Tak | - | - |
| tone | MessageTone | Tak | - | 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 | Tak | - | - |
| pdfExportId | string | Nie | minLength: 1 | An existing pdf export to associate with this hand-off, when one was involved. |
Przykład
{
"kind": "pdf-shared",
"locale": "pl",
"preliminary": false,
"tone": "friendly",
"aiDrafted": false,
"pdfExportId": "pdf-export-1"
}Odpowiedzi
201Created
| Pole | Typ | Wymagane | Ograniczenia | Opis |
|---|
| id | string | Tak | - | - |
| kind | HandoffKind | Tak | - | 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 | Tak | - | The language a generated estimate PDF or hand-off message is written in: pl (Polish) or en (English). |
| preliminary | boolean | Tak | - | - |
| tone | MessageTone | Tak | - | 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 | Tak | - | Whether the delivered message text came from POST .../message-draft rather than being hand-written. |
| revisionNumber | number | Tak | - | The estimate's latest revision number at the time of hand-off. |
| createdAt | string | Tak | format: "date-time" | - |
| createdByUid | string | Tak | - | - |
| pdfExportId | string | Nie | - | The pdf export this hand-off refers to, when one was involved. Absent otherwise. |
Przykład
{
"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.
Wspólna treść błędu walidacji, zobacz Błędy walidacji.
401Not authenticated
Brak treści.
403Forbidden
Brak treści.
404Not found
Brak treści.
Przykładowe żądanie
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"}'