> ## Documentation Index
> Fetch the complete documentation index at: https://hubify.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Chats

> Promote a chat session to a knowledge entry, paper draft, or task.

# Chats API

The Chats API currently exposes a single action: promoting a chat session's content to a durable lab artifact (knowledge entry, paper draft, or task list). The session data itself lives in Convex and is read by the web and desktop apps in real time.

## Promote Session

Converts a chat session's messages into a durable lab artifact. Useful for extracting research decisions, draft text, or action lists from a long conversation.

<ParamField path="id" type="string" required>
  Convex chat session ID.
</ParamField>

<ParamField body="labId" type="string" required>
  Convex ID of the lab owning the session.
</ParamField>

<ParamField body="targetType" type="string" required>
  Output artifact type: `knowledge`, `paper`, or `task`.
</ParamField>

<ParamField body="title" type="string">
  Override the auto-generated artifact title.
</ParamField>

<CodeGroup>
  ```bash curl theme={null}
  curl -X POST "https://www.hubify.com/api/v1/chats/$SESSION_ID/promote" \
    -H "Authorization: Bearer $HUBIFY_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "labId": "$LAB_ID",
      "targetType": "knowledge",
      "title": "Discussion: H200 cost vs A100 for MCMC runs"
    }'
  ```
</CodeGroup>

<ResponseField name="artifactId" type="string" required>
  Convex ID of the newly created artifact (knowledge entry, paper, or task).
</ResponseField>

<ResponseField name="artifactType" type="string" required>
  The type created: `knowledge`, `paper`, or `task`.
</ResponseField>

<ResponseField name="sessionId" type="string" required>
  Source chat session ID.
</ResponseField>

<Note>
  The promote action uses the session's messages to generate the artifact content via the lab orchestrator. For `paper` promotion, the result is a draft with status `draft` and readiness `0`. For `knowledge`, the entity type defaults to `insight`. For `task`, a task list is extracted from action-item bullets in the session.
</Note>
