You are integrating Telepatia Synapse Public API.
Endpoint: PATCH /v1/appointments/{appointment_id}
Base URL: https://scribe-api.telepatia.ai
Auth: Authorization: Bearer ${SYNAPSE_API_KEY}
Request:
- appointment_id [path]: string (required)
- status [body]: string (optional, enum: cancelled, noshow) — Set the booking to cancelled or noshow.
- scribeSessionId [body]: string (optional, pattern=^ss_[a-z0-9]{16}$) — Public id of the session to attach when it was not auto-linked at create time. Sets the link and marks the booking fulfilled.
Success 200:
- id: string
- consultationInternalId?: string
- status: string
- start?: string
- end?: string
- minutesDuration?: integer
- serviceType?: string
- appointmentType?: string
- reason?: string
- description?: string
- createdAt: string
Errors (envelope: { error: { type, code, message, param? } }):
- 400: parameter_missing, parameter_invalid, account_invalid
- 401: authentication_required
- 403: permission_denied, permission_denied_role
- 404: resource_not_found
- 409: resource_conflict
- 503: service_unavailable
Generate code in the language of the current file that:
1. Reads SYNAPSE_API_KEY from env (do not hardcode it).
2. Calls the endpoint with typed request and response.
3. Maps the error envelope to typed exceptions per status code.
4. Adds one happy-path test using the Bearer token.