---
schema_version: "1"
id: 3c224def471a61c0b31d81ed96d1978722731183c299324e3fda1e6fb9309bfe
title: setSoftphonePanelVisibility() for Lightning Experience
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/service-cloud/api-cti/guides/sforce-api-cti-setsoftphonepanelvisibility-lex.md
canonical_url: https://developer.salesforce.com/docs/service/api-cti/guide/sforce-api-cti-setsoftphonepanelvisibility-lex.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 752f9d5c611c6126b7133b8854df39641d4a6923f221b875b2d7c1d5c2f02f3f
products:
  - Open CTI Developer Guide
  - Service Cloud Developer Content
---

# setSoftphonePanelVisibility() for Lightning Experience

## Usage

Sets the visibility status of the softphone panel. When the `visible` parameter is passed as `true`, the softphone panel is displayed. When it’s set to `false`, the panel is minimized. This method is available in API version 38.0 or later.

## Syntax

```javascript
sforce.opencti.setSoftphonePanelVisibility({
   visible:TRUE, 
   callback:FUNCTION  //Optional
});

```

## Arguments

|Name|Type|Description|
|------|------|-------------|
|`visible`|boolean|To dock (display) the softphone panel, set the value to `true`. To minimize (hide) the softphone panel, set the value to `false`.|
|`callback`|function|JavaScript method executed when the API method call is completed.|


## Sample Code–HTML and JavaScript

<!-- html set_clipboard -->
```html
<html>
  <head>
    <script type="text/javascript" src="https://domain:port/support/api//lightning/opencti_min.js"></script>
    <script type="text/javascript">
      var callback = function(response) {
         if (response.success) {
            console.log('API method call executed successfully! returnValue:', response.returnValue);
         } else { 
            console.error('Something went wrong! Errors:', response.errors);
         }
      };

      function setSoftphonePanelVisibility() {
          sforce.opencti.setSoftphonePanelVisibility({visible: true, callback: callback});
      }
     </script>
  </head>
  <body>
    <button onclick="setSoftphonePanelVisibility();">setSoftphonePanelVisibility()</button>
  </body>
</html>
```

## Response

This method is asynchronous. The response is returned in an object passed to a callback method. The response object contains the following fields.

|Name|Type|Description|
|------|------|-------------|
|`success`|boolean|Returns `true` if the API method call was invoked successfully, `false` otherwise.|
|`returnValue`|object|This API method doesn’t return this object. The `returnValue` is always `null`.|
|`errors`|array|If the API call was successful, this variable is `null`. If the API call failed, this variable returns an array of [error messages](https://developer.salesforce.com/docs/service/api-cti/guide/sforce-api-cti-error-messages-lightning.md).|


