Get User
curl --request GET \
--url https://api.example.com/api/users/{user_id}import requests
url = "https://api.example.com/api/users/{user_id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/users/{user_id}', 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.example.com/api/users/{user_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.example.com/api/users/{user_id}"
req, _ := http.NewRequest("GET", url, nil)
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.example.com/api/users/{user_id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/users/{user_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"id": "<string>",
"email": "<string>",
"username": "<string>",
"role": "<string>",
"name": "<string>",
"profile_image_url": "<string>",
"profile_banner_image_url": "<string>",
"bio": "<string>",
"gender": "<string>",
"date_of_birth": "<string>",
"timezone": "<string>",
"presence_state": "<string>",
"status_emoji": "<string>",
"status_message": "<string>",
"status_expires_at": 123,
"info": {},
"settings": {
"ui": {}
},
"oauth": {},
"scim": {},
"last_active_at": 123,
"updated_at": 123,
"created_at": 123,
"groups": [
{
"id": "<string>",
"name": "<string>"
}
],
"is_active": true
}Users & Groups
Get User
GET
/
api
/
users
/
{user_id}
Get User
curl --request GET \
--url https://api.example.com/api/users/{user_id}import requests
url = "https://api.example.com/api/users/{user_id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/users/{user_id}', 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.example.com/api/users/{user_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.example.com/api/users/{user_id}"
req, _ := http.NewRequest("GET", url, nil)
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.example.com/api/users/{user_id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/users/{user_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"id": "<string>",
"email": "<string>",
"username": "<string>",
"role": "<string>",
"name": "<string>",
"profile_image_url": "<string>",
"profile_banner_image_url": "<string>",
"bio": "<string>",
"gender": "<string>",
"date_of_birth": "<string>",
"timezone": "<string>",
"presence_state": "<string>",
"status_emoji": "<string>",
"status_message": "<string>",
"status_expires_at": 123,
"info": {},
"settings": {
"ui": {}
},
"oauth": {},
"scim": {},
"last_active_at": 123,
"updated_at": 123,
"created_at": 123,
"groups": [
{
"id": "<string>",
"name": "<string>"
}
],
"is_active": true
}Retrieves detailed information about a specific user, including their groups and active status.
Authentication
Requires admin authentication.Path Parameters
string
required
The unique identifier of the user. Can also accept
shared-{chat_id} format to retrieve the user from a shared chat.Response
string
Unique user identifier
string
User email address
string
Username (optional)
string
User role:
admin, user, or pendingstring
User display name
string
URL to user’s profile image
string
URL to user’s profile banner image
string
User biography
string
User gender
string
User date of birth (ISO date format)
string
User timezone
string
User presence state
string
Status emoji
string
Status message text
integer
Unix timestamp when status expires
object
Additional user information (JSON)
object
OAuth authentication data
object
SCIM provisioning data
integer
Unix timestamp of last activity
integer
Unix timestamp of last update
integer
Unix timestamp of creation
boolean
Whether the user is currently active (last active within 3 minutes)
Example Request
curl -X GET "https://your-domain.com/api/users/user-123" \
-H "Authorization: Bearer YOUR_TOKEN"
Example Response
{
"id": "user-123",
"email": "user@example.com",
"username": "johndoe",
"role": "user",
"name": "John Doe",
"profile_image_url": "/api/v1/users/user-123/profile/image",
"bio": "Software developer",
"timezone": "America/New_York",
"status_emoji": "💻",
"status_message": "Working on a project",
"last_active_at": 1709424000,
"updated_at": 1709424000,
"created_at": 1709337600,
"groups": [
{
"id": "group-1",
"name": "Engineering"
},
{
"id": "group-2",
"name": "Admins"
}
],
"is_active": true
}
Notes
- Active status is determined by last activity within 3 minutes
- Can resolve user from shared chats using
shared-{chat_id}format - Returns 400 error if user not found
- Returns 403 error if action is prohibited (e.g., accessing primary admin)