Publish and subscribe to device events using the Particle Device Cloud API and webhooks

domain: docs.particle.io · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. In Particle firmware, call Particle.publish("temperature", String(reading), PRIVATE) to emit a named event to the Particle Cloud; events have a max payload of 1024 bytes and are rate-limited to 1 event per second per device by default
  2. Subscribe to device events from another device with Particle.subscribe("temperature", handlerFunction, MY_DEVICES) or use the Server-Sent Events (SSE) REST stream: GET https://api.particle.io/v1/devices/events?access_token=<TOKEN> to receive all events in real time
  3. Create a webhook in the Particle Console or via POST https://api.particle.io/v1/integrations specifying the event name trigger, target URL, HTTP method, and optional request body template using Mustache placeholders like {{PARTICLE_EVENT_VALUE}}
  4. The webhook fires when the matching event is published; Particle Cloud sends a hook-sent event confirming dispatch and a hook-response event containing the HTTP status and response body from the target URL — subscribe to these to debug webhook delivery
  5. Use the REST API to query device status: GET https://api.particle.io/v1/devices/<deviceId>?access_token=<TOKEN> returns the device's online state, last heard timestamp, firmware version, and variables; call a function with POST /v1/devices/<deviceId>/<functionName>
  6. Implement error handling for webhook failures: Particle Cloud uses adaptive retry with backoff when the target URL returns 4xx or 5xx responses; after repeated failures it temporarily pauses webhook delivery to protect the receiving server

Known gotchas

Related routes

Subscribe to SmartThings device events via the Subscriptions API from a webhook SmartApp
iot · 5 steps · unrated
Subscribe to Matterport model processing events via the Webhooks framework
matterport.github.io · 6 steps · unrated
Flash new firmware to a Particle device over-the-air via the Cloud API
iot · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans