# Account Status

The `getAccount` API method allows a customer to retrieve the current status of their account, including whether it's active or disabled.

## Endpoint Details

| Description | Data                                                                          |
| ----------- | ----------------------------------------------------------------------------- |
| API Name    | [getAccount](https://sandbox.api.labs.zelus.io/docs/#/Account/get_v1_account) |
| HTTP Method | GET                                                                           |
| URL         | `/v1/account`                                                                 |

{% tabs %}
{% tab title="Request" %}

#### Headers

| Key          | Value              |
| ------------ | ------------------ |
| Content-Type | `application/json` |
| x-api-key    | API\_KEY           |

#### Parameters

There are no parameters required for this request.
{% endtab %}

{% tab title="Response" %}
The response will contain the details of the account status.

```tsx
{
    result: {
        account: {
            name: string,       // Name of the account
            isActive: boolean   // true or false if inactive
        }
    } | error?: IResponseError   // Optional error information
}
```

#### Success response example

```json
{
    "result": {
        "account": {
            "name": "Demo account",
            "isActive": true
        }
    }
}
```

#### Error messages

* Invalid API Key
  * `{ "code: 401, "message": "Invalid api key" }`
    {% endtab %}
    {% endtabs %}

## Examples

{% tabs %}
{% tab title="CURL" %}

```bash
curl -X GET 'https://sandbox.api.labs.zelus.io/v1/account' \
     -H "x-api-key: YOUR_API_KEY"
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://sandbox.api.labs.zelus.io/v1/account"
headers = {
    "x-api-key": "YOUR_API_KEY"
}

response = requests.get(url, headers=headers)
account_status = response.json() # Parsing response

name = account_status['result']['account']['name']
is_active = account_status['result']['account']['isActive']

print(f"Account Name: {name}")
print(f"Is Account Active: {is_active}")
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const axios = require('axios');

const url = "https://sandbox.api.labs.zelus.io/v1/account";
const headers = {
    "x-api-key": "YOUR_API_KEY"
};

axios.get(url, { headers: headers }).then(response => {
    const account_status = response.data; // Parsing response
    const name = account_status.result.account.name;
    const isActive = account_status.result.account.isActive;
    
    console.log(`Account Name: ${name}`);
    console.log(`Is Account Active: ${isActive}`);
}).catch(error => {
    console.error('Error:', error.response.data);
});
```

{% endtab %}
{% endtabs %}

## Notes

* The request to this endpoint does not require any specific parameters or form-data.
* The response will indicate the current status of the customer's account, whether active or disabled. If an error occurs, an `IResponseError` object may be included in the response.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.labs.zelus.io/zelus-labs-api/reference/account/getaccount.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
