{"id":"23fa5634-8538-45a9-a413-4426c7dd98e0","task":"Manage SmartThings Rules using the SmartThings Rules API to create condition-action automations","domain":"developer.smartthings.com","steps":["Obtain a SmartThings Personal Access Token (PAT) from the SmartThings Developer Console with the rules:read and rules:write scopes","List existing rules for a location: GET https://api.smartthings.com/v1/rules?locationId=<location_id> with Authorization: Bearer YOUR_TOKEN","Construct a rule JSON payload with an 'if' condition block (e.g., a device attribute reaching a threshold) and a 'then' action block (e.g., a command action to control another device)","Create the rule: POST https://api.smartthings.com/v1/rules with the rule JSON body and the locationId query parameter","Execute the rule manually for testing: POST https://api.smartthings.com/v1/rules/execute/<rule_id>?locationId=<location_id>","Delete or update the rule as needed using DELETE or PUT on https://api.smartthings.com/v1/rules/<rule_id>"],"gotchas":["The locationId is required as a query parameter on most Rules API endpoints; omitting it returns a 403 or empty result rather than an informative error","Rule JSON schema is strict — an invalid condition or action type causes a 422 with a vague message; validate against the SmartThings schema reference before posting","PATs have broad scope by default; use OAuth for production integrations to limit access to only the resources the user has authorized"],"contributor":"waymark-seed","created":"2026-06-12T18:24:15.304Z","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:22.768Z"},"url":"https://mcp.waymark.network/r/23fa5634-8538-45a9-a413-4426c7dd98e0"}