# Update user PUT https://api-sandbox.payabli.com/api/User/{userId} Content-Type: application/json Use this endpoint to modify the details of a specific user within an organization. Reference: https://docs.payabli.com/developers/api-reference/user/modify-user-in-an-organization ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Modify User in an Organization version: endpoint_user.EditUser paths: /User/{userId}: put: operationId: edit-user summary: Modify User in an Organization description: >- Use this endpoint to modify the details of a specific user within an organization. tags: - - subpackage_user parameters: - name: userId in: path description: User Identifier required: true schema: type: integer format: int64 - name: requestToken in: header required: true schema: type: string responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/type_:PayabliApiResponse' '400': description: Bad request/ invalid data content: {} '401': description: Unauthorized request. content: {} '500': description: Internal API Error content: {} '503': description: Database connection error content: {} requestBody: content: application/json: schema: $ref: '#/components/schemas/type_:UserData' components: schemas: type_:UsrAccess: type: object properties: roleLabel: type: string roleValue: type: boolean type_:AdditionalData: type: object additionalProperties: type: object additionalProperties: description: Any type type_:Email: type: string format: email type_:Language: type: string type_:MfaMode: type: integer type_:MfaData: type: object properties: mfa: type: boolean mfaMode: $ref: '#/components/schemas/type_:MfaMode' type_:NameUser: type: string type_:PhoneNumber: type: string type_:Orgid: type: integer format: int64 type_:Orgtype: type: integer type_:OrgScope: type: object properties: orgId: $ref: '#/components/schemas/type_:Orgid' orgType: $ref: '#/components/schemas/type_:Orgtype' type_:Timezone: type: integer type_:UsrStatus: type: integer type_:UserData: type: object properties: access: type: array items: $ref: '#/components/schemas/type_:UsrAccess' additionalData: $ref: '#/components/schemas/type_:AdditionalData' email: $ref: '#/components/schemas/type_:Email' description: The user's email address. language: $ref: '#/components/schemas/type_:Language' mfaData: $ref: '#/components/schemas/type_:MfaData' name: $ref: '#/components/schemas/type_:NameUser' phone: $ref: '#/components/schemas/type_:PhoneNumber' description: The user's phone number. pwd: type: string scope: type: array items: $ref: '#/components/schemas/type_:OrgScope' timeZone: $ref: '#/components/schemas/type_:Timezone' usrStatus: $ref: '#/components/schemas/type_:UsrStatus' type_:IsSuccess: type: boolean type_:Responsedata: type: object additionalProperties: description: Any type type_:ResponseText: type: string type_:PayabliApiResponse: type: object properties: isSuccess: $ref: '#/components/schemas/type_:IsSuccess' responseData: $ref: '#/components/schemas/type_:Responsedata' responseText: $ref: '#/components/schemas/type_:ResponseText' required: - responseText ``` ## SDK Code Examples ```typescript import { PayabliClient, PayabliEnvironment } from "@payabli/sdk-node"; async function main() { const client = new PayabliClient({ environment: PayabliEnvironment.Sandbox, apiKey: "YOUR_API_KEY_HERE", }); await client.user.editUser(1000000, {}); } main(); ``` ```python from payabli import payabli from payabli.environment import payabliEnvironment client = payabli( environment=payabliEnvironment.SANDBOX, api_key="YOUR_API_KEY_HERE" ) client.user.edit_user( user_id=1000000 ) ``` ```csharp using PayabliApi; using System.Threading.Tasks; namespace Usage; public class Example { public async Task Do() { var client = new PayabliApiClient( apiKey: "YOUR_API_KEY_HERE", clientOptions: new ClientOptions { BaseUrl = PayabliApiEnvironment.Sandbox } ); await client.User.EditUserAsync( 1000000L, new UserData() ); } } ``` ```go package example import ( client "github.com/payabli/sdk-go/v/client" option "github.com/payabli/sdk-go/v/option" payabli "github.com/payabli/sdk-go/v" context "context" ) func do() { client := client.NewClient( option.WithBaseURL( payabli.Environments.Sandbox, ), option.WithApiKey( "YOUR_API_KEY_HERE", ), ) request := &payabli.UserData{} client.User.EditUser( context.TODO(), 1000000, request, ) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api-sandbox.payabli.com/api/User/1000000") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Put.new(url) request["requestToken"] = '' request["Content-Type"] = 'application/json' request.body = "{}" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.put("https://api-sandbox.payabli.com/api/User/1000000") .header("requestToken", "") .header("Content-Type", "application/json") .body("{}") .asString(); ``` ```php request('PUT', 'https://api-sandbox.payabli.com/api/User/1000000', [ 'body' => '{}', 'headers' => [ 'Content-Type' => 'application/json', 'requestToken' => '', ], ]); echo $response->getBody(); ``` ```swift import Foundation let headers = [ "requestToken": "", "Content-Type": "application/json" ] let parameters = [] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/User/1000000")! 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() ```