> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://stelltec.com/rhebok/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://stelltec.com/rhebok/docs/_mcp/server.

# Get the last dashboard-started index run

GET http://127.0.0.1:7331/api/index

Returns the record of the last index run the dashboard started, with
its exit status once it has finished. `run` is null when the dashboard
has never started one. A run whose process died before its exit was
recorded reads as finished with `ok` and `code` null.


Reference: https://stelltec.com/rhebok/docs/api/index/get-index-run

## Response

### 200

The last run, or null.

- `run` (IndexRun, required, nullable)

## Errors

### 421 Misdirected Request Error

The `Host` header does not name this dashboard (see the rules at the top of this page).

- `error` (string, required) — What went wrong, in plain words.

## Types

### IndexRun

- `pid` (integer, required)
- `reindex` (boolean, required)
- `finished` (boolean, required)
- `ok` (boolean, required, nullable) — Null while running, or when the process ended without its exit being recorded.
- `code` (integer, required, nullable) — The exit code, when there is one.
- `log` (string, required) — The log file the run writes to.

## Examples

### finished

**Response**

```json
{
  "run": {
    "pid": 48213,
    "reindex": false,
    "finished": true,
    "ok": true,
    "code": 0,
    "log": "/Users/me/Library/Application Support/rhebok/db.log"
  }
}
```

**SDK Code**

```python finished
import requests

url = "http://127.0.0.1:7331/api/index"

response = requests.get(url)

print(response.json())
```

```javascript finished
const url = 'http://127.0.0.1:7331/api/index';
const options = {method: 'GET'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go finished
package main

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

func main() {

	url := "http://127.0.0.1:7331/api/index"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby finished
require 'uri'
require 'net/http'

url = URI("http://127.0.0.1:7331/api/index")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
```

```java finished
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("http://127.0.0.1:7331/api/index")
  .asString();
```

```php finished
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'http://127.0.0.1:7331/api/index');

echo $response->getBody();
```

```csharp finished
using RestSharp;

var client = new RestClient("http://127.0.0.1:7331/api/index");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
```

```swift finished
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "http://127.0.0.1:7331/api/index")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### none

**Response**

```json
{
  "run": null
}
```

**SDK Code**

```python none
import requests

url = "http://127.0.0.1:7331/api/index"

response = requests.get(url)

print(response.json())
```

```javascript none
const url = 'http://127.0.0.1:7331/api/index';
const options = {method: 'GET'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go none
package main

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

func main() {

	url := "http://127.0.0.1:7331/api/index"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby none
require 'uri'
require 'net/http'

url = URI("http://127.0.0.1:7331/api/index")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
```

```java none
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("http://127.0.0.1:7331/api/index")
  .asString();
```

```php none
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'http://127.0.0.1:7331/api/index');

echo $response->getBody();
```

```csharp none
using RestSharp;

var client = new RestClient("http://127.0.0.1:7331/api/index");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
```

```swift none
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "http://127.0.0.1:7331/api/index")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```