Skip to main content
GET
/
users
/
me
Get current user
curl --request GET \
  --url https://{host}/users/me \
  --header 'Authorization: Bearer <token>' \
  --header 'x-user-id: <x-user-id>'
import requests

url = "https://{host}/users/me"

headers = {
"x-user-id": "<x-user-id>",
"Authorization": "Bearer <token>"
}

response = requests.get(url, headers=headers)

print(response.text)
const options = {
method: 'GET',
headers: {'x-user-id': '<x-user-id>', Authorization: 'Bearer <token>'}
};

fetch('https://{host}/users/me', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://{host}/users/me",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"x-user-id: <x-user-id>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://{host}/users/me"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("x-user-id", "<x-user-id>")
req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://{host}/users/me")
.header("x-user-id", "<x-user-id>")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://{host}/users/me")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-user-id"] = '<x-user-id>'
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "id": "64f0c51e7fb3fc001234a001",
  "email": "john.doe@example.com",
  "firstName": "John",
  "lastName": "Doe",
  "dateOfBirth": "1990-05-15",
  "residencyCountry": "GR",
  "language": "en",
  "portfolios": [
    {
      "id": "64f0c51e7fb3fc001234def0",
      "currency": "EUR",
      "holdings": [
        {
          "isin": "US0378331005",
          "assetCommonId": "equities_apple",
          "quantity": 12.5
        }
      ],
      "targetAllocation": [
        {
          "assetCommonId": "equities_apple",
          "percentage": 100
        }
      ],
      "createdAt": "2024-03-01T10:00:00.000Z",
      "updatedAt": "2024-07-10T12:00:00.000Z"
    }
  ],
  "address": {
    "line1": "15 Ermou Street",
    "line2": "Apartment 4B",
    "city": "Athens",
    "postalCode": 10563,
    "countryCode": "GR"
  },
  "taxResidency": {
    "countryCode": "GR",
    "proofType": "TIN",
    "value": "123456789"
  },
  "createdAt": "2024-10-03T10:30:00Z",
  "updatedAt": "2024-10-03T10:30:00Z"
}

Authorizations

Authorization
string
header
required

Auth0-issued access token that includes the scopes listed for the endpoint.

Headers

x-user-id
string
required

MongoDB ObjectId of the authenticated user

Pattern: ^[a-f0-9]{24}$

Response

User retrieved successfully

id
string
required

MongoDB ObjectId of the user

Pattern: ^[a-f0-9]{24}$
Example:

"64f0c51e7fb3fc001234a001"

email
string<email>
required
Example:

"john.doe@example.com"

portfolios
object[]
required

Array of user's portfolios with holdings and target allocation

createdAt
string<date-time>
required

Timestamp when the user was created

Example:

"2024-10-03T10:30:00Z"

updatedAt
string<date-time>
required

Timestamp when the user was last updated

Example:

"2024-10-03T10:30:00Z"

firstName
string
Example:

"John"

lastName
string
Example:

"Doe"

dateOfBirth
string<date>
Example:

"1990-05-15"

residencyCountry
string
Example:

"GR"

language
enum<string>

User's preferred language. Valid values are "en" (English) or "el" (Greek).

Available options:
en,
el
Example:

"en"

address
object
taxResidency
object
nationalities
string[]

Array of two-letter ISO country codes for user's nationality (citizenship)

Pattern: ^[A-Z]{2}$
Example:
["GR"]
employmentInfo
object

Employment and source of wealth information (optional)