Rest API body to add RDP access method and MSRDP service to a device
search cancel

Rest API body to add RDP access method and MSRDP service to a device


Article ID: 233178


Updated On:


CA Privileged Access Manager (PAM)


We have two questions for Enable RDP access (both RDP and MSRDP) in CAPAM related APIs:
1. What’s the type of the service ID we use (TCPUDP or RDP Application or something else)
2. Need useable access method data


Release : 3.4



If the service ID of the MSRDP service, or any other service, is not known yet, you can either get it by using Rest API resource "GET /api.php/v1/devices.json", using a specific device name that has the service assigned already as filter and getting all fields, or you can use resource "GET /api.php/v1/services.json" to get defined services. Optionally use the service name as filter.

"GET /api.php/v1/devices.json" would be used to get the ID of a given device, filtering by device name, if not known yet.

The syntax for adding built-in device access methods, such as the RDP access method, is documented on the Settings > Api Docs page for resource "POST /api.php/v1/devices.json/{id}/accessMethods".


Assume we have a device with ID 34001 that starts out with typeAccess=false and no access method or service assigned.

The ID of the MSRDP service is 8001.

Then Rest API resource "PUT /api.php/v1/devices.json" would be used with the following body to set typeAccess to true, add the built-in RDP access method, and add the MSRDP service:

    "deviceId": "34001",
    "typeAccess": "t",   
    "deviceAccessMethods": [ {
        "port" : "3389",
        "type": "RDP" }