Skip to main content
GET
/
api
/
v1
/
users
/
me
Get Current User
curl --request GET \
  --url https://api.bunship.com/api/v1/users/me \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.bunship.com/api/v1/users/me"

headers = {"Authorization": "Bearer <token>"}

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

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

fetch('https://api.bunship.com/api/v1/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://api.bunship.com/api/v1/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>"
],
]);

$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://api.bunship.com/api/v1/users/me"

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

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://api.bunship.com/api/v1/users/me")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.bunship.com/api/v1/users/me")

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

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

response = http.request(request)
puts response.read_body
{
  "id": "usr_cld2abc123def456",
  "email": "user@example.com",
  "emailVerified": "2024-01-15T10:30:00Z",
  "fullName": "John Doe",
  "avatarUrl": "https://cdn.bunship.com/avatars/usr_cld2abc123.jpg",
  "preferences": {
    "theme": "dark",
    "language": "en",
    "timezone": "America/New_York",
    "notifications": {
      "email": true,
      "push": false
    }
  },
  "twoFactorEnabled": false,
  "isActive": true,
  "createdAt": "2024-01-15T10:00:00Z",
  "updatedAt": "2024-01-20T14:30:00Z"
}
Returns the profile information for the currently authenticated user.

Auth

Requires a valid Bearer token.

Response

id
string
Unique user identifier.
email
string
User’s email address.
emailVerified
string | null
ISO 8601 timestamp of when the email was verified, or null if unverified.
fullName
string | null
User’s display name.
avatarUrl
string | null
URL of the user’s avatar image.
preferences
object
User preferences including theme ("light", "dark", "system"), language, timezone, and notifications settings.
twoFactorEnabled
boolean
Whether two-factor authentication is enabled.
isActive
boolean
Whether the account is active.
createdAt
string
ISO 8601 account creation timestamp.
updatedAt
string
ISO 8601 last update timestamp.
{
  "id": "usr_cld2abc123def456",
  "email": "user@example.com",
  "emailVerified": "2024-01-15T10:30:00Z",
  "fullName": "John Doe",
  "avatarUrl": "https://cdn.bunship.com/avatars/usr_cld2abc123.jpg",
  "preferences": {
    "theme": "dark",
    "language": "en",
    "timezone": "America/New_York",
    "notifications": {
      "email": true,
      "push": false
    }
  },
  "twoFactorEnabled": false,
  "isActive": true,
  "createdAt": "2024-01-15T10:00:00Z",
  "updatedAt": "2024-01-20T14:30:00Z"
}

Errors

StatusCodeDescription
401AUTHENTICATION_ERRORMissing or invalid Bearer token
404NOT_FOUNDUser account not found or deactivated

Example

curl https://api.bunship.com/api/v1/users/me \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..."