> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.wisboo.com/wisboo-api/users/update-user/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.wisboo.com/_mcp/server. # Update user PUT https://api.wisboo.com/v1/stores/{store_id}/users/{id} Content-Type: application/json Actualiza los atributos del perfil de un usuario existente. Todos los campos son opcionales — solo se actualizan los que se incluyen en el request. **Nota:** El email no puede modificarse con este endpoint. Utilizá el endpoint **Actualizar email** para ese caso. Reference: https://docs.wisboo.com/wisboo-api/users/update-user ## Authentication - `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer `, where token is your auth token. ## Request ### Path parameters - `store_id` (string, required) — ID de la tienda - `id` (string, required) — ID del usuario ### Body (application/json) This endpoint expects an object. - `name` (string, optional) - `last_name` (string, optional) - `phone` (string, optional) - `country` (string, optional) - `language` (string, optional) - `external_id` (string, optional) - `avatar` (any, optional, nullable) - `custom_fields` (V1StoresStoreIdUsersIdPutRequestBodyContentApplicationJsonSchemaCustomFields, optional) ## Response ### 200 Successful request - `id` (string, optional) - `name` (string, optional) - `last_name` (string, optional) - `email` (string, optional) - `created_at` (datetime, optional) - `country` (string, optional) — País del usuario en formato ISO-SO 3166-1 alpha-2 - `phone` (string, optional) - `external_id` (string, optional) - `language` (enum, optional) - Allowed values: `ES`, `PT`, `EN` - `avatar` (string, optional) - `custom_fields` (V1StoresStoreIdUsersIdPutResponsesContentApplicationJsonSchemaCustomFields, optional) ## Errors ### 404 Not Found Error User does not exist - `type` (string, optional) - `message` (string, optional) - `timestamp` (datetime, optional) - `log_id` (string, optional) - `request_id` (string, optional) ### 422 Unprocessable Entity Error Invalid parameters - `type` (string, optional) - `code` (string, optional) - `message` (string, optional) - `details` (list of V1StoresStoreIdUsersIdPutResponsesContentApplicationJsonSchemaDetailsItems, optional) - `timestamp` (datetime, optional) - `request_id` (string, optional) ## Types ### V1StoresStoreIdUsersIdPutRequestBodyContentApplicationJsonSchemaCustomFields ### V1StoresStoreIdUsersIdPutResponsesContentApplicationJsonSchemaCustomFields ### V1StoresStoreIdUsersIdPutResponsesContentApplicationJsonSchemaDetailsItems - `field` (string, optional) - `value` (string, optional) - `explanation` (string, optional) ## Examples **Request** ```json { "name": "John", "last_name": "Doe", "phone": "+5491134578457", "country": "AR", "language": "ES", "external_id": "ext_123", "avatar": null, "custom_fields": { "field1": "new_value" } } ``` **Response** ```json { "id": "USR-06a8ddc702a570008a88f53d1bd8e16e", "name": "John", "last_name": "Doe", "email": "john_doe@email.com", "created_at": "2024-10-13T23:14:28.651Z", "country": "PE", "external_id": "ext_123", "language": "ES", "avatar": "", "custom_fields": { "field1": "new_value" }, "role": "basic", "updated_at": "2024-10-14T00:45:46.527Z" } ``` **SDK Code** ```python Users_updateUser_example import requests url = "https://api.wisboo.com/v1/stores/:store_id/users/id" payload = { "name": "John", "last_name": "Doe", "phone": "+5491134578457", "country": "AR", "language": "ES", "external_id": "ext_123", "avatar": None, "custom_fields": { "field1": "new_value" } } headers = { "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.put(url, json=payload, headers=headers) print(response.json()) ``` ```javascript Users_updateUser_example const url = 'https://api.wisboo.com/v1/stores/:store_id/users/id'; const options = { method: 'PUT', headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'}, body: '{"name":"John","last_name":"Doe","phone":"+5491134578457","country":"AR","language":"ES","external_id":"ext_123","avatar":null,"custom_fields":{"field1":"new_value"}}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Users_updateUser_example package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.wisboo.com/v1/stores/:store_id/users/id" payload := strings.NewReader("{\n \"name\": \"John\",\n \"last_name\": \"Doe\",\n \"phone\": \"+5491134578457\",\n \"country\": \"AR\",\n \"language\": \"ES\",\n \"external_id\": \"ext_123\",\n \"avatar\": null,\n \"custom_fields\": {\n \"field1\": \"new_value\"\n }\n}") req, _ := http.NewRequest("PUT", url, payload) req.Header.Add("Authorization", "Bearer ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Users_updateUser_example require 'uri' require 'net/http' url = URI("https://api.wisboo.com/v1/stores/:store_id/users/id") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Put.new(url) request["Authorization"] = 'Bearer ' request["Content-Type"] = 'application/json' request.body = "{\n \"name\": \"John\",\n \"last_name\": \"Doe\",\n \"phone\": \"+5491134578457\",\n \"country\": \"AR\",\n \"language\": \"ES\",\n \"external_id\": \"ext_123\",\n \"avatar\": null,\n \"custom_fields\": {\n \"field1\": \"new_value\"\n }\n}" response = http.request(request) puts response.read_body ``` ```java Users_updateUser_example import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.put("https://api.wisboo.com/v1/stores/:store_id/users/id") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n \"name\": \"John\",\n \"last_name\": \"Doe\",\n \"phone\": \"+5491134578457\",\n \"country\": \"AR\",\n \"language\": \"ES\",\n \"external_id\": \"ext_123\",\n \"avatar\": null,\n \"custom_fields\": {\n \"field1\": \"new_value\"\n }\n}") .asString(); ``` ```php Users_updateUser_example request('PUT', 'https://api.wisboo.com/v1/stores/:store_id/users/id', [ 'body' => '{ "name": "John", "last_name": "Doe", "phone": "+5491134578457", "country": "AR", "language": "ES", "external_id": "ext_123", "avatar": null, "custom_fields": { "field1": "new_value" } }', 'headers' => [ 'Authorization' => 'Bearer ', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp Users_updateUser_example using RestSharp; var client = new RestClient("https://api.wisboo.com/v1/stores/:store_id/users/id"); var request = new RestRequest(Method.PUT); request.AddHeader("Authorization", "Bearer "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"name\": \"John\",\n \"last_name\": \"Doe\",\n \"phone\": \"+5491134578457\",\n \"country\": \"AR\",\n \"language\": \"ES\",\n \"external_id\": \"ext_123\",\n \"avatar\": null,\n \"custom_fields\": {\n \"field1\": \"new_value\"\n }\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Users_updateUser_example import Foundation let headers = [ "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = [ "name": "John", "last_name": "Doe", "phone": "+5491134578457", "country": "AR", "language": "ES", "external_id": "ext_123", "avatar": , "custom_fields": ["field1": "new_value"] ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.wisboo.com/v1/stores/:store_id/users/id")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "PUT" request.allHTTPHeaderFields = headers request.httpBody = postData as Data 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() ```