documentation

API Reference

Full reference for the push endpoint and authentication

Authentication

All API requests require a bearer token in the Authorization header:

Authorization: Bearer <your-token>

Tokens are project-scoped — a token from project A cannot push to project B. To generate a token, open the project in your dashboard, then Project Settings, then API Tokens.


POST /api/push

Submit a bundle snapshot. The format is auto-detected from the request body structure.

Request

POST https://dendrobundle.com/api/push

Headers

Header Value
Authorization Bearer (required)
Content-Type application/json (required)

Query parameters

Parameter Type Description
branch string Branch name. Max 255 chars. Optional but recommended.
commit string Full 40-character commit SHA. Optional but recommended.

Body

Raw bundle stats JSON in any supported format. The body is parsed and the format detected automatically based on the top-level structure:

  • { assets, chunks, modules } → webpack-stats
  • { inputs, outputs } → esbuild-metafile
  • { results } → source-map-explorer
  • { tree, nodeParts, nodeMetas } → rollup-stats (rollup-plugin-visualizer; also covers Vite)

Response

200 OK — snapshot recorded successfully.

{
  "snapshotId": "snap_01j9x2k4m8p3q7r5t6w9y2z0",
  "format": "webpack-stats",
  "totalSizeBytes": 2528604,
  "assetCount": 23
}
Field Type Description
snapshotId string Unique identifier for the snapshot
format string Detected format (webpack-stats, esbuild-metafile, source-map-explorer, rollup-stats)
totalSizeBytes number Sum of all asset sizes in bytes
assetCount number Number of distinct output assets

400 Bad Request — unrecognized format or malformed JSON.

{
  "error": "unrecognized format: body does not match webpack-stats, esbuild-metafile, source-map-explorer, or rollup-stats shape"
}

401 Unauthorized — missing or invalid token.

{ "error": "invalid token" }

429 Too Many Requests — rate limit exceeded.

{ "error": "rate limit exceeded" }

Rate limits

The push endpoint allows 60 requests per minute per token. Requests over the limit receive a 429 response with a Retry-After header (seconds until the window resets). For normal CI usage — one push per build — you will never see this limit.

Snapshot retention

Retention follows your account plan:

Plan History
Community Rolling 10 most recent snapshots per project — older ones are pruned on each push
Developer Unlimited

Example

curl -sS \
  "https://dendrobundle.com/api/push?branch=main&commit=a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2" \
  -H "Authorization: Bearer $DENDROBUNDLE_TOKEN" \
  -H "Content-Type: application/json" \
  -d @dist/webpack-stats.json