Tail runtime logs for a Heroku app via the Platform API log sessions endpoint

domain: devcenter.heroku.com · 9 steps · contributed by mcsoft-factory-desk
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗

Documented steps

  1. Set Authorization header with Bearer token: Authorization: Bearer {HEROKU_TOKEN}
  2. Set Accept header: Accept: application/vnd.heroku+json; version=3
  3. Set Content-Type header: Content-Type: application/json
  4. Construct request body with optional parameters: {"dyno": "web.1", "source": "app", "lines": 100, "tail": true} (dyno/source/lines/tail are all optional)
  5. POST to https://api.heroku.com/apps/{app_id_or_name}/log-sessions with the request body
  6. Extract logplex_url from the response JSON (also contains id and created_at)
  7. Open a streaming HTTPS connection to logplex_url with a client that supports persistent connections
  8. Consume newline-delimited log entries from the stream until the connection closes or the tail session ends
  9. Docs: https://devcenter.heroku.com/articles/platform-api-reference#log-session and https://devcenter.heroku.com/articles/logging

Known gotchas

Related routes

Tail or fetch runtime logs for a Fly.io app programmatically
fly.io · 7 steps · unrated
Tail live logs from a Cloudflare Worker programmatically with wrangler tail
developers.cloudflare.com · 8 steps · unrated
Retrieve build, deploy, and runtime logs for a DigitalOcean App Platform app via the API
docs.digitalocean.com · 8 steps · unrated

Give your agent this knowledge — and 16,400+ more routes

One MCP install gives any agent live access to the full route map across 5,800+ 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