> For the complete documentation index, see [llms.txt](https://readme.directual.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://readme.directual.com/api-integrations/authentication-api/login-password.md).

# Login/password

## Authentication using login-password pair

<mark style="color:green;">`POST`</mark> `https://api.directual.com/good/api/v5/auth?appID=?`

#### Query Parameters

| Name                                    | Type   | Description |
| --------------------------------------- | ------ | ----------- |
| appID<mark style="color:red;">\*</mark> | String | API-key     |

#### Request Body

| Name                                       | Type   | Description |
| ------------------------------------------ | ------ | ----------- |
| provider<mark style="color:red;">\*</mark> | string | rest        |
| username<mark style="color:red;">\*</mark> | string | username    |
| password<mark style="color:red;">\*</mark> | string | password    |

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

```
{
	"result": {
	"token": "8ba4aee8-f509-41d0-9c59-232e828a41a6",
	"username": "test",
	"role": ""
},
	"status": "ok"
}
```

{% endtab %}

{% tab title="404 " %}

```
{
    "msg": "User or password incorrect",
    "code": 108,
    "httpCode": 400,
    "typeError": "ERROR",
    "errorVariables": {},
    "payload": null,
    "status": "ERROR"
}
```

{% endtab %}
{% endtabs %}

Get the `appID` from the API section in your Directual project under API-keys.

<figure><img src="/files/jUSGeZ1IXvxIKxeEIDRx" alt=""><figcaption></figcaption></figure>

The login is the ID of the object from the WebUser data structure, and the password is stored encrypted.

You can use the following cURL command to make a POST request to the Directual API:

```json
{
    "provider": "rest",
    "username": "regressUser@directual.com",
    "password": "regress"
}
```

```
curl --location --request POST "https://api.directual.com/good/api/v5/auth?appID=?" \
  --header "Content-Type: application/json" \
  --data "{
\"provider\":\"rest\",
\"username\":\"regressUser@directual.com\",
\"password\":\"regress\"
}"
```

{% hint style="warning" %}
In the response, the token represents the sessionID of the user, and it is stored in the WebUserSession system data structure. You can use this token for subsequent authenticated requests.
{% endhint %}
