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

# Create Thread Run

> Create a new run in thread context

## Path Parameters

<ParamField path="id" type="string" required>
  Thread ID
</ParamField>

## Request

<ParamField body="input" type="object">
  Input data passed to your crew
</ParamField>

<ParamField body="environment" type="string" default="production">
  Environment: `production` or `staging`
</ParamField>

## Response

Returns HTTP 202 (Accepted).

<ResponseField name="run_id" type="string">
  Run ID
</ResponseField>

<ResponseField name="thread_id" type="string">
  Thread ID
</ResponseField>

<ResponseField name="version_id" type="string">
  Version ID used for this run
</ResponseField>

<ResponseField name="version_number" type="integer">
  Version number used for this run
</ResponseField>

<ResponseField name="status" type="string">
  Run status: `running`
</ResponseField>

## Notes

* The thread must be in `idle` status. If `busy`, returns 409.
* Thread is automatically set to `busy` during execution.
* Thread state is updated and a checkpoint is created on completion.

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.crewship.dev/v1/threads/thr_xyz789abc/runs \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "input": {"message": "Tell me about AI agents"}
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json Success theme={null}
  {
    "run_id": "run_abc123xyz",
    "thread_id": "thr_xyz789abc",
    "version_id": "ver_xyz789",
    "version_number": 3,
    "status": "running"
  }
  ```
</ResponseExample>
