Search Users(Deprecated)
curl --request GET \
--url https://{tenant}/api/users/search \
--header 'Authorization: Bearer <token>'import requests
url = "https://{tenant}/api/users/search"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{tenant}/api/users/search', 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://{tenant}/api/users/search",
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://{tenant}/api/users/search"
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://{tenant}/api/users/search")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant}/api/users/search")
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{
"pages": 1,
"users": [
{
"access_key": "d19fc75cd3aa497f6cb042f72e47ce8c",
"active": true,
"api_model": {},
"created_at": "2024-05-19T08:45:09.53319+03:00",
"email_address": "itachi.w@tyk.io",
"first_name": "sasuke",
"group_id": "",
"id": "363634393931653535373135656334633936636265663261",
"last_login_date": "2024-05-19T08:45:09.53319+03:00",
"last_name": "itachi",
"org_id": "5e9d9544a1dcd60001d0ed20",
"password_max_days": 0,
"password_updated": "2024-05-19T08:45:09.53319+03:00",
"user_permissions": {
"IsAdmin": "admin"
}
}
]
}{
"Message": "Not authorised",
"Meta": null,
"Status": "Error"
}{
"Message": "access denied: You do not have permission to access /api/users/search",
"Meta": null,
"Status": "Error"
}{
"Message": "Could not search users.",
"Meta": null,
"Status": "Error"
}Users
Search Users(Deprecated)
deprecated
This endpoint allows you to search for users by providing their email address as a query parameter.
GET
/
api
/
users
/
search
Search Users(Deprecated)
curl --request GET \
--url https://{tenant}/api/users/search \
--header 'Authorization: Bearer <token>'import requests
url = "https://{tenant}/api/users/search"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{tenant}/api/users/search', 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://{tenant}/api/users/search",
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://{tenant}/api/users/search"
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://{tenant}/api/users/search")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant}/api/users/search")
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{
"pages": 1,
"users": [
{
"access_key": "d19fc75cd3aa497f6cb042f72e47ce8c",
"active": true,
"api_model": {},
"created_at": "2024-05-19T08:45:09.53319+03:00",
"email_address": "itachi.w@tyk.io",
"first_name": "sasuke",
"group_id": "",
"id": "363634393931653535373135656334633936636265663261",
"last_login_date": "2024-05-19T08:45:09.53319+03:00",
"last_name": "itachi",
"org_id": "5e9d9544a1dcd60001d0ed20",
"password_max_days": 0,
"password_updated": "2024-05-19T08:45:09.53319+03:00",
"user_permissions": {
"IsAdmin": "admin"
}
}
]
}{
"Message": "Not authorised",
"Meta": null,
"Status": "Error"
}{
"Message": "access denied: You do not have permission to access /api/users/search",
"Meta": null,
"Status": "Error"
}{
"Message": "Could not search users.",
"Meta": null,
"Status": "Error"
}Authorizations
The Tyk Dashboard API Access Credentials
Query Parameters
Query term used to search for users (email address).
Use p query parameter to say which page you want returned. Send number less than 0 to return all items.
Was this page helpful?
⌘I