## Read Analysis Status

### GET /v1/analyses/{analysisId}/status

### cURL

```bash
curl --request GET \
  --url https://{tenant}.mindbridge.ai/api/v1/analyses/{analysisId}/status \
  --header 'Authorization: Bearer <token>'
```

### Python

```python
import requests

url = "https://{tenant}.mindbridge.ai/api/v1/analyses/{analysisId}/status"

headers = {"Authorization": "Bearer <token>"}

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

print(response.text)
```

### JavaScript (Fetch API)

```javascript
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://{tenant}.mindbridge.ai/api/v1/analyses/{analysisId}/status', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

### PHP

```php
$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://{tenant}.mindbridge.ai/api/v1/analyses/{analysisId}/status",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>"
  ],
]);

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

curl_close($curl);

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

### Go

```go
package main

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

func main() {

url := "https://{tenant}.mindbridge.ai/api/v1/analyses/{analysisId}/status"

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

req.Header.Add("Authorization", "Bearer <token>")

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

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

fmt.Println(string(body))
}
```

### Java (Unirest)

```java
HttpResponse<String> response = Unirest.get("https://{tenant}.mindbridge.ai/api/v1/analyses/{analysisId}/status")
  .header("Authorization", "Bearer <token>")
  .asString();
```

### Ruby

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

url = URI("https://{tenant}.mindbridge.ai/api/v1/analyses/{analysisId}/status")

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

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

### Response

200 - application/json

```json
{
  "analysisId": "<string>",
  "analysisTypeId": "<string>",
  "preflightErrors": [],
  "sourceStatuses": [
    {
      "sourceId": "<string>",
      "analysisSourceTypeId": "<string>",
      "periodId": "<string>"
    }
  ],
  "availableFeatures": {},
  "ready": true,
  "mappedAccountMappingCount": 123,
  "unmappedAccountMappingCount": 123,
  "inferredAccountMappingCount": 123,
  "reRunReady": true
}
```

### Authorizations

**Authorization**  
string  
header  
required  
Bearer authentication header of the form `Bearer <token>`, where `<token>` is your auth token.

### Path Parameters

**analysisId**  
string  
required

### Field Descriptions

- **analysisId**: Identifies the associated analysis.
- **analysisTypeId**: Identifies the type of analysis.
- **preflightErrors**: The errors that occurred before the analysis was run.  
  Available options: `IN_PROGRESS`, `NOT_READY`, `ARCHIVED`, `REQUIRED_FILES_MISSING`, `SOURCES_NOT_READY`, `SOURCE_ERROR`, `UNVERIFIED_ACCOUNT_MAPPINGS`, `ANALYSIS_PERIOD_OVERLAP`, `SOURCE_WARNINGS_PRESENT`
- **sourceStatuses**: Details about the state of each analysis source.
- **availableFeatures**: Details about the various analysis capabilities available in MindBridge.
- **ready**: Indicates whether or not the analysis is ready to be run.
- **mappedAccountMappingCount**: The number of mapped accounts.
- **unmappedAccountMappingCount**: The number of unmapped accounts.
- **inferredAccountMappingCount**: The number of inferred account mapping; this can be considered a warning on partial matches.
- **reRunReady**: Indicates whether or not the analysis is ready to be run again.
