---
title: "Hand this chat to a person"
method: POST
path: "/api/v1/ask/handoff"
tags: ["Dardaris"]
---

# Hand this chat to a person

`POST /api/v1/ask/handoff`

## Request

- Base URL: `http://localhost:5180`
- URL: `http://localhost:5180/api/v1/ask/handoff`
- Auth: API key in cookie `better-auth.session_token`

The signed-in version of `POST /helpdesk`: the thread carries who is asking and for which team, so the person answering knows the account. Replies are read on `GET /helpdesk/{id}` with the same token.

## Request body

- object
  - `id` string, required: Minted by the widget, so asking twice opens one thread.
  - `token` string, required: Minted by the widget and kept in memory. Only its hash is stored, and it is what opens the thread again.
  - `transcript` object[]: The chat so far, so the person answering reads what was already said.
    - `from` 'visitor' | 'dardaris', required
    - `text` string, required
  - `page` string

## Response `200`

The thread.

- object
  - `ok` unknown, required
  - `data` object, required
    - `chat` object, required
      - `id` string, required: Stable record id, e.g. `lse_012`.
      - `status` 'waiting' | 'open' | 'closed', required: `waiting` until someone answers, `open` once they have, `closed` when put away.
      - `name` string, nullable, required
      - `email` string, nullable, required
      - `page` string, nullable, required: The page the chat was opened from.
      - `signedIn` boolean, required
      - `teamId` string, nullable, required
      - `preview` string, required
      - `messageCount` number, required
      - `startedAt` string, required: ISO 8601 timestamp.
      - `updatedAt` string, required: ISO 8601 timestamp.
      - `messages` object[], required
        - `id` string, required: Stable record id, e.g. `lse_012`.
        - `from` 'visitor' | 'dardaris' | 'agent', required: Who wrote it: the visitor, the assistant before the handover, or a person on the team.
        - `text` string, required
        - `at` string, required: ISO 8601 timestamp.
        - `by` string: The first name of the person who answered.
  - `meta` object, required
    - `requestId` string, required: Echoed in the x-request-id header. Quote it in a bug report.

## Other responses

- `400`: The body was not valid, or the id is taken.

---

[API](https://skmtc.dev/dardaris/apis/dardaris-api.md) · [All operations](https://skmtc.dev/dardaris/apis/dardaris-api/llms.txt) · [OpenAPI document](https://skmtc.dev/dardaris/apis/dardaris-api/revisions/4aff33835c73?raw)
