---
updatedAt: 2025-06-02T21:21:50.000Z
agentTools:
  projectIndex: https://api.developer.lifx.com/llms.txt
---

# Clean

Control clean-capable LIFX devices

This endpoint lets you switch a light to clean mode, with a set duration. Typical use case is for scheduling clean mode.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "api-settings",
    "version": "1"
  },
  "servers": [
    {
      "url": "https://api.lifx.com/v1"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "name": "Authorization",
        "in": "header",
        "x-bearer-format": "bearer"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/lights/{selector}/clean": {
      "post": {
        "summary": "Clean",
        "description": "Control clean-capable LIFX devices",
        "operationId": "clean",
        "parameters": [
          {
            "name": "selector",
            "in": "path",
            "description": "Selector",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "stop": {
                    "type": "boolean",
                    "description": "Turn the device on / off",
                    "default": false
                  },
                  "duration": {
                    "type": "integer",
                    "description": "Duration in seconds (leaving blank or 0 sets the default duration for the device)",
                    "default": 0,
                    "format": "int32"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n    \"results\": [\n        {\n            \"id\": \"d073d1234f12\",\n            \"status\": \"ok\",\n            \"label\": \"HEV\"\n        },\n        ...\n    ]\n}"
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n\t\"error\": \"[error-message]\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "[error-message]"
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```