# 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 ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: whitelabel-api version: 1.0.0 paths: /api/v2/kyc/user: patch: operationId: patch-user-details summary: Patch User Details description: >- 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`. tags: - subpackage_kyc parameters: - name: apiKey in: query description: Your API Key from Transak Dashboard required: true schema: type: string default: YOUR_API_KEY - name: authorization in: header description: >- Authorization token is the accessToken received from the API -` api/v2/auth/verify` required: true schema: type: string default: YOUR_USER_AUTH_TOKEN - name: x-user-identifier in: header description: >- Your authenticated user Email Id address. Note: This is applicable only for [Auth Reliance Flows](/features/auth-reliance) required: false schema: type: string default: USER_EMAIL_ID - name: x-access-token in: header description: > 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) required: false schema: type: string default: YOUR_ACCESS_TOKEN responses: '200': description: 200 - Success content: application/json: schema: $ref: '#/components/schemas/KYC_patch-user-details_Response_200' '400': description: 400 - Under Age User content: application/json: schema: $ref: '#/components/schemas/Patch-user-detailsRequestBadRequestError' '401': description: 401 - Unauthorized content: application/json: schema: $ref: >- #/components/schemas/Patch-user-detailsRequestUnauthorizedError '500': description: 500 - Internal Server Error content: application/json: schema: $ref: >- #/components/schemas/Patch-user-detailsRequestInternalServerError requestBody: content: application/json: schema: type: object properties: personalDetails: $ref: >- #/components/schemas/ApiV2KycUserPatchRequestBodyContentApplicationJsonSchemaPersonalDetails addressDetails: $ref: >- #/components/schemas/ApiV2KycUserPatchRequestBodyContentApplicationJsonSchemaAddressDetails required: - personalDetails - addressDetails servers: - url: https://api-gateway-stg.transak.com components: schemas: ApiV2KycUserPatchRequestBodyContentApplicationJsonSchemaPersonalDetails: type: object properties: firstName: type: string default: Doe lastName: type: string default: Jane mobileNumber: type: string default: '+911234567890' dob: type: string default: '1998-01-01T00:00:00.000Z' required: - firstName - lastName - mobileNumber - dob title: ApiV2KycUserPatchRequestBodyContentApplicationJsonSchemaPersonalDetails ApiV2KycUserPatchRequestBodyContentApplicationJsonSchemaAddressDetails: type: object properties: addressLine1: type: string default: 170 Rue du Faubourg Saint-Denis, Paris addressLine2: type: string default: Apt 4B state: type: string default: Paris city: type: string default: Paris postCode: type: string default: '75010' countryCode: type: string default: FR required: - addressLine1 - state - city - postCode - countryCode title: ApiV2KycUserPatchRequestBodyContentApplicationJsonSchemaAddressDetails ApiV2KycUserPatchResponsesContentApplicationJsonSchemaDataKyc: type: object properties: status: type: string type: type: - string - 'null' required: - status - type title: ApiV2KycUserPatchResponsesContentApplicationJsonSchemaDataKyc ApiV2KycUserPatchResponsesContentApplicationJsonSchemaDataAddress: type: object properties: addressLine1: type: string addressLine2: type: string state: type: string city: type: string postCode: type: string country: type: string countryCode: type: string required: - addressLine1 - addressLine2 - state - city - postCode - country - countryCode title: ApiV2KycUserPatchResponsesContentApplicationJsonSchemaDataAddress ApiV2KycUserPatchResponsesContentApplicationJsonSchemaData: type: object properties: partnerUserId: type: string firstName: type: string lastName: type: string email: type: string mobileNumber: type: string status: type: string dob: type: string kyc: $ref: >- #/components/schemas/ApiV2KycUserPatchResponsesContentApplicationJsonSchemaDataKyc address: $ref: >- #/components/schemas/ApiV2KycUserPatchResponsesContentApplicationJsonSchemaDataAddress required: - partnerUserId - firstName - lastName - email - mobileNumber - status - dob - kyc - address title: ApiV2KycUserPatchResponsesContentApplicationJsonSchemaData KYC_patch-user-details_Response_200: type: object properties: data: $ref: >- #/components/schemas/ApiV2KycUserPatchResponsesContentApplicationJsonSchemaData required: - data title: KYC_patch-user-details_Response_200 ApiV2KycUserPatchResponsesContentApplicationJsonSchemaError: type: object properties: statusCode: type: integer message: type: string required: - statusCode - message title: ApiV2KycUserPatchResponsesContentApplicationJsonSchemaError Patch-user-detailsRequestBadRequestError: type: object properties: error: $ref: >- #/components/schemas/ApiV2KycUserPatchResponsesContentApplicationJsonSchemaError required: - error title: Patch-user-detailsRequestBadRequestError Patch-user-detailsRequestUnauthorizedError: type: object properties: error: $ref: >- #/components/schemas/ApiV2KycUserPatchResponsesContentApplicationJsonSchemaError required: - error title: Patch-user-detailsRequestUnauthorizedError Patch-user-detailsRequestInternalServerError: type: object properties: error: $ref: >- #/components/schemas/ApiV2KycUserPatchResponsesContentApplicationJsonSchemaError required: - error title: Patch-user-detailsRequestInternalServerError ``` ## SDK Code Examples ```python Success import requests url = "https://api-gateway-stg.transak.com/api/v2/kyc/user" querystring = {"apiKey":"YOUR_API_KEY"} headers = { "authorization": "YOUR_USER_AUTH_TOKEN", "x-user-identifier": "USER_EMAIL_ID", "x-access-token": "YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.patch(url, headers=headers, params=querystring) print(response.json()) ``` ```javascript Success const url = 'https://api-gateway-stg.transak.com/api/v2/kyc/user?apiKey=YOUR_API_KEY'; const options = { method: 'PATCH', headers: { authorization: 'YOUR_USER_AUTH_TOKEN', 'x-user-identifier': 'USER_EMAIL_ID', 'x-access-token': 'YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: undefined }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Success package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api-gateway-stg.transak.com/api/v2/kyc/user?apiKey=YOUR_API_KEY" req, _ := http.NewRequest("PATCH", url, nil) req.Header.Add("authorization", "YOUR_USER_AUTH_TOKEN") req.Header.Add("x-user-identifier", "USER_EMAIL_ID") req.Header.Add("x-access-token", "YOUR_ACCESS_TOKEN") 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 require 'uri' require 'net/http' url = URI("https://api-gateway-stg.transak.com/api/v2/kyc/user?apiKey=YOUR_API_KEY") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Patch.new(url) request["authorization"] = 'YOUR_USER_AUTH_TOKEN' request["x-user-identifier"] = 'USER_EMAIL_ID' request["x-access-token"] = 'YOUR_ACCESS_TOKEN' request["Content-Type"] = 'application/json' response = http.request(request) puts response.read_body ``` ```java Success 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=YOUR_API_KEY") .header("authorization", "YOUR_USER_AUTH_TOKEN") .header("x-user-identifier", "USER_EMAIL_ID") .header("x-access-token", "YOUR_ACCESS_TOKEN") .header("Content-Type", "application/json") .asString(); ``` ```php Success request('PATCH', 'https://api-gateway-stg.transak.com/api/v2/kyc/user?apiKey=YOUR_API_KEY', [ 'headers' => [ 'Content-Type' => 'application/json', 'authorization' => 'YOUR_USER_AUTH_TOKEN', 'x-access-token' => 'YOUR_ACCESS_TOKEN', 'x-user-identifier' => 'USER_EMAIL_ID', ], ]); echo $response->getBody(); ``` ```csharp Success using RestSharp; var client = new RestClient("https://api-gateway-stg.transak.com/api/v2/kyc/user?apiKey=YOUR_API_KEY"); var request = new RestRequest(Method.PATCH); request.AddHeader("authorization", "YOUR_USER_AUTH_TOKEN"); request.AddHeader("x-user-identifier", "USER_EMAIL_ID"); request.AddHeader("x-access-token", "YOUR_ACCESS_TOKEN"); request.AddHeader("Content-Type", "application/json"); IRestResponse response = client.Execute(request); ``` ```swift Success import Foundation let headers = [ "authorization": "YOUR_USER_AUTH_TOKEN", "x-user-identifier": "USER_EMAIL_ID", "x-access-token": "YOUR_ACCESS_TOKEN", "Content-Type": "application/json" ] let request = NSMutableURLRequest(url: NSURL(string: "https://api-gateway-stg.transak.com/api/v2/kyc/user?apiKey=YOUR_API_KEY")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "PATCH" 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() ``` ```python KYC_patch-user-details_example import requests url = "https://api-gateway-stg.transak.com/api/v2/kyc/user" querystring = {"apiKey":"YOUR_API_KEY"} payload = { "personalDetails": { "firstName": "Doe", "lastName": "Jane", "mobileNumber": "+911234567890", "dob": "1998-01-01T00:00:00.000Z" }, "addressDetails": { "addressLine1": "170 Rue du Faubourg Saint-Denis, Paris", "state": "Paris", "city": "Paris", "postCode": "75010", "countryCode": "FR", "addressLine2": "" } } headers = { "authorization": "YOUR_USER_AUTH_TOKEN", "x-user-identifier": "USER_EMAIL_ID", "x-access-token": "YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.patch(url, json=payload, headers=headers, params=querystring) print(response.json()) ``` ```javascript KYC_patch-user-details_example const url = 'https://api-gateway-stg.transak.com/api/v2/kyc/user?apiKey=YOUR_API_KEY'; const options = { method: 'PATCH', headers: { authorization: 'YOUR_USER_AUTH_TOKEN', 'x-user-identifier': 'USER_EMAIL_ID', 'x-access-token': 'YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: '{"personalDetails":{"firstName":"Doe","lastName":"Jane","mobileNumber":"+911234567890","dob":"1998-01-01T00:00:00.000Z"},"addressDetails":{"addressLine1":"170 Rue du Faubourg Saint-Denis, Paris","state":"Paris","city":"Paris","postCode":"75010","countryCode":"FR","addressLine2":""}}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go KYC_patch-user-details_example package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api-gateway-stg.transak.com/api/v2/kyc/user?apiKey=YOUR_API_KEY" payload := strings.NewReader("{\n \"personalDetails\": {\n \"firstName\": \"Doe\",\n \"lastName\": \"Jane\",\n \"mobileNumber\": \"+911234567890\",\n \"dob\": \"1998-01-01T00:00:00.000Z\"\n },\n \"addressDetails\": {\n \"addressLine1\": \"170 Rue du Faubourg Saint-Denis, Paris\",\n \"state\": \"Paris\",\n \"city\": \"Paris\",\n \"postCode\": \"75010\",\n \"countryCode\": \"FR\",\n \"addressLine2\": \"\"\n }\n}") req, _ := http.NewRequest("PATCH", url, payload) req.Header.Add("authorization", "YOUR_USER_AUTH_TOKEN") req.Header.Add("x-user-identifier", "USER_EMAIL_ID") req.Header.Add("x-access-token", "YOUR_ACCESS_TOKEN") 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 KYC_patch-user-details_example require 'uri' require 'net/http' url = URI("https://api-gateway-stg.transak.com/api/v2/kyc/user?apiKey=YOUR_API_KEY") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Patch.new(url) request["authorization"] = 'YOUR_USER_AUTH_TOKEN' request["x-user-identifier"] = 'USER_EMAIL_ID' request["x-access-token"] = 'YOUR_ACCESS_TOKEN' request["Content-Type"] = 'application/json' request.body = "{\n \"personalDetails\": {\n \"firstName\": \"Doe\",\n \"lastName\": \"Jane\",\n \"mobileNumber\": \"+911234567890\",\n \"dob\": \"1998-01-01T00:00:00.000Z\"\n },\n \"addressDetails\": {\n \"addressLine1\": \"170 Rue du Faubourg Saint-Denis, Paris\",\n \"state\": \"Paris\",\n \"city\": \"Paris\",\n \"postCode\": \"75010\",\n \"countryCode\": \"FR\",\n \"addressLine2\": \"\"\n }\n}" response = http.request(request) puts response.read_body ``` ```java KYC_patch-user-details_example 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=YOUR_API_KEY") .header("authorization", "YOUR_USER_AUTH_TOKEN") .header("x-user-identifier", "USER_EMAIL_ID") .header("x-access-token", "YOUR_ACCESS_TOKEN") .header("Content-Type", "application/json") .body("{\n \"personalDetails\": {\n \"firstName\": \"Doe\",\n \"lastName\": \"Jane\",\n \"mobileNumber\": \"+911234567890\",\n \"dob\": \"1998-01-01T00:00:00.000Z\"\n },\n \"addressDetails\": {\n \"addressLine1\": \"170 Rue du Faubourg Saint-Denis, Paris\",\n \"state\": \"Paris\",\n \"city\": \"Paris\",\n \"postCode\": \"75010\",\n \"countryCode\": \"FR\",\n \"addressLine2\": \"\"\n }\n}") .asString(); ``` ```php KYC_patch-user-details_example request('PATCH', 'https://api-gateway-stg.transak.com/api/v2/kyc/user?apiKey=YOUR_API_KEY', [ 'body' => '{ "personalDetails": { "firstName": "Doe", "lastName": "Jane", "mobileNumber": "+911234567890", "dob": "1998-01-01T00:00:00.000Z" }, "addressDetails": { "addressLine1": "170 Rue du Faubourg Saint-Denis, Paris", "state": "Paris", "city": "Paris", "postCode": "75010", "countryCode": "FR", "addressLine2": "" } }', 'headers' => [ 'Content-Type' => 'application/json', 'authorization' => 'YOUR_USER_AUTH_TOKEN', 'x-access-token' => 'YOUR_ACCESS_TOKEN', 'x-user-identifier' => 'USER_EMAIL_ID', ], ]); echo $response->getBody(); ``` ```csharp KYC_patch-user-details_example using RestSharp; var client = new RestClient("https://api-gateway-stg.transak.com/api/v2/kyc/user?apiKey=YOUR_API_KEY"); var request = new RestRequest(Method.PATCH); request.AddHeader("authorization", "YOUR_USER_AUTH_TOKEN"); request.AddHeader("x-user-identifier", "USER_EMAIL_ID"); request.AddHeader("x-access-token", "YOUR_ACCESS_TOKEN"); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"personalDetails\": {\n \"firstName\": \"Doe\",\n \"lastName\": \"Jane\",\n \"mobileNumber\": \"+911234567890\",\n \"dob\": \"1998-01-01T00:00:00.000Z\"\n },\n \"addressDetails\": {\n \"addressLine1\": \"170 Rue du Faubourg Saint-Denis, Paris\",\n \"state\": \"Paris\",\n \"city\": \"Paris\",\n \"postCode\": \"75010\",\n \"countryCode\": \"FR\",\n \"addressLine2\": \"\"\n }\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift KYC_patch-user-details_example import Foundation let headers = [ "authorization": "YOUR_USER_AUTH_TOKEN", "x-user-identifier": "USER_EMAIL_ID", "x-access-token": "YOUR_ACCESS_TOKEN", "Content-Type": "application/json" ] let parameters = [ "personalDetails": [ "firstName": "Doe", "lastName": "Jane", "mobileNumber": "+911234567890", "dob": "1998-01-01T00:00:00.000Z" ], "addressDetails": [ "addressLine1": "170 Rue du Faubourg Saint-Denis, Paris", "state": "Paris", "city": "Paris", "postCode": "75010", "countryCode": "FR", "addressLine2": "" ] ] 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=YOUR_API_KEY")! 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() ```