curl --request GET \
--url https://cloud-api.near.ai/v1/admin/users \
--header 'Authorization: Bearer <token>'import requests
url = "https://cloud-api.near.ai/v1/admin/users"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://cloud-api.near.ai/v1/admin/users', 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://cloud-api.near.ai/v1/admin/users",
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://cloud-api.near.ai/v1/admin/users"
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://cloud-api.near.ai/v1/admin/users")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud-api.near.ai/v1/admin/users")
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{
"limit": 123,
"offset": 123,
"total": 123,
"users": [
{
"auth_provider": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"email": "<string>",
"id": "<string>",
"is_active": true,
"provider_user_id": "<string>",
"avatar_url": "<string>",
"display_name": "<string>",
"last_login_at": "2023-11-07T05:31:56Z",
"organizations": [
{
"id": "<string>",
"name": "<string>",
"currentUsage": {
"total_requests": 123,
"total_spent": 123,
"total_spent_display": "<string>",
"total_tokens": 123
},
"description": "<string>",
"spendLimit": {
"amount": 123,
"currency": "<string>",
"scale": 123
}
}
],
"username": "<string>"
}
]
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}List all registered users with pagination (Admin only)
Returns a paginated list of all users in the system. Only authenticated admins can perform this operation.
curl --request GET \
--url https://cloud-api.near.ai/v1/admin/users \
--header 'Authorization: Bearer <token>'import requests
url = "https://cloud-api.near.ai/v1/admin/users"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://cloud-api.near.ai/v1/admin/users', 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://cloud-api.near.ai/v1/admin/users",
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://cloud-api.near.ai/v1/admin/users"
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://cloud-api.near.ai/v1/admin/users")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud-api.near.ai/v1/admin/users")
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{
"limit": 123,
"offset": 123,
"total": 123,
"users": [
{
"auth_provider": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"email": "<string>",
"id": "<string>",
"is_active": true,
"provider_user_id": "<string>",
"avatar_url": "<string>",
"display_name": "<string>",
"last_login_at": "2023-11-07T05:31:56Z",
"organizations": [
{
"id": "<string>",
"name": "<string>",
"currentUsage": {
"total_requests": 123,
"total_spent": 123,
"total_spent_display": "<string>",
"total_tokens": 123
},
"description": "<string>",
"spendLimit": {
"amount": 123,
"currency": "<string>",
"scale": 123
}
}
],
"username": "<string>"
}
]
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}Authorizations
JWT access token for user authentication (Authorization: Bearer <jwt_token>). Create via POST /users/me/access_tokens.
Query Parameters
Maximum number of users to return (default: 100)
Number of users to skip (default: 0)
Whether to include organization information and spend limits for the first organization owned by each user (default: false)
Filter users by email, username, display name, user id, auth provider, or provider user id (case-insensitive partial match).
Filter users by active status. Omit to include active and inactive users.
Filter users by organization name (case-insensitive match). Only effective when include_organizations=true; separate from user search.