> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/switch-infrastructure/config-manager/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/switch-infrastructure/config-manager/_mcp/server.

# Delete Lease

DELETE /lease/{ip_address}

Delete one lease from the selected DHCP service.

Reference: https://docs.nvidia.com/switch-infrastructure/config-manager/switch-infrastructure/config-manager/services/dhcp/dhcp-api/delete-lease-lease-ip-address-delete

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: dhcp-api
  version: 1.0.0
paths:
  /lease/{ip_address}:
    delete:
      operationId: delete_lease_lease__ip_address__delete
      summary: Delete Lease
      description: Delete one lease from the selected DHCP service.
      tags:
        - ''
      parameters:
        - name: ip_address
          in: path
          required: true
          schema:
            type: string
            format: ipvanyaddress
        - name: ip_version
          in: query
          required: false
          schema:
            oneOf:
              - $ref: '#/components/schemas/IpVersion'
              - type: 'null'
        - name: Authorization
          in: header
          description: >-
            Bearer JWT used by CLI and machine clients on svc-* endpoints.
            Authentication is required by default, but deployments may disable
            it with [auth] required = false. Browser OIDC sessions, mTLS, SPIFFE
            identities, and trusted gateway identity headers may also satisfy
            authentication outside this generated client flow.
          required: true
          schema:
            type: string
      responses:
        '204':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                properties: {}
        '404':
          description: Lease not found
          content:
            application/json:
              schema:
                description: Any type
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    IpVersion:
      type: string
      enum:
        - '4'
        - '6'
      description: Supported DHCP address families.
      title: IpVersion
    ValidationErrorCtx:
      type: object
      properties: {}
      title: ValidationErrorCtx
    ValidationErrorLocItems:
      oneOf:
        - type: string
        - type: integer
      title: ValidationErrorLocItems
    ValidationError:
      type: object
      properties:
        ctx:
          $ref: '#/components/schemas/ValidationErrorCtx'
        input:
          description: Any type
        loc:
          type: array
          items:
            $ref: '#/components/schemas/ValidationErrorLocItems'
        msg:
          type: string
        type:
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
    HTTPValidationError:
      type: object
      properties:
        detail:
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
      title: HTTPValidationError
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer JWT used by CLI and machine clients on svc-* endpoints.
        Authentication is required by default, but deployments may disable it
        with [auth] required = false. Browser OIDC sessions, mTLS, SPIFFE
        identities, and trusted gateway identity headers may also satisfy
        authentication outside this generated client flow.

```

## Examples



**SDK Code**

```python
import requests

url = "https://api.example.com/lease/ip_address"

headers = {"Authorization": "Bearer <token>"}

response = requests.delete(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.example.com/lease/ip_address';
const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.example.com/lease/ip_address"

	req, _ := http.NewRequest("DELETE", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.example.com/lease/ip_address")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.delete("https://api.example.com/lease/ip_address")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'https://api.example.com/lease/ip_address', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.example.com/lease/ip_address");
var request = new RestRequest(Method.DELETE);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/lease/ip_address")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```