> For the complete documentation index, see [llms.txt](https://teamleader-sdk.mcore-services.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://teamleader-sdk.mcore-services.dev/api-reference/other/accounts.md).

# Accounts

Fetch account information such as Projects version status.

```php
Teamleader::accounts()
```

|                          |                                                        |
| ------------------------ | ------------------------------------------------------ |
| Class                    | `McoreServices\TeamleaderSDK\Resources\Other\Accounts` |
| Create / update / delete | — / — / —                                              |
| Pagination               | No                                                     |

## Endpoints

* `accounts.projects-v2-status`

## Filters

`list()` takes no filters.

## Methods

### `projectsV2Status()`

```php
projectsV2Status(): array
```

Fetch which version of Projects the account is using

### `isUsingProjectsV2()`

```php
isUsingProjectsV2(): bool
```

Check if the account is using Projects v2

### `isUsingLegacyProjects()`

```php
isUsingLegacyProjects(): bool
```

Check if the account is using legacy Projects

### `getProjectsVersion()`

```php
getProjectsVersion(): string
```

Get the current Projects version status

### `getAutoSwitchDate()`

```php
getAutoSwitchDate(): ?string
```

Get the date when account will be automatically switched to Projects v2

### `hasScheduledAutoSwitch()`

```php
hasScheduledAutoSwitch(): bool
```

Check if account is scheduled for automatic switch to Projects v2

### `getAccountStatus()`

```php
getAccountStatus(): array
```

Get complete account status information

### `getDaysUntilAutoSwitch()`

```php
getDaysUntilAutoSwitch(): ?int
```

Get days until automatic switch (if scheduled)

### `isAutoSwitchApproaching()`

```php
isAutoSwitchApproaching(int $days = 30): bool
```

Check if auto-switch date is approaching (within specified days)

* `$days` — Number of days to consider as "approaching"

### `getProjectVersions()`

```php
getProjectVersions(): array
```

Get all valid project version statuses

### `getResponseStructure()`

```php
getResponseStructure(): array
```

Get response structure documentation

### `list()`

```php
list(array $filters = [], array $options = []): array
```

Override list method as it's not supported for accounts

### `info()`

```php
info($id, $includes = null): array
```

Override info method as it's not supported for accounts

## Examples

Check which Projects version the account is using:

```php
$status = Teamleader::accounts()->projectsV2Status();
                $version = $status["data"]["status"]; // "projects-v2" or "legacy"
```

Check if account will be automatically switched to Projects v2:

```php
$status = Teamleader::accounts()->projectsV2Status();

            if (isset($status["data"]["will_be_automatically_switched_on"])) {
                $switchDate = $status["data"]["will_be_automatically_switched_on"];
                echo "Account will be switched on: {$switchDate}";
            }
```

Check if account is using Projects v2:

```php
$isV2 = Teamleader::accounts()->isUsingProjectsV2();

            if ($isV2) {
                // Use Projects v2 endpoints
            } else {
                // Use legacy project endpoints
            }
```

Use different logic based on Projects version:

```php
$accounts = Teamleader::accounts();

            if ($accounts->isUsingProjectsV2()) {
                $projects = Teamleader::projects()->list();
            } else {
                // Handle legacy projects
                $projects = Teamleader::legacyProjects()->list();
            }
```
