Tuya Device Control API

Control and command IoT devices

Operations 3

POST /v1.0/devices/{device_id}/commands Send Device Commands #
GET /v1.0/devices/{device_id}/status Get Device Status #
PUT /v1.0/devices/{device_id}/reset-factory Reset Device to Factory Settings #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/tuya-device-control-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

tuya-device-control-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Tuya Device Management Device Control API
  description: The Tuya Device Management API provides endpoints for querying, controlling, and managing IoT devices registered to a Tuya cloud project. Capabilities include device information retrieval, device control, factory reset, device renaming, sub-device listing, operation log queries, and user-device association management.
  version: '1.0'
  contact:
    name: Tuya Developer Support
    url: https://developer.tuya.com/en/
    email: developer@tuya.com
  termsOfService: https://developer.tuya.com/en/docs/iot/compliance?id=Ka9t0qa3qihn3
servers:
- url: https://openapi.tuyaus.com
  description: Tuya US Data Center
- url: https://openapi.tuyaeu.com
  description: Tuya EU Data Center
- url: https://openapi.tuyain.com
  description: Tuya India Data Center
security:
- tuyaApiKey: []
tags:
- name: Device Control
  description: Control and command IoT devices
paths:
  /v1.0/devices/{device_id}/commands:
    post:
      operationId: sendDeviceCommands
      summary: Send Device Commands
      description: Send one or more control commands to a device. Commands correspond to device data points (DPs) defined in the product schema.
      tags:
      - Device Control
      parameters:
      - $ref: '#/components/parameters/DeviceId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                commands:
                  type: array
                  description: List of commands to send to the device
                  items:
                    type: object
                    properties:
                      code:
                        type: string
                        description: Data point code (e.g., switch_1, bright_value)
                      value:
                        description: Command value matching the data point type
              required:
              - commands
      responses:
        '200':
          description: Commands sent successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessResponse'
        '400':
          description: Invalid command
        '401':
          description: Unauthorized
        '404':
          description: Device not found
  /v1.0/devices/{device_id}/status:
    get:
      operationId: getDeviceStatus
      summary: Get Device Status
      description: Retrieve the current status of all data points for a device.
      tags:
      - Device Control
      parameters:
      - $ref: '#/components/parameters/DeviceId'
      responses:
        '200':
          description: Device status data points
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceStatusResponse'
        '401':
          description: Unauthorized
        '404':
          description: Device not found
  /v1.0/devices/{device_id}/reset-factory:
    put:
      operationId: resetDeviceFactory
      summary: Reset Device to Factory Settings
      description: Restore a device to its factory default settings and unpair it from the current account.
      tags:
      - Device Control
      parameters:
      - $ref: '#/components/parameters/DeviceId'
      responses:
        '200':
          description: Device reset initiated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessResponse'
        '401':
          description: Unauthorized
        '404':
          description: Device not found
components:
  schemas:
    DataPoint:
      type: object
      properties:
        code:
          type: string
          description: Data point code identifier
        value:
          description: Current value of the data point
    DeviceStatusResponse:
      type: object
      properties:
        result:
          type: array
          items:
            $ref: '#/components/schemas/DataPoint'
        success:
          type: boolean
        t:
          type: integer
          format: int64
    SuccessResponse:
      type: object
      properties:
        result:
          type: boolean
          description: Whether the operation succeeded
        success:
          type: boolean
          description: Request success flag
        t:
          type: integer
          format: int64
          description: Response timestamp in milliseconds
  parameters:
    DeviceId:
      name: device_id
      in: path
      required: true
      description: Unique device identifier
      schema:
        type: string
  securitySchemes:
    tuyaApiKey:
      type: apiKey
      in: header
      name: client_id
      description: Tuya API uses HMAC-SHA256 signed requests. Include your Access ID as the client_id header and provide a sign header computed from your Access ID, Access Secret, and timestamp.