> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.thymia.ai/api-reference/thymia-api/mental-wellness-thymia-helios/llms.txt.
> For full documentation content, see https://docs.thymia.ai/api-reference/thymia-api/mental-wellness-thymia-helios/llms-full.txt.

# Get model run status & results

GET /v1/models/mental-wellness/{model_run_id}

Retrieve the details of an existing Mental Wellness model run, including results if they are available.

Reference: https://docs.thymia.ai/api-reference/thymia-api/mental-wellness-thymia-helios/get-model-run-v-1-models-mental-wellness-model-run-id-get

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Thymia API
  version: 1.0.0
paths:
  /v1/models/mental-wellness/{model_run_id}:
    get:
      operationId: get-model-run-v-1-models-mental-wellness-model-run-id-get
      summary: Get model run status & results
      description: >-
        Retrieve the details of an existing Mental Wellness model run, including
        results if they are available.
      tags:
        - subpackage_mentalWellnessThymiaHelios
      parameters:
        - name: model_run_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: x-api-key
          in: header
          description: Your API Activation Key
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Details of model run's current state
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentalWellnessModelRunResponse'
        '404':
          description: Model run not found
          content:
            application/json:
              schema:
                description: Any type
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ModelRunStatus:
      type: string
      enum:
        - CREATED
        - RUNNING
        - COMPLETE_OK
        - COMPLETE_ERROR
      description: An enumeration.
      title: ModelRunStatus
    MentalWellnessValue:
      type: object
      properties:
        value:
          type: number
          format: double
      required:
        - value
      title: MentalWellnessValue
    MentalWellnessContinuousValue:
      type: object
      properties:
        value:
          type: number
          format: double
      required:
        - value
      title: MentalWellnessContinuousValue
    MentalWellnessPartResult:
      type: object
      properties:
        startSecs:
          type: number
          format: double
          description: >-
            Time in seconds (since the start of the whole recording) that this
            section starts at
        finishSecs:
          type: number
          format: double
          description: >-
            Time in seconds (since the start of the whole recording) that this
            section finishes at
        transcript:
          type: string
          description: The transcription of speech within this section of the recording
        distress:
          $ref: '#/components/schemas/MentalWellnessValue'
          description: >-
            A measure of the user’s levels of distress, or in other words worry,
            nervousness or a feeling of being on edge.
        stress:
          $ref: '#/components/schemas/MentalWellnessValue'
          description: >-
            A measure of the user’s stress levels, or in other words how anxious
            or wound up they may feel on this day, whether they are able to
            relax.
        exhaustion:
          $ref: '#/components/schemas/MentalWellnessValue'
          description: >-
            A measure of the user’s physical and mental tiredness as a result of
            manual or cognitive labour on this or previous days. This is not
            directly linked to a lack of sleep or the time of day.
        sleepPropensity:
          $ref: '#/components/schemas/MentalWellnessValue'
          description: >-
            A measure of the user’s sleepiness, i.e. a measure of how likely
            they are to fall asleep if given the opportunity. This is more
            directly related to poor sleep or a lack of sleep over a single
            night or several nights.
        lowSelfEsteem:
          $ref: '#/components/schemas/MentalWellnessValue'
          description: >-
            A measure of how well or confident the user feels in themselves and
            how they feel they measure up to the expectations of themselves and
            of others.
        mentalStrain:
          $ref: '#/components/schemas/MentalWellnessValue'
          description: An overall measure of the user’s mental wellness.
        uniformDistress:
          $ref: '#/components/schemas/MentalWellnessContinuousValue'
          description: >-
            A continuous measure of the user’s levels of distress, or in other
            words worry, nervousness or a feeling of being on edge.
        uniformStress:
          $ref: '#/components/schemas/MentalWellnessContinuousValue'
          description: >-
            A continuous measure of the user’s stress levels, or in other words
            how anxious or wound up they may feel on this day, whether they are
            able to relax.
        uniformExhaustion:
          $ref: '#/components/schemas/MentalWellnessContinuousValue'
          description: >-
            A continuous measure of the user’s physical and mental tiredness as
            a result of manual or cognitive labour on this or previous days.
            This is not directly linked to a lack of sleep or the time of day.
        uniformSleepPropensity:
          $ref: '#/components/schemas/MentalWellnessContinuousValue'
          description: >-
            A continuous measure of the user’s sleepiness, i.e. a measure of how
            likely they are to fall asleep if given the opportunity. This is
            more directly related to poor sleep or a lack of sleep over a single
            night or several nights.
        uniformLowSelfEsteem:
          $ref: '#/components/schemas/MentalWellnessContinuousValue'
          description: >-
            A continuous measure of how well or confident the user feels in
            themselves and how they feel they measure up to the expectations of
            themselves and of others.
      required:
        - startSecs
        - finishSecs
        - transcript
        - distress
        - stress
        - exhaustion
        - sleepPropensity
        - lowSelfEsteem
        - mentalStrain
      title: MentalWellnessPartResult
    MentalWellnessResults:
      type: object
      properties:
        sections:
          type: array
          items:
            $ref: '#/components/schemas/MentalWellnessPartResult'
          description: >-
            An array of mental wellness indicators, each specific to one timed
            section of the recording
      required:
        - sections
      title: MentalWellnessResults
    MentalWellnessErrorCode:
      type: string
      enum:
        - ERR_RECORDING_INVALID_FORMAT
        - ERR_RECORDING_TOO_SHORT
        - ERR_RECORDING_TOO_LONG
        - ERR_TRANSCRIPTION_FAILED
        - ERR_INTERNAL
      description: An enumeration.
      title: MentalWellnessErrorCode
    Tag:
      type: object
      properties:
        name:
          type: string
        value:
          type: string
      required:
        - name
        - value
      title: Tag
    DataDeletionType:
      type: string
      enum:
        - RECORDINGS
      description: An enumeration.
      title: DataDeletionType
    MentalWellnessModelRunResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: The id of the existing model run
        createdAt:
          type: string
          format: date-time
          description: When the model run was submitted to the API
        status:
          $ref: '#/components/schemas/ModelRunStatus'
          description: |-
            Current status of the model run. Possible values:
             * `CREATED`: Model run created; Waiting for files to be uploaded or thymia activities to be completed
             * `RUNNING`: All input to model has been supplied and the model is being executed
             * `COMPLETE_OK`: Model execution completed ok and results are available
             * `COMPLETE_ERROR`: Model execution completed with error and no results available
                
        runAt:
          type: string
          format: date-time
          description: >-
            The time the model run started executing and the status changed to
            `RUNNING`. This is after all input to the model has been supplied
        completedAt:
          type: string
          format: date-time
          description: >-
            When the model run finished processing and either results or an
            error reason are available; only populated once the model run
            completes
        errorReason:
          type: string
          description: Only populated if the model run ended with `COMPLETE_ERROR` status
        warnings:
          type: array
          items:
            type: string
          description: >-
            Contain warnings about potential issues that occurred during the
            model run.
        userLabel:
          type: string
          description: Label of the user that this model run was submitted for
        results:
          $ref: '#/components/schemas/MentalWellnessResults'
          description: Only populated if the model run ended with `COMPLETE_OK` status
        errorCode:
          $ref: '#/components/schemas/MentalWellnessErrorCode'
          description: >-
            Only populated if the model run ended with `COMPLETE_ERROR` status.
            Meaning of each error code:

            * `ERR_RECORDING_INVALID_FORMAT` - The recording supplied was not in
            supported file format.

            * `ERR_RECORDING_TOO_SHORT` - The recording supplied contained less
            than the minimum required amount of 10 seconds of speech.

            * `ERR_RECORDING_TOO_LONG` - The recording supplied exceeded the
            maximum allowed length of 3 minutes.

            * `ERR_TRANSCRIPTION_FAILED` - Couldn't determine speech in the
            recording supplied.

            * `ERR_INTERNAL` - An internal error occurred.
        activityType:
          type: string
          description: |-
            The activity type requested when creating the model run.
                Only populated if using the Thymia Activity Plugin and specifying an activity type (instead of using the default type).
        tags:
          type: array
          items:
            $ref: '#/components/schemas/Tag'
          description: Name/Value pairs the model run was tagged with when created.
        deleteData:
          type: boolean
          description: >-
            Boolean flag indicating if user data is to be deleted after the
            completion of the model run.
        dataToDelete:
          type: array
          items:
            $ref: '#/components/schemas/DataDeletionType'
          description: >-
            An array of data types to indicate which data inputs should be
            deleted after the completion of the model run.
        model:
          type: string
          description: The version of model used in the model run.
      required:
        - id
        - createdAt
        - status
        - userLabel
        - deleteData
      title: MentalWellnessModelRunResponse
    ValidationErrorLocItems:
      oneOf:
        - type: string
        - type: integer
      title: ValidationErrorLocItems
    ValidationError:
      type: object
      properties:
        loc:
          type: array
          items:
            $ref: '#/components/schemas/ValidationErrorLocItems'
        msg:
          type: string
        type:
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
    HTTPValidationError:
      type: object
      properties:
        detail:
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
      title: HTTPValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: x-api-key
      description: Your API Activation Key

```

## SDK Code Examples

```python
import requests

url = "https://api.example.com/v1/models/mental-wellness/model_run_id"

payload = {}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.get(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.example.com/v1/models/mental-wellness/model_run_id';
const options = {
  method: 'GET',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{}'
};

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

```go
package main

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

func main() {

	url := "https://api.example.com/v1/models/mental-wellness/model_run_id"

	payload := strings.NewReader("{}")

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

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

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

url = URI("https://api.example.com/v1/models/mental-wellness/model_run_id")

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

request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{}"

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

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

HttpResponse<String> response = Unirest.get("https://api.example.com/v1/models/mental-wellness/model_run_id")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.example.com/v1/models/mental-wellness/model_run_id', [
  'body' => '{}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.example.com/v1/models/mental-wellness/model_run_id");
var request = new RestRequest(Method.GET);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/v1/models/mental-wellness/model_run_id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```