---
title: "File a message that arrived as a conversation"
method: POST
path: "/api/v1/handling/intake"
tags: ["Desk"]
---

# File a message that arrived as a conversation

`POST /api/v1/handling/intake`

## Request

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

Turns one message out of a connected mailbox into the two records the product acts on: the conversation it belongs to, and the message itself. Threading follows the mail headers first and the normalised subject second, so "Re: Re: Fw: Leak" and "Leak" are one conversation.

Nobody is created. A sender the address book does not hold stays an address on the message rather than becoming a contact behind your back.

Filing is idempotent on `uid`: the same message sent twice answers with the records it already has and `filed: false`.

## Request body

- object
  - `uid` string, required: The provider’s id for the message, which is what stops a re-sync filing it twice.
  - `messageId` string: RFC 822 Message-ID, which is what actually threads mail.
  - `inReplyTo` string
  - `references` string[]
  - `from` object, required
    - `name` string
    - `address` string, required
  - `to` object[]
    - `name` string
    - `address` string, required
  - `cc` object[]
    - `name` string
    - `address` string, required
  - `replyTo` object[]: Where the sender asked answers to go. A reply goes there instead of to From.
    - `name` string
    - `address` string, required
  - `forwardedBy` string: The mailbox that forwarded this here on its own. A reply copies it and names it as Reply-To.
  - `subject` string, required
  - `receivedAt` string: When it arrived. Now, where the caller does not say.
  - `body` string, required: Plain text. An HTML-only message is flattened by whatever read the mailbox.
  - `attachments` object[]
    - `name` string, required
    - `size` number, required
    - `contentType` string, required

## Response `200`

The conversation and the message it was filed as.

- object
  - `ok` unknown, required
  - `data` object, required
    - `threadId` string, required: Stable record id, e.g. `lse_012`.
    - `messageId` string, required: Stable record id, e.g. `lse_012`.
    - `filed` boolean, required: False where this message was already on file, which is the answer to a re-sync.
  - `meta` object, required
    - `requestId` string, required: Echoed in the x-request-id header. Quote it in a bug report.

## Other responses

- `400`: The message was not shaped like one.
- `401`: No session. Sign in first.

---

[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)
