Rounds & Reps developer guide
Pivot website agent API
Edit the Pivot Fitness Hoover website, preview changes, and publish the reviewed result. This guide is public; the API requires Pivot's private site key.
Connect
API base URL: https://api.roundsandreps.com/v1
Send Authorization: Bearer <site key> with every request. Obtain the key privately from your Rounds & Reps contact. Never put it in source code, a public issue, or a URL.
The key is scoped to Pivot. File paths are relative to clients/pivot-fitness-hoover/; other client sites and platform files cannot be edited through this API.
Endpoints
| Method | Path | Purpose |
|---|---|---|
| GET | /site | Site URLs, current main SHA, preview and live release status |
| GET | /files | List editable site files |
| GET | /files?path=src/App.jsx&ref=main | Read a file as base64; ref may be a change ID |
| POST | /changes | Commit files to an agent branch and open a PR |
| GET | /changes/{id} | Check PR head and preview status |
| PATCH | /changes/{id} | Revise an open change |
| POST | /changes/{id}/refresh | Bring an open change up to date with main |
| POST | /changes/{id}/preview | Deploy the green, exact-head build to staging |
| POST | /changes/{id}/publish | Promote the completed preview artifact to production |
| POST | /rollback | Restore the previous deployed artifact |
Paths above are appended to the /v1 base URL.
Create and preview a change
- Call
GET /siteand savemain_sha. UseGET /filesto inspect the site and read complete files before editing. - Send
POST /changeswith that SHA, a message, and complete replacement files encoded as base64. A file deletion uses{"path":"old-file.txt","delete":true}. - Wait for the change's exact-head build to pass, then call
POST /changes/{id}/preview. Inspect the returned preview URL in a browser and wait forGET /site→releases.preview.cdn_statusto equalCompleted. - Once the preview is accepted, call
POST /changes/{id}/publish. Wait forreleases.live.cdn_statusto equalCompleted, then check the live site.
Publish requires the same change head that was previewed and a current, clean main branch. If main advanced, call POST /changes/{id}/refresh and preview again. If only the change head advanced, preview its new head.
{
"base_sha": "<main_sha from GET /site>",
"message": "Update homepage headline",
"files": [
{"path": "src/App.jsx", "content_base64": "<base64 of complete file>"}
]
}
Limits and rollback
Each revision supports up to 25 files, 6 MB per file, and 7 MB per request. One Pivot change may be open at a time so the preview URL remains unambiguous. Revisions use PATCH /changes/{id} with files, message, and expected_sha from GET /changes/{id}.
POST /rollback restores the previous deployed artifact; it does not revert Git history. Inspect the current release with GET /site before and after rollback.