# Consultar usuario

Consulte los detalles de los usuarios en su comercio. Utilice esta funcionalidad para acceder a la información específica de cada usuario, incluyendo sus roles o privilegios dentro de Trazo. Asegúrese de tener a mano la información necesaria sobre el usuario que desea consultar para facilitar y asegurar el acceso rápido y efectivo a sus datos en el sistema.

{% hint style="warning" %}
Únicamente se podrán consultar usuarios que pertenezcan al comercio.&#x20;
{% endhint %}

## Ruta

<mark style="color:green;">`GET`</mark> `/v1/merchant/team/{phone|email}`

## **Encabezado**

| Name                                                   | Value            |
| ------------------------------------------------------ | ---------------- |
| `Content-Type`                                         | application/json |
| `x-auth-token`*<mark style="color:red;">**\***</mark>* | {token}          |

## **Respuesta**

{% tabs %}
{% tab title="200  (Usuario propio)" %}

```json
{
    "phone": "573112223333",
    "email": "trazo@gmail.com",
    "external_user_id": "UWU71A",
    "first_name": "DIEGO",
    "last_name": "PEREZ",
    "user_id_type": "CC",
    "user_id_number": "1234567890",
    "user_id_number_dv": "",
    "role": "collector",
    "user_country": "Colombia",
    "user_state": "Cundinamarca",
    "user_city": "Bogotá",
    "user_status": "active"
}
```

{% endtab %}

{% tab title="200  (Usuario externo)" %}

```json
{
    "phone": "57***33",
    "email": "da***om",
    "first_name": "Da***na",
    "last_name": "Va***a ",
    "user_id_type": "CC",
    "user_id_number": "17***12"
}
```

{% endtab %}

{% tab title="404" %}

```json
{
    "error": "The user with 5731122233333 is not registered in the system."
}
```

{% endtab %}
{% endtabs %}

## Ejemplo

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

```bash
curl --location '{{base_url}}/v1/merchant/team/573112223333' \
--header 'x-auth-token: {{token}}' 
```

{% endtab %}

{% tab title="NodeJS (Axios)" %}

```javascript
const axios = require('axios');

let config = {
  method: 'get',
  maxBodyLength: Infinity,
  url: `${base_url}/v1/merchant/team/573112223333`,
  headers: { 
    'x-auth-token': token //Añadir token
  }
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = f"{base_url}/v1/merchant/team/573112223333"

payload = {}
headers = {
  'x-auth-token': token #Añadir token
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

```

{% endtab %}
{% endtabs %}


---

# 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://docs.qentaz.com/documentation/equipo/consultar-usuario.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.
