---
schema_version: "1"
id: d4ac2ac1b664e7f8fd8ef43128086ac49a2de11908d538fea686b2c63f71563b
title: Impersonation via WSProxy
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/guides/mc-programmatic-content/ssjs_WSProxy_impersonate.md
canonical_url: https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/ssjs_WSProxy_impersonate.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: f3c1d8dced3d830c7ab69952806a9a9afeb0ae1b677388a4aac8e0c426b5de88
products:
  - Marketing Cloud Engagement APIs and Programmatic Languages
  - Marketing Cloud
---
# Impersonation via WSProxy

To impersonate another user, or switch contexts, use the setClientId method on the WSProxy object. This method takes a single parameter, which defines the fields and properties to set on the ClientId object. You can set any property on the ClientId object in the WSDL using this method.

In this example, both the ID and UserID are specified on the object. You can add multiple credentials to a single WSProxy, but most actions use only the first one set as they accept only a single ClientId object.

```
api.setClientId({ "ID": 1234, "UserID": 1234 });
```

To clear all set ClientId objects, use the resetClientIds() method. After using this method, the request goes back to using the default credentials determined by the execution context.

```
api.resetClientIds();
```
