> 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 version and update state

GET http://127.0.0.1:7331/api/version

Returns the installed version, the result of the last release check,
whether a newer release exists, and the state of an update that is
running or has finished. With `refresh=1` it checks for a release first,
which contacts GitHub.


Reference: https://stelltec.com/rhebok/docs/api/updates/get-version

## Request

### Query parameters

- `refresh` (enum, optional) — Send exactly `refresh=1` to run a release check before answering. Any other value does nothing.
  - Allowed values: `1`

## Response

### 200

The version state.

- `pid` (integer, required) — This dashboard's process id.
- `installed` (string, required) — The version this dashboard was built as.
- `latest` (string, required, nullable) — The newest release the last check found.
- `url` (string, required, nullable) — The release page of `latest`.
- `checked_at` (integer, required, nullable) — Unix seconds of the last check.
- `error` (string, required, nullable) — Why the last check failed, or null.
- `no_release` (boolean, required) — True when the last check found no published release.
- `update_available` (string, required, nullable) — The newer version, when one is available.
- `update` (UpdateStatus, required, nullable) — An update that is running or has finished, or null.

## 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

### UpdateStatus

- `pid` (integer, required)
- `started_at` (integer, required) — Unix seconds.
- `from` (string, required) — The version being updated from.
- `to` (string, required, nullable)
- `phase` (string, required) — For example `checking`, `downloading`, `verifying`, `extracting`, `installing`, `upgrading`, `done` or `failed`.
- `message` (string, required)
- `done` (boolean, required)
- `ok` (boolean, required, nullable)

## Examples

**Response**

```json
{
  "pid": 50112,
  "installed": "0.2.3",
  "latest": "0.2.4",
  "url": "https://github.com/Stellenbosch-Technologies/rhebok/releases/tag/v0.2.4",
  "checked_at": 1764115200,
  "error": null,
  "no_release": false,
  "update_available": "0.2.4",
  "update": null
}
```

**SDK Code**

```python Updates_getVersion_example
import requests

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

response = requests.get(url)

print(response.json())
```

```javascript Updates_getVersion_example
const url = 'http://127.0.0.1:7331/api/version';
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 Updates_getVersion_example
package main

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

func main() {

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

	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 Updates_getVersion_example
require 'uri'
require 'net/http'

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

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

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

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

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

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

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

$client = new \GuzzleHttp\Client();

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

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

```csharp Updates_getVersion_example
using RestSharp;

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

```swift Updates_getVersion_example
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "http://127.0.0.1:7331/api/version")! 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()
```