> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://respan.ai/docs/apis/users/get-user/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://respan.ai/_mcp/server. # Get a user GET https://api.respan.ai/api/users/{customer_identifier}/ Returns the user's editable profile and current budget usage. Reference: https://respan.ai/docs/apis/users/get-user ## Authentication - `Authorization` header (bearer token, required) — Use your Respan API key for Respan API authentication. Enter only the Respan API key value; clients send Authorization: Bearer \. For /api/responses, provider credentials such as Perplexity, OpenAI, or Azure OpenAI go in Settings -> Providers or respan\_params.credential\_override in the request body, not in this authentication field. - `Authorization` header (bearer token, required) — Use a dashboard JWT only for dashboard-authenticated endpoints. Respan API-key endpoints use the respanApiKey auth field instead. ## Request ### Path parameters - `customer_identifier` (string, required) — Your unique identifier for this user. ### Query parameters - `environment` (enum, optional) — Optional environment filter. If omitted, the backend uses the environment implied by your auth context when applicable. - Allowed values: `prod`, `test` ## Response ### 200 User details. - `id` (string, optional) — User identifier. - `name` (string, optional, nullable) — User display name. - `email` (string, optional, nullable) — User email address. - `customer_identifier` (string, optional) — Your unique identifier for the user. - `environment` (enum, optional) — User environment. - Allowed values: `prod`, `test` - `total_budget` (double, optional, nullable) — Lifetime spending budget in USD. - `period_budget` (double, optional, nullable) — Current period budget in USD. - `organization_name` (string, optional, nullable) — Owning organization name. - `total_period_usage` (double, optional) — Usage in the current budget period in USD. - `period_start` (datetime, optional) — Start of the current budget period. - `period_end` (datetime, optional, nullable) — End of the current budget period. - `budget_duration` (enum, optional) — Budget renewal period. - Allowed values: `daily`, `weekly`, `monthly` - `updated_at` (datetime, optional) — Last update timestamp. ## Errors ### 403 Forbidden Error The API key is missing, invalid or expired. - `detail` (string, required) ### 404 Not Found Error Not Found - `detail` (string, optional) ### 429 Too Many Requests Error Rate Limited - `detail` (string, optional) ### 500 Internal Server Error Internal Server Error - `detail` (string, optional) ## Examples **Response** ```json { "id": "user_123", "name": "John Doe", "email": "john@example.com", "customer_identifier": "user_123", "environment": "prod", "total_budget": 1000, "period_budget": 100, "organization_name": "Acme Inc", "total_period_usage": 45.67, "period_start": "2025-12-01T00:00:00Z", "period_end": null, "budget_duration": "monthly", "updated_at": "2025-12-29T10:30:00Z" } ``` **SDK Code** ```python Users_retrieveUser_example import requests url = "https://api.respan.ai/api/users/customer_identifier/" querystring = {"environment":"prod"} headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers, params=querystring) print(response.json()) ``` ```javascript Users_retrieveUser_example const url = 'https://api.respan.ai/api/users/customer_identifier/?environment=prod'; const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Users_retrieveUser_example package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.respan.ai/api/users/customer_identifier/?environment=prod" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Users_retrieveUser_example require 'uri' require 'net/http' url = URI("https://api.respan.ai/api/users/customer_identifier/?environment=prod") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` ```java Users_retrieveUser_example import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api.respan.ai/api/users/customer_identifier/?environment=prod") .header("Authorization", "Bearer ") .asString(); ``` ```php Users_retrieveUser_example request('GET', 'https://api.respan.ai/api/users/customer_identifier/?environment=prod', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ``` ```csharp Users_retrieveUser_example using RestSharp; var client = new RestClient("https://api.respan.ai/api/users/customer_identifier/?environment=prod"); var request = new RestRequest(Method.GET); request.AddHeader("Authorization", "Bearer "); IRestResponse response = client.Execute(request); ``` ```swift Users_retrieveUser_example import Foundation let headers = ["Authorization": "Bearer "] let request = NSMutableURLRequest(url: NSURL(string: "https://api.respan.ai/api/users/customer_identifier/?environment=prod")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```