# Login

## General

### URL

https://{host}/attunityenterprisemanager/api/v1/login

### Description

Authenticates an API caller with Enterprise Manager using Active Directory, and acquires a session token to be used with API method calls. The server requests client authentication.

### HTTP method

GET

POST

### Required user role

See [Required Enterprise Manager permissions](https://help.qlik.com/en-US/enterprise-manager/May2025/Content/EnterpriseManager/EnterpriseManager_APIGuide/Introduction/AEMPermissions.htm).

## Request parameters

Request parameters

| Location | URL Parameter Name | Required | Example |
| --- | --- | --- | --- |
| URL | host [string] | Yes | computer.network.net |
| Header (only required when using Active Directory, OpenID Connect, or JWT authentication)<br><br>Information noteThe basic authentication header needs to be converted to base 64 [string]. | When using Active Directory authentication:<br><br>user@domain:password<br><br>When using OpenID Connect authentication:<br><br>api-token:personal-access-token<br><br>Information noteThis login method requires you to be in possession of a Personal Access Token generated in Enterprise Manager. For details, see [Setting up OpenID Connect authentication](https://help.qlik.com/en-US/enterprise-manager/May2025/Content/EnterpriseManager/Main/Installation/Logging_into_AEM.htm).<br><br>When authenticating with a JWT:<br><br>Information noteThis login method requires you to be in possession of a JWT. For details, see [Logging in to Enterprise Manager with a JWT token via the API](https://help.qlik.com/en-US/enterprise-manager/May2025/Content/EnterpriseManager/Main/Installation/Logging_into_AEM.htm#Logging).<br><br>jwt:Actual-JWT-token | Yes | - |

Information noteThe user password cannot contain a colon (:).

## Response header

Response header parameters

| URL Param Name | Description |
| --- | --- |
| EnterpriseManager.APISessionID | Identifier to be used to get authorization to run API functions on Enterprise Manager |

## cURL example

### Active Directory request

`curl -i -k --header "Authorization: Basic cWFAcWE6cWE=" https://computer.network.net/attunityenterprisemanager/api/v1/login`

### OpenID Connect request

`curl -i -k --header "Authorization: Basic Z3dDN2FleHJJVDdpZ0hBRjI2dkxCTDJIUi9JTHJKYXFkZT" https://computer.network.net/attunityenterprisemanager/api/v1/login`

### Response

`HTTP/1.1 200 OK`

`Content-Length: 0`

`Content-Type: text/html`

`Server: Microsoft-HTTPAPI/2.0`

`EnterpriseManager.APISessionID: J3cKzWIbi_w6Fr1G-tO03Q`

`Date: Mon, 26 Dec 2016 17:02:01 GMT`

## Error response

Error responses

| HTTP Code | Enterprise Manager Code | Text | Description |
| --- | --- | --- | --- |
| 401 | UNAUTHORIZED\_REQUEST | Unauthorized Request. | The request was not authorized. |