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>
Known 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
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp