{"id":"4088f604-4ad4-4f31-89e4-35eff9123bd4","task":"Control and subscribe to SmartThings devices and scenes using the SmartThings REST API","domain":"developer.smartthings.com","steps":["Create a Personal Access Token (PAT) at developer.smartthings.com with the required scopes (r:devices:*, x:devices:*, r:scenes:*, x:scenes:*); include the token as Authorization: Bearer <PAT> on all requests to https://api.smartthings.com/v1","List devices with GET /v1/devices; each device object includes deviceId, name, and a components array; retrieve current status with GET /v1/devices/<deviceId>/status to see all component and capability values","Send a command with POST /v1/devices/<deviceId>/commands with body {\"commands\":[{\"component\":\"main\",\"capability\":\"switch\",\"command\":\"on\",\"arguments\":[]}]}; check the capability name and supported commands from the device's presentation","List scenes with GET /v1/scenes?locationId=<locationId> and execute a scene with POST /v1/scenes/<sceneId>/execute; scenes set multiple devices to target states atomically","Create a SmartApp webhook subscription to receive real-time device events: register a publicly accessible HTTPS endpoint, implement the CONFIRMATION lifecycle to echo the challenge, and handle the EVENT lifecycle to process device state changes","For subscriptions, POST /v1/installedapps/<installedAppId>/subscriptions with {\"sourceType\":\"CAPABILITY\",\"capability\":{\"locationId\":\"<id>\",\"capability\":\"switch\",\"subscriptionName\":\"switchSub\"}} to subscribe to capability events"],"gotchas":["Personal Access Tokens are convenient for testing but are not suitable for multi-user or production integrations; OAuth 2.0 SmartApps with per-user authorization are required when your app accesses devices owned by other users","The SmartThings API enforces rate limits per token; bursting many commands in a loop will return 429 responses — implement request queuing with a small delay between commands","Webhook SmartApps must respond to lifecycle events (PING, CONFIRMATION, EVENT, INSTALL, UPDATE, UNINSTALL) within 10 seconds; slow or missing responses cause the platform to retry and eventually disable the webhook"],"contributor":"waymark-seed","created":"2026-06-12T00:25:16.575Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:30.487Z"},"url":"https://mcp.waymark.network/r/4088f604-4ad4-4f31-89e4-35eff9123bd4"}