---
title: "Create an agent thread"
method: POST
path: "/v1/threads"
tags: ["threads"]
---

# Create an agent thread

`POST /v1/threads`

Creates a new agent thread for running agent workflows

## Headers

- `Authorization` string, required

## Request body

- object
  - `type` string, required — The agent type to use for this agent thread
  - `business_id` string, uuid — Business to use as context for the thread. Shorthand for context_type=business. Required unless context_type and context_id are provided.
  - `context_type` string — The type of context resource (e.g., "business")
  - `context_id` string, uuid — The ID of the context resource. Must be provided with context_type.

## Response `201`

agent thread created with context_type and context_id

- TypeAgentsThread — A conversation thread for agent workflows.
  - `object` string, required — Object type identifier.
  - `id` string, uuid, required — Unique identifier for the agent thread.
  - `created_at` string, date-time, required — Timestamp when the agent thread was created.
  - `updated_at` string, date-time, required — Timestamp when the agent thread was last updated.
  - `status` 'running' | 'completed' | 'error' | 'interrupted', required — Current lifecycle status of the agent thread.
  - `metadata` object, nullable — Internal metadata associated with the agent thread.
  - `requester` object, nullable — Requester context associated with the agent thread.
  - `steps` TypeAgentsStep[] — Execution steps emitted by the underlying agent state
    - `id` string, uuid, required — Unique identifier for the step.
    - `run_id` string, uuid, required — Identifier of the agent run that produced the step.
    - `agent` string — Agent identifier that generated this step.
    - `type` 'activity' | 'output' | 'interrupt' | 'error', required — Category of step output.
    - `name` string, required — Internal step name.
    - `label` string, required — Human-readable step label.
    - `parent_step_id` string, uuid, nullable — Parent step identifier for nested steps.
    - `status` 'running' | 'completed' | 'error', required — Current execution status for the step.
    - `started_at` string, date-time, required — Timestamp when the step started.
    - `completed_at` string, date-time, nullable — Timestamp when the step completed.
    - `steps` TypeAgentsStep[] — Nested child steps.
    - `result` TypeAgentsStepResult — Structured result payload for the step.
      - `resolution` 'auto_approve' | 'skip' — How the interrupt was resolved. Present only on completed interrupt steps when an interrupt policy auto-approved or skipped the interrupt. Absent for manual resolutions.
    - `artifacts` TypeAgentsArtifact[] — Artifacts produced by the step.
      - `title` string, required — Human-readable title for the artifact.
      - `type` string, required — Artifact type identifier.
      - `confidence` string, nullable — Optional confidence label for artifact quality.
      - `summary` string, nullable — Optional summary of the artifact contents.
      - `sources` TypeAgentsSource[] — Source references used to produce the artifact.
        - `url` string, uri, required — Canonical source URL.
        - `source_name` string — Human-readable source name.
        - `source_tier` string — Source quality or trust tier.
        - `source_type` string — Source category.

## Other responses

- `404` — agent type not found

---

[API](https://skmtc.net/middesk/apis/middesk-api.md) · [All operations](https://skmtc.net/middesk/apis/middesk-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/middesk/middesk-api/revisions/9882e52b445b/schema)
