# API

The `nv unset` commands remove the configuration you set with the equivalent `nv set` commands. This guide only describes an `nv unset` command if it differs from the `nv set` command.

## nv set system api certificate <certificate-string>

Configures the X.509 certificate to be used with the API end-point.

### Command Syntax

Syntax | Description
--- | ---
`certificate-string` | The certificate string.

### Version History

Introduced in Cumulus Linux 5.8.0

### Example

    cumulus@switch:~$ nv set system api certificate <string>

## nv set system api compression gzip

Enables and disables compression of HTTP responses for client requests with the Content-Encoding: gzip header to reduce data size and improve performance. When accessing the API over slow network connections or retrieving large datasets, response times can be significant.

HTTP response compression is disabled by default.

### Version History

Introduced in Cumulus Linux 5.16.0

### Example

    cumulus@switch:~$ nv set system api compression gzip

## nv set system api listening-address <listening-address-id>

Configures the NVUE REST API listening address; you can specify an IPv4 address or localhost. If you do not specify a listening address, NGINX listens on all addresses for the target port.

### Command Syntax

Syntax | Description
--- | ---
`listening-address-id` | The IP address of the API listening address, or localhost.

### Version History

Introduced in Cumulus Linux 5.6.0

### Example

    cumulus@switch:~$ nv set system api listening-address localhost

## nv set system api mtls ca-certificate <certificate-string>

Configures the certificate for client validation during Mutual TLS (mTLS) authentication.

### Command Syntax

Syntax | Description
--- | ---
`certificate-string` | The certificate string.

### Version History

Introduced in Cumulus Linux 5.8.0

### Example

    cumulus@switch:~$ nv set system api mtls ca-certificate <string>

## nv set system api port

Configures the NVUE REST API port. You can set a value between 1 and 65535. If you do not set a port, Cumulus Linux uses the default port 8765.

### Version History

Introduced in Cumulus Linux 5.6.0

### Example

    cumulus@switch:~$ nv set system api port 8888

## nv set system api state

Enables or disables the NVUE REST API. The default setting is `enabled`.

To use the NVUE REST API in Cumulus Linux 5.6, you must change the password for the cumulus user; otherwise you see 403 responses when you run commands.

### Version History

Introduced in Cumulus Linux 5.6.0

### Example

    cumulus@switch:~$ nv set system api state enabled

## nv set system api token-expiration

Configures the JWT-based authentication token expiration time in minutes. You can set a value between 0 and 10080 minutes. The default value is 60 minutes. If set the expiration time to 0, Cumulus Linux does not issue a token and all previously issued tokens do not work.

### Version History

Introduced in Cumulus Linux 5.14.0

### Example

    cumulus@switch:~$ nv set system api token-expiration 1000