---
title: "API client"
slug: "api-client-1523469"
abstract: ""
---
# API client

The JavaScript SDK uses the API client to get REST API information from the server, which is used in two ways:

- Getting the API / server version for compatibility checks
- Getting the REST API URLs

## Getting API information

Getting API information can be done with the `getApiInfoAsync` method, which returns an `IApiInfo`. This object contains the server version, the minimum supported SDK version and the REST API routes.

```javascript
await client.api.getApiInfoAsync();

```

This is almost always the first call made by the JavaScript SDK. Because these versions and REST API URLs do not change at runtime, this result is cached. If necessary, the result can be refreshed with the `Refresh` method on the API client.

## Getting REST API routes

Getting the REST API routes can be done through the `IApiInfo.Routes` property or the `getApiRoutesAsync` method on the API client. The latter is just a shortcut. This returns a read-only dictionary of routes that are supported by the REST API. The SDK also uses this internally.

```javascript
await client.api.getApiRoutesAsync();

```