> For the complete documentation index, see [llms.txt](https://docs.dapta.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dapta.ai/product-guides/dapta-auth.md).

# Dapta Auth

Reference for the Dapta Auth API: login, password change, and create, list, get, update or delete user endpoints, plus a downloadable Postman collection.

Dapta Auth is a secure authentication system. This documentation provides detailed information on how to implement and utilize Dapta Auth in various applications and platforms.

### Login

This endpoint is used to authenticate and login users. It is an HTTP POST request to the specified URL with a dynamic user pool parameter. The request requires a raw body with the username and password fields. Upon successful execution, it returns a status code of `200` along with a token in the response body.

**POST** - `https://services.dapta.ai/authentication/{{users-pool}}/auth/login`

Body:

```json
{
    "username": "username",
    "password": "pass"
}
```

### Password Change

This API endpoint is used to change the password for a user in the specified user pool. The HTTP POST. The response to this request will have a status code of `204`, indicating a successful operation. The response body will be null.

**POST -** `https://services.dapta.ai/authentication/{{users-pool}}/auth/change-password`

Headers:

```c
Authorization : Bearer <token user logged>
```

Body:

```json
{
    "oldPassword": "pass",
    "newPassword": "pass"
}
```

### Create User

This endpoint is used to create a new user in the specified user pool. It is an HTTP POST request to the designated URL. The request requires a raw body with the necessary user details. Upon successful execution, it returns a status code of `201` along with the created user data in the response body.

**POST** - `https://services.dapta.ai/authentication/{{users-pool}}/users/`

Body:

```json
{
    "username": "new_user",
    "password": "new_pass"
}

```

### List Users

This API endpoint is used to retrieve a list of all users in the specified user pool. It is an HTTP GET request to the designated URL. Upon successful execution, it returns a status code of `200` along with the list of users in the response body.

**GET** - `https://services.dapta.ai/authentication/{{users-pool}}/users/`

### Get User

This API endpoint is used to retrieve the details of a specific user in the specified user pool. It is an HTTP GET request to the designated URL with the user's unique identifier as a parameter. Upon successful execution, it returns a status code of `200` along with the user's data in the response body.

**GET** - `https://services.dapta.ai/authentication/{{users-pool}}/users/{{user-id}`}

### Update User

This endpoint is used to update the details of a specific user in the specified user pool. It is an HTTP PUT request to the designated URL with the user's unique identifier as a parameter. The request requires a raw body with the updated user details. Upon successful execution, it returns a status code of `204` .

**PATCH** - \[`https://services.dapta.ai/authentication/{{users-pool}}/users/{{user-id}}`

body

```json
{
    "username": "updated_user",
    "role": "ADMIN" / "USER"
}
```

### Delete User

This API endpoint is used to delete a specific user from the specified user pool. It is an HTTP DELETE request to the designated URL with the user's unique identifier as a parameter. Upon successful execution, it returns a status code of `204`, indicating a successful operation. The response body will be null.

**DELETE** - `https://services.dapta.ai/authentication/{{users-pool}}/users/{{user-id}}`

To test with your created pool you can download these postman requests:

> [DAPTA Auth.postman\_collection-2.json](https://daptaconfiguration.s3.us-east-2.amazonaws.com/features/docs/DAPTA+Auth.postman_collection.json)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.dapta.ai/product-guides/dapta-auth.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
