---
title: "Create a new thread"
method: POST
path: "/companies/{companyId}/threads"
tags: ["Threads"]
---

# Create a new thread

`POST /companies/{companyId}/threads`

## Request

- Base URL: `https://api.medianfi.com/api/v1`
- URL: `https://api.medianfi.com/api/v1/companies/{companyId}/threads`
- Auth: HTTP bearer

## Request body

- CreateThreadInput
  - `subject` string, required
  - `agentType` 'human' | 'ai'
  - `agentName` string

## Response `201`

Thread created

- ThreadResponse
  - `success` boolean
  - `data` Thread
    - `id` string, uuid
    - `companyId` string, uuid
    - `subject` string
    - `status` 'open' | 'resolved'
    - `agentType` 'human' | 'ai'
    - `agentName` string, nullable
    - `initiatedByUserId` string, uuid, nullable
    - `createdBy` string, uuid, nullable
    - `resolvedBy` string, uuid, nullable
    - `resolvedAt` string, date-time, nullable
    - `lastActivityAt` string, date-time
    - `lastMessageAt` string, date-time, nullable
    - `updatedAt` string, date-time
    - `createdAt` string, date-time

## Other responses

- `401`: Authentication required
- `403`: Insufficient permissions or not a company member
- `422`: Validation error

---

[API](https://skmtc.dev/medianfi/apis/median-api.md) · [All operations](https://skmtc.dev/medianfi/apis/median-api/llms.txt) · [OpenAPI document](https://skmtc.dev/medianfi/apis/median-api/revisions/20090ea32b0d?raw)
