# Get Current User

{% hint style="info" %}
Get User Information based on Access Token
{% endhint %}

***

## Get User Information

<img src="https://203590333-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIHuU6kmTWQfXxOUkN7No%2Fuploads%2FErKyxDXM3dIxE7rXRr4u%2Ffile.excalidraw.svg?alt=media&#x26;token=1205af70-bcb0-425c-a8a0-a01cce8f0e54" alt="API:- https://matar.in.ngrok.io/api/v1/get_current_user" class="gitbook-drawing">

### Params

**Header Parameter ⬇️**

<table data-full-width="false"><thead><tr><th width="188.33333333333331">Header Parameter</th><th width="129">Data Type</th><th>Description</th></tr></thead><tbody><tr><td><strong>Bearer {{access_token}} </strong><mark style="color:red;"><strong>(required)</strong></mark></td><td>String</td><td><p>Provide Access Token for fetching User Account Details. Access Token is generated via the Submit OTP API endpoint.</p><p></p><p>Sample Access Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJmcmVzaCI6dHJ1ZSwiaWF0IjoxNjgwMDI0MDIzLCJqdGkiOiI3NDQ0YWRjOS1lMDk4LTQ3YmEtOWYxZS04MmQ5MjgzMzAzMjYiLCJ0eXBlIjoiYWNjZXNzIiwic3ViIjoiRVFPS1NVIiwibmJmIjoxNjgwMDI0MDIzLCJleHAiOjE2ODAxOTY4MjN9.UWYCZXenkVS-SVgHlncOht-ckloNcPilUPoYAmH2Yfw.</p></td></tr></tbody></table>

***

**Sample Request ⬇️️ (Header Parameter)**

```
curl --location 'https://matar.in.ngrok.io/api/v1/get_current_user' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJmcmVzaCI6dHJ1ZSwiaWF0IjoxNjgwMDI0MDIzLCJqdGkiOiI3NDQ0YWRjOS1lMDk4LTQ3YmEtOWYxZS04MmQ5MjgzMzAzMjYiLCJ0eXBlIjoiYWNjZXNzIiwic3ViIjoiRVFPS1NVIiwibmJmIjoxNjgwMDI0MDIzLCJleHAiOjE2ODAxOTY4MjN9.UWYCZXenkVS-SVgHlncOht-ckloNcPilUPoYAmH2Yfw'
```

**Responses ⬇️**

Status Code: **🟢200** (200 denotes **'ok'**)

```200
{
    "_id": "39501T",
    "image_url": null,
    "language": "hi-IN",
    "name": "Sri",
    "phone_number": "917254326789",
    "roles": {
        "default": [
            "129487316"
        ]
    }
}
```

Status Code: 🔴**401** (401 denotes **'Unauthorized'**)

```
{
    "description": "The token has expired.",
    "error": "token_expired"
}
```

***

**Response Parameters Description:**

<table><thead><tr><th width="247">Response Parameter</th><th>Description</th></tr></thead><tbody><tr><td>_id</td><td>User ID</td></tr><tr><td>image_url</td><td>User Profile Image URL or Avatar</td></tr><tr><td>language</td><td>Language in which the user has signed in. To see all language types check <a href="https://app.archbee.com/public/PREVIEW-o7hw14NiYUSoBh_fwO3tH/PREVIEW-uN5Grg_GVNAr5Zv5aKjrc#OYc7P">Get all Languages</a> API Endpoint.</td></tr><tr><td>name</td><td>Name for the User Account</td></tr><tr><td>phone_number</td><td>Phone Number Linked to User Account</td></tr><tr><td>roles : default :</td><td>This contains the organization ID in which the User has joined. To see the list of all organizations by org ID check <a href="https://app.archbee.com/public/PREVIEW-o7hw14NiYUSoBh_fwO3tH/PREVIEW-nV9vykmU0cOZb1Q6ju0X0#uJGco">Get List of organizations</a> API endpoint.</td></tr></tbody></table>
