# Transfer User Accountabilities **POST** This API transfers all resource and account ownership responsibilities from one user to another in PAM360. It helps reassign accountabilities when a user leaves the organization or changes roles. ## Request URL ``` https://:/restapi/json/v1/user/transferUserAccountabilities ``` ## Header Parameters ``` { "AUTHTOKEN" : "<>", "orgName" : "<>" } ``` | Parameter | Description | Values | |---|---|---| | **AUTHTOKEN** | Authentication token for the user to authorize the API request.
**Type :** String
**Mandatory :** Yes | **Default Value :** N/A | | **orgName** | Organization name available in PAM360.
**Type :** String
**Mandatory :** No | **Default Value :** The organization to which the user belongs. | ## Body Parameters ``` INPUT_DATA = { "operation": { "Details": { "oldUserId": 309, "newUserId": 582 } } } ``` | Parameters | Description | Values | |---|---|---| | **oldUserId** | ID of the existing user to be replaced or updated.
**Type :** Integer
**Mandatory :** Yes | **Default Value :** N/A | | **newUserId** | ID of the user to whom the ownership is transferred.
**Type :** Integer
**Mandatory :** Yes | **Default Value :** N/A | ## Sample Request ### cURL ```bash curl -X POST -H "AUTHTOKEN:<>" -H "orgName:msp" -H "Content-Type: application/x-www-form-urlencoded" https://:/restapi/json/v1/user/transferUserAccountabilities --data-urlencode "INPUT_DATA={\"operation\":{\"Details\":{\"oldUserId\":1,\"newUserId\":2}}}" ``` ### Python ```python import requests url = "https://:/restapi/json/v1/user/transferUserAccountabilities" headers = { "AUTHTOKEN": "<>", "orgName": "MyOrgName", "Content-Type": "application/x-www-form-urlencoded" } payload = { "INPUT_DATA": '{"operation":{"Details":{"oldUserId":309,"newUserId":582}}}' } response = requests.post(url, headers=headers, data=payload, verify=True) print(response.text) ``` ### PowerShell ```powershell # API endpoint $Url = "https://:/restapi/json/v1/user/transferUserAccountabilities" # Headers $Headers = @{ "AUTHTOKEN" = "<>"; "Content-Type" = "application/x-www-form-urlencoded" } # Payload $Body = @{ INPUT_DATA = '{ "operation": { "Details": { "oldUserId": 309, "newUserId": 582 } } }' } # Send POST request $response = Invoke-RestMethod -Uri $Url -Method Post -Headers $Headers -Body $Body # Show response $response | ConvertTo-Json -Depth 5 ``` ## Sample Response ```json { "operation": { "result": { "message": "The following accountabilities were transferred from admin-11h to admin-11k: Owned Resources, Resource Groups, SSH Keys and SSL Certificates, Scheduled Tasks, Access Control Privileges, Access Policies, ME Integration, Notifications, MSP Organization Permissions and Password Reset Capabilities.", "status": "Success", "statusCode": 20000 }, "name": "TRANSFER_USER_ACCOUNTABILITIES" } } ```