> For the complete documentation index, see [llms.txt](https://docs.amitysolutions.com/ekoai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.amitysolutions.com/ekoai/api-reference/botv2/botv2-api/get-user-info.md).

# Get User Info

## Get userId by username

<mark style="color:blue;">`GET`</mark> `http://h1.eko12.local`/bot/v1/users?username=:username

Returns the uid of username in parameter

#### Headers

| Name          | Type            | Description                               |
| ------------- | --------------- | ----------------------------------------- |
| Authorization | Bearer \<token> | Access Token (needs to have "bot" scope). |

#### Path Parameters

| Name     | Type   | Description |
| -------- | ------ | ----------- |
| username | string | username    |

{% tabs %}
{% tab title="200 Returns the User info." %}

```
{
    "users": [
        {
            "_id": "id",
            "username": "username",
            "email": "email",
            "firstname": "firstname",
            "lastname": "lastname",
            "position": "",
            "deleted": false
        }
    ]
}
```

{% endtab %}
{% endtabs %}

## Get User Info

<mark style="color:blue;">`GET`</mark> `http://h1.eko12.local/bot/v2/groups/:gid/users/:uid/info`

Returns the User info, if both the user and the bot are in the specific group.

#### Path Parameters

| Name | Type   | Description |
| ---- | ------ | ----------- |
| gid  | string | Group ID    |
| uid  | string | User ID     |

#### Headers

| Name           | Type   | Description                        |
| -------------- | ------ | ---------------------------------- |
| Authentication | string | Token (needs to have "bot" scope). |

{% tabs %}
{% tab title="200 Returns the User info." %}

```
{
    "_id": "5d563332aa9799106b5ffgh3",
    "firstname": "John",
    "lastname": "Doe",
    "avatar": "https://sample-url.com/john.jpg",
    "network_admin": true
}
```

{% endtab %}
{% endtabs %}


---

# 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 dynamically by asking a question.

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

```
GET https://docs.amitysolutions.com/ekoai/api-reference/botv2/botv2-api/get-user-info.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
