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

# Retrieve run status

> Retrieves the status of the run execution based on its ID. The status can be `completed`, `failed`, or `in_progress`.

## Path parameters

<ParamField path="run_id" type="string">
  A unique identifier of the run you wish to retrieve.
</ParamField>

## Returns

The [run object](/reference/run-object) matches the specified ID.

<RequestExample>
  ```python Python theme={"system"}
  from ai21 import AI21Client

  client = AI21Client(api_key="your-api-key")  # Replace with your API key

  run_id = "your_run_id_here"

  # Retrieve the Maestro run by ID
  retrieved_run = client.beta.maestro.runs.retrieve(run_id)

  print(retrieved_run)
  ```

  ```javascript JavaScript theme={"system"}
  const runId = "your_run_id_here";

  fetch(`https://api.ai21.com/studio/v1/maestro/runs/${runId}`, {
    method: "GET",
    headers: {
      "Authorization": "Bearer your-api-key",
      "Content-Type": "application/json"
    }
  })
    .then(res => res.json())
    .then(data => console.log(data))
    .catch(err => console.error(err));
  ```

  ```php PHP theme={"system"}
  <?php

  $run_id = "your_run_id_here";

  $curl = curl_init();

  curl_setopt_array($curl, [
      CURLOPT_URL => "https://api.ai21.com/studio/v1/maestro/runs/$run_id",
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_CUSTOMREQUEST => "GET",
      CURLOPT_HTTPHEADER => [
          "Authorization: Bearer your-api-key",
          "Content-Type: application/json"
      ],
  ]);

  $response = curl_exec($curl);
  $error = curl_error($curl);

  curl_close($curl);

  if ($error) {
      echo "cURL Error: " . $error;
  } else {
      echo $response;
  }
  ```

  ```go Go theme={"system"}
  package main

  import (
      "fmt"
      "io/ioutil"
      "net/http"
  )

  func main() {
      runID := "your_run_id_here"
      url := fmt.Sprintf("https://api.ai21.com/studio/v1/maestro/runs/%s", runID)

      req, err := http.NewRequest("GET", url, nil)
      if err != nil {
          panic(err)
      }

      req.Header.Add("Authorization", "Bearer your-api-key")
      req.Header.Add("Content-Type", "application/json")

      res, err := http.DefaultClient.Do(req)
      if err != nil {
          panic(err)
      }
      defer res.Body.Close()

      body, err := ioutil.ReadAll(res.Body)
      if err != nil {
          panic(err)
      }

      fmt.Println("Status:", res.Status)
      fmt.Println("Response:", string(body))
  }
  ```

  ```bash cURL theme={"system"}
  curl --request GET \
    --url https://api.ai21.com/studio/v1/maestro/runs/{run_id} \
    --header "Authorization: Bearer your-api-key" \
    --header "Content-Type: application/json"
  ```

  ```java Java theme={"system"}
  String runId = "your_run_id_here";

  HttpResponse<String> response = Unirest.get("https://api.ai21.com/studio/v1/maestro/runs/" + runId)
      .header("Authorization", "Bearer your-api-key")
      .header("Content-Type", "application/json")
      .asString();

  System.out.println(response.getBody());
  ```
</RequestExample>
