# User

This document outlines the endpoints available for managing users within the system. These endpoints facilitate operations such as fetching user data, creating new users, updating user information, and managing user passwords.

**1. Fetch All Users**

* **GET** `/api/v1/users`
* Retrieves information for all users.

**Response:**

```json
{
    "timestamp": "2024-05-29T09:48:42.776555",
    "size": 4,
    "data": [
        {
            "uuid": "b3cedc2d-3581-48bb-b588-42ad36bd2b1a",
            "name": "V****",
            "email": "v*@****.ch",
            "username": "v*****",
            "roleName": "ROLE_ADMIN",
            "createdAt": "2024-03-05T09:57:04.797901",
            "updatedAt": "2024-03-22T16:02:18.757387"
        },
        {
            "uuid": "dee1f3b2-d268-4dc3-afba-469c14c61a7c",
            "name": "M****",
            "email": "m*@****.ch",
            "username": "m****",
            "roleName": "ROLE_USER",
            "createdAt": "2024-03-22T13:59:26.133148",
            "updatedAt": "2024-03-22T13:59:47.591019"
        },
        {
            "uuid": "94ef5637-e744-427f-9854-db13a2e52489",
            "name": "T****",
            "email": "t***@****.com",
            "username": "Testing",
            "roleName": "ROLE_ADMIN",
            "createdAt": "2024-03-22T14:59:01.223698",
            "updatedAt": "2024-03-22T14:59:01.22371"
        },
        {
            "uuid": "04d86365-69ac-4016-bad2-09ebd612358e",
            "name": "M****",
            "email": "m*@*****.ch",
            "username": "goodcode",
            "roleName": "ROLE_REGISTRAR",
            "createdAt": "2024-02-07T12:10:54.710621",
            "updatedAt": "2024-03-12T16:17:14.738392"
        }
    ]
}
```

**2. Fetch User by Uuid**

* **GET** `/api/v1/users/{uuid}`
* Retrieves information based on the provided uuid.

**Response**

```json
{
    "timestamp": "2024-05-29T09:55:17.01184",
    "data": {
        "uuid": "a9f03423-2b64-4b13-bf84-b340aca5d3e4",
        "name": "t*****",
        "email": "t*****@*****.com",
        "username": "t****",
        "roleName": "ROLE_ADMIN",
        "createdAt": "2024-04-08T13:29:48.867959",
        "updatedAt": "2024-04-15T08:44:50.834691"
    }
}
```

**3. Fetch Current User**

* **GET** `/api/v1/users/self`
* Retrieves information for the currently authenticated user.

**Response:**

```json
{
    "timestamp": "2024-05-29T10:06:18.173313",
    "data": {
        "uuid": "b3cedc2d-3581-48bb-b588-42ad36bd2b1a",
        "name": "V*****",
        "email": "v*@*****.ch",
        "username": "v****",
        "roleName": "ROLE_ADMIN",
        "createdAt": "2024-03-05T09:57:04.797901",
        "updatedAt": "2024-03-22T16:02:18.757387"
    }
}
```

**4. Fetch User by Username or Role**

* **GET** `/api/v1/users?username={desired_username}`
* Retrieves information for a user by their username.
* **GET** `/api/v1/users?role={desired_role}`
* Retrieves information for users with a specific role.

**Response:**

```json
{
    "timestamp": "2024-05-29T10:06:18.173313",
    "data": {
        "uuid": "b3cedc2d-3581-48bb-b588-42ad36bd2b1a",
        "name": "V*****",
        "email": "v*@****.ch",
        "username": "v*****",
        "roleName": "ROLE_ADMIN",
        "createdAt": "2024-03-05T09:57:04.797901",
        "updatedAt": "2024-03-22T16:02:18.757387"
    }
}
```


---

# 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://freename-1.gitbook.io/freename-apis/web2-web3-mirroring-api/user.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.
