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

# Trigger Investigation

> Start a new Deeptrace investigation asynchronously

Start a new investigation. Returns an `investigation_id` immediately — the investigation runs in the background. Poll [Get Investigation](https://docs.deeptrace.com/get-investigation) for results.

## Headers

<ParamField header="X-API-Key" type="string" required>
  Your Deeptrace API key. Obtain from **[Settings](https://app.deeptrace.com/settings) > [API Keys](https://app.deeptrace.com/api-keys)**. Also accepts `Authorization: Bearer <key>`.
</ParamField>

## Body

<ParamField body="query" type="string" required>
  The investigation prompt. Describe the issue you want Deeptrace to investigate.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.deeptrace.com/api/v1/investigate \
    -H "X-API-Key: dt_your_key_here" \
    -H "Content-Type: application/json" \
    -d '{"query": "Why are we seeing 500 errors on /checkout?"}'
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      "https://api.deeptrace.com/api/v1/investigate",
      headers={"X-API-Key": "dt_your_key_here"},
      json={"query": "Why are we seeing 500 errors on /checkout?"}
  )

  data = response.json()
  print(data["investigation_id"])
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    "https://api.deeptrace.com/api/v1/investigate",
    {
      method: "POST",
      headers: {
        "X-API-Key": "dt_your_key_here",
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        query: "Why are we seeing 500 errors on /checkout?",
      }),
    }
  );

  const data = await response.json();
  console.log(data.investigation_id);
  ```
</RequestExample>

## Returns

Returns the newly created investigation with its ID and initial status.

<ResponseExample>
  ```json 200 — Success theme={null}
  {
    "investigation_id": "d2ce1b29-f36a-43f0-9a96-c73a167b59f8",
    "status": "processing"
  }
  ```
</ResponseExample>

<ResponseField name="investigation_id" type="string" required>
  UUID of the created investigation. Use this to poll [Get Investigation](https://docs.deeptrace.com/get-investigation) for results.
</ResponseField>

<ResponseField name="status" type="string" required>
  `processing`
</ResponseField>
