# 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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://readme.directual.com/api-integrations/authentication-api/login-password.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
