curl --request GET \
--url https://api.petstoreapi.com/v1/users/{id}import requests
url = "https://api.petstoreapi.com/v1/users/{id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.petstoreapi.com/v1/users/{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.petstoreapi.com/v1/users/{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.petstoreapi.com/v1/users/{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.petstoreapi.com/v1/users/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.petstoreapi.com/v1/users/{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": "019b4138-e0af-70b9-8f0c-6ea97d495dfa",
"username": "ameliehackett",
"firstName": "Amelie",
"lastName": "Hackett",
"email": "amelie.hackett@example.com",
"phone": "+16324377270",
"createdAt": "2025-12-21T13:56:23Z",
"updatedAt": "2025-12-21T13:56:23Z"
}{
"type": "https://petstoreapi.com/errors/bad-request",
"title": "Bad Request",
"status": 400,
"detail": "Invalid value for parameter 'status'. Must be one of: available, pending, sold.",
"instance": "/pets"
}{
"type": "https://petstoreapi.com/errors/not-found",
"title": "Not Found",
"status": 404,
"detail": "The requested pet with ID '123' was not found.",
"instance": "/pets/123"
}Get User
Retrieve user information by user ID.
curl --request GET \
--url https://api.petstoreapi.com/v1/users/{id}import requests
url = "https://api.petstoreapi.com/v1/users/{id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.petstoreapi.com/v1/users/{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.petstoreapi.com/v1/users/{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.petstoreapi.com/v1/users/{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.petstoreapi.com/v1/users/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.petstoreapi.com/v1/users/{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": "019b4138-e0af-70b9-8f0c-6ea97d495dfa",
"username": "ameliehackett",
"firstName": "Amelie",
"lastName": "Hackett",
"email": "amelie.hackett@example.com",
"phone": "+16324377270",
"createdAt": "2025-12-21T13:56:23Z",
"updatedAt": "2025-12-21T13:56:23Z"
}{
"type": "https://petstoreapi.com/errors/bad-request",
"title": "Bad Request",
"status": 400,
"detail": "Invalid value for parameter 'status'. Must be one of: available, pending, sold.",
"instance": "/pets"
}{
"type": "https://petstoreapi.com/errors/not-found",
"title": "Not Found",
"status": 404,
"detail": "The requested pet with ID '123' was not found.",
"instance": "/pets/123"
}Headers
Optional tenant identifier for data isolation. When provided, all operations will be scoped to this tenant, ensuring data separation between different organizations or users. If omitted, operations will access the shared/public data pool where data may be visible to and modified by other users.
Path Parameters
Unique identifier for the user
Response
Operation successful
User account information
Unique user identifier (UUID v7)
"019b4138-e0af-70b9-8f0c-6ea97d495dfa"
"019b4128-6a6b-777c-9ae8-335e962c68d8"
Unique username for login
3 - 50"johndoe"
"mysqluser"
User email address
"user@example.com"
"john.doe@petstore.com"
User's first name
"John"
"Jane"
User's last name
"Doe"
"Smith"
Account creation timestamp (RFC 3339)
"2025-12-21T13:56:23Z"
"2025-11-15T08:30:00Z"
Account last update timestamp (RFC 3339)
"2025-12-21T13:56:23Z"
"2025-12-21T15:30:45Z"
Phone number in E.164 format
^\+?[1-9]\d{1,14}$"+12025551234"
Optional tenant identifier for data isolation. When present, indicates this user belongs to a specific tenant. Null or omitted means the user is in the shared/public data pool.
"550e8400-e29b-41d4-a716-446655440000"
"7c9e6679-7425-40de-944b-e07fc1f90ae7"
Show child attributes
Show child attributes