---
schema_version: "1"
id: 9a3c7fb03032c65aca3c4d3c02e4a20910974a0a8c1974bfaebcefc60721015f
title: setSoftphonePanelHeight() 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-setsoftphonepanelheight-lex.md
canonical_url: https://developer.salesforce.com/docs/service/api-cti/guide/sforce-api-cti-setsoftphonepanelheight-lex.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: a5371bf84dfeaaadaa750fb2061bd924016488f1e0c1be712ccdf347c42a0b61
products:
  - Open CTI Developer Guide
  - Service Cloud Developer Content
---

# setSoftphonePanelHeight() for Lightning Experience

## Usage

Sets the softphone panel height in the utility bar. The height must be specified in pixels. This method is available in API version 38.0 or later.

## Syntax

```javascript
sforce.opencti.setSoftphonePanelHeight({
     heightPX:HEIGHT, 
     callback:FUNCTION  //Optional
});
```

## Arguments

|Name|Type|Description|
|------|------|-------------|
|`heightPX`|number|The softphone panel height in pixels. The height must be a number from 240 through 2,560.|
|`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 setSoftphonePanelHeight() {
          sforce.opencti.setSoftphonePanelHeight({heightPX: 400, callback: callback});
      }
     </script>
  </head>
  <body>
    <button onclick="setSoftphonePanelHeight();">setSoftphonePanelHeight()</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).|


