> For a complete page index, fetch https://docs.transak.com/llms.txt # Patch User Details PATCH https://api-gateway-stg.transak.com/api/v2/kyc/user Content-Type: application/json The **Patch User Details** for **Personal Details and Address details** is an **authenticated API call** that allows updating a user’s **personal and address details**. The response follows the **same schema as** `getUser()`, returning the updated user profile. The **fields that can be updated** via patchUser include: - **Personal Details:** firstName, lastName, mobileNumber, dob - **Address Details**: addressLine1, addressLine2, state, city, postCode, countryCode Any modifications to user data must comply with **KYC requirements**, and certain updates may require the user to re-submit verification documents. **Note:** 1. If a country does not have a state, the country name can be passed (e.g. Dubai). 2. If a country does not have a postal code, the postal code can be passed as `000000`. Reference: https://docs.transak.com/api/whitelabel/kyc/patch-user-details ## Request ### Query parameters - `apiKey` (string, required) — Your API Key from Transak Dashboard ### Headers - `x-user-ip` (string, required) — End user's originating IP. More details [here](/guides/mandatory-security-changes#user-ip-header-in-apis) - `x-api-key` (string, required) — Partner API Key present in Transak Dashboard. - `authorization` (string, optional) — Authorization token is the accessToken received from the API -` api/v2/auth/verify` Note: This is not applicable for [Auth Reliance Flows](/features/auth-reliance) - `x-user-identifier` (string, optional) — Your authenticated user Email Id address. Note: This is applicable only for [Auth Reliance Flows](/features/auth-reliance) - `x-access-token` (string, optional) — Your Partner Access Token. Please refer [here](/guides/how-to-create-partner-access-token) for a tutorial on generating your access token. Note: This is applicable only for [Auth Reliance Flows](/features/auth-reliance) ### Body (application/json) This endpoint expects an object. - `personalDetails` (ApiV2KycUserPatchRequestBodyContentApplicationJsonSchemaPersonalDetails, required) - `addressDetails` (ApiV2KycUserPatchRequestBodyContentApplicationJsonSchemaAddressDetails, required) ## Response ### 200 200 - Success - `data` (ApiV2KycUserPatchResponsesContentApplicationJsonSchemaData, required) ## Errors ### 400 Bad Request Error 400 - Under Age User - `error` (ApiV2KycUserPatchResponsesContentApplicationJsonSchemaError, required) ### 401 Unauthorized Error 401 - Unauthorized - `error` (ApiV2KycUserPatchResponsesContentApplicationJsonSchemaError, required) ### 404 Not Found Error 404 - User Not Found - `error` (ApiV2KycUserPatchResponsesContentApplicationJsonSchemaError, required) ### 500 Internal Server Error 500 - Internal Server Error - `error` (ApiV2KycUserPatchResponsesContentApplicationJsonSchemaError, required) ## Types ### ApiV2KycUserPatchRequestBodyContentApplicationJsonSchemaPersonalDetails - `firstName` (string, required) - `lastName` (string, required) - `mobileNumber` (string, required) - `dob` (string, required) ### ApiV2KycUserPatchRequestBodyContentApplicationJsonSchemaAddressDetails - `addressLine1` (string, required) - `state` (string, required) - `city` (string, required) - `postCode` (string, required) - `countryCode` (string, required) - `addressLine2` (string, optional) ### ApiV2KycUserPatchResponsesContentApplicationJsonSchemaData - `partnerUserId` (string, required) - `firstName` (string, required) - `lastName` (string, required) - `email` (string, required) - `mobileNumber` (string, required) - `status` (string, required) - `dob` (string, required) - `kyc` (ApiV2KycUserPatchResponsesContentApplicationJsonSchemaDataKyc, required) - `address` (ApiV2KycUserPatchResponsesContentApplicationJsonSchemaDataAddress, required) ### ApiV2KycUserPatchResponsesContentApplicationJsonSchemaError - `statusCode` (integer, required) - `message` (string, required) ### ApiV2KycUserPatchResponsesContentApplicationJsonSchemaDataKyc - `status` (string, required) - `type` (string, required, nullable) ### ApiV2KycUserPatchResponsesContentApplicationJsonSchemaDataAddress - `addressLine1` (string, required) - `addressLine2` (string, required) - `state` (string, required) - `city` (string, required) - `postCode` (string, required) - `country` (string, required) - `countryCode` (string, required) ## Examples **Request** ```json { "personalDetails": { "firstName": "", "lastName": "", "mobileNumber": "", "dob": "" }, "addressDetails": { "addressLine1": "", "state": "", "city": "", "postCode": "", "countryCode": "" } } ``` **Response** ```json { "data": { "partnerUserId": "ab6ed909-ccc4-49a4-849f-bffd83840daa", "firstName": "Doe", "lastName": "Jane", "email": "test@transak.com", "mobileNumber": "+911234567890", "status": "ACTIVE", "dob": "1998-01-01T00:00:00.000Z", "kyc": { "status": "NOT_SUBMITTED", "type": null }, "address": { "addressLine1": "170 Rue du Faubourg Saint-Denis, Paris", "addressLine2": "", "state": "Paris", "city": "Paris", "postCode": "75010", "country": "France", "countryCode": "FR" } } } ``` **SDK Code** ```python Success Patch User Details import requests url = "https://api-gateway-stg.transak.com/api/v2/kyc/user" querystring = {"apiKey":""} payload = { "personalDetails": { "firstName": "", "lastName": "", "mobileNumber": "", "dob": "" }, "addressDetails": { "addressLine1": "", "state": "", "city": "", "postCode": "", "countryCode": "" } } headers = { "x-api-key": "", "x-user-ip": "", "Content-Type": "application/json" } response = requests.patch(url, json=payload, headers=headers, params=querystring) print(response.json()) ``` ```javascript Success Patch User Details const url = 'https://api-gateway-stg.transak.com/api/v2/kyc/user?apiKey='; const options = { method: 'PATCH', headers: {'x-api-key': '', 'x-user-ip': '', 'Content-Type': 'application/json'}, body: '{"personalDetails":{"firstName":"","lastName":"","mobileNumber":"","dob":""},"addressDetails":{"addressLine1":"","state":"","city":"","postCode":"","countryCode":""}}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Success Patch User Details package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api-gateway-stg.transak.com/api/v2/kyc/user?apiKey=" payload := strings.NewReader("{\n \"personalDetails\": {\n \"firstName\": \"\",\n \"lastName\": \"\",\n \"mobileNumber\": \"\",\n \"dob\": \"\"\n },\n \"addressDetails\": {\n \"addressLine1\": \"\",\n \"state\": \"\",\n \"city\": \"\",\n \"postCode\": \"\",\n \"countryCode\": \"\"\n }\n}") req, _ := http.NewRequest("PATCH", url, payload) req.Header.Add("x-api-key", "") req.Header.Add("x-user-ip", "") 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 Success Patch User Details require 'uri' require 'net/http' url = URI("https://api-gateway-stg.transak.com/api/v2/kyc/user?apiKey=") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Patch.new(url) request["x-api-key"] = '' request["x-user-ip"] = '' request["Content-Type"] = 'application/json' request.body = "{\n \"personalDetails\": {\n \"firstName\": \"\",\n \"lastName\": \"\",\n \"mobileNumber\": \"\",\n \"dob\": \"\"\n },\n \"addressDetails\": {\n \"addressLine1\": \"\",\n \"state\": \"\",\n \"city\": \"\",\n \"postCode\": \"\",\n \"countryCode\": \"\"\n }\n}" response = http.request(request) puts response.read_body ``` ```java Success Patch User Details import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.patch("https://api-gateway-stg.transak.com/api/v2/kyc/user?apiKey=") .header("x-api-key", "") .header("x-user-ip", "") .header("Content-Type", "application/json") .body("{\n \"personalDetails\": {\n \"firstName\": \"\",\n \"lastName\": \"\",\n \"mobileNumber\": \"\",\n \"dob\": \"\"\n },\n \"addressDetails\": {\n \"addressLine1\": \"\",\n \"state\": \"\",\n \"city\": \"\",\n \"postCode\": \"\",\n \"countryCode\": \"\"\n }\n}") .asString(); ``` ```php Success Patch User Details request('PATCH', 'https://api-gateway-stg.transak.com/api/v2/kyc/user?apiKey=', [ 'body' => '{ "personalDetails": { "firstName": "", "lastName": "", "mobileNumber": "", "dob": "" }, "addressDetails": { "addressLine1": "", "state": "", "city": "", "postCode": "", "countryCode": "" } }', 'headers' => [ 'Content-Type' => 'application/json', 'x-api-key' => '', 'x-user-ip' => '', ], ]); echo $response->getBody(); ``` ```csharp Success Patch User Details using RestSharp; var client = new RestClient("https://api-gateway-stg.transak.com/api/v2/kyc/user?apiKey="); var request = new RestRequest(Method.PATCH); request.AddHeader("x-api-key", ""); request.AddHeader("x-user-ip", ""); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"personalDetails\": {\n \"firstName\": \"\",\n \"lastName\": \"\",\n \"mobileNumber\": \"\",\n \"dob\": \"\"\n },\n \"addressDetails\": {\n \"addressLine1\": \"\",\n \"state\": \"\",\n \"city\": \"\",\n \"postCode\": \"\",\n \"countryCode\": \"\"\n }\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Success Patch User Details import Foundation let headers = [ "x-api-key": "", "x-user-ip": "", "Content-Type": "application/json" ] let parameters = [ "personalDetails": [ "firstName": "", "lastName": "", "mobileNumber": "", "dob": "" ], "addressDetails": [ "addressLine1": "", "state": "", "city": "", "postCode": "", "countryCode": "" ] ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api-gateway-stg.transak.com/api/v2/kyc/user?apiKey=")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "PATCH" 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() ```