> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.eis.it/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.eis.it/_mcp/server.

# Obtain JWT Access Tokens using the API Refresh Token

POST https://api.eis.it/auth/api-key/login
Content-Type: application/x-www-form-urlencoded

Generate a new JWT access token by providing a valid API key.

Reference: https://docs.eis.it/api/reference/authorization/obtain-jwt-access-tokens-using-the-api-refresh-token

## Servers

- `https://api.eis.it` (Production server, default)
- `https://staging.api.eis.it` (Staging server)

## Request

### Body (application/x-www-form-urlencoded)

- `clientId` (string, required) — The client identifier
- `clientSecret` (string, required) — The API Key (client secret)

## Response

### 200

Tokens generated successfully

- `access_token` (string, optional) — JWT access token

## Examples

**Request**

```json
{
  "clientId": "string",
  "clientSecret": "string"
}
```

**Response**

```json
{
  "access_token": "string"
}
```

**SDK Code**

```python
import requests

url = "https://api.eis.it/auth/api-key/login"

payload = ""
headers = {"Content-Type": "application/x-www-form-urlencoded"}

response = requests.post(url, data=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.eis.it/auth/api-key/login';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/x-www-form-urlencoded'},
  body: new URLSearchParams('')
};

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"
	"net/http"
	"io"
)

func main() {

	url := "https://api.eis.it/auth/api-key/login"

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

	req.Header.Add("Content-Type", "application/x-www-form-urlencoded")

	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.eis.it/auth/api-key/login")

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

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/x-www-form-urlencoded'

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.post("https://api.eis.it/auth/api-key/login")
  .header("Content-Type", "application/x-www-form-urlencoded")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.eis.it/auth/api-key/login', [
  'form_params' => null,
  'headers' => [
    'Content-Type' => 'application/x-www-form-urlencoded',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.eis.it/auth/api-key/login");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/x-www-form-urlencoded"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.eis.it/auth/api-key/login")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

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