Back to API Overview

Pending changes API

Changes waiting for your OK: what became of each, and cancelling one.

2 endpoints

Endpoints

POST
/api/v1/pendingChanges/dismiss

Cancel a change that is waiting for a person's OK (an answer with "pendingChange"), so it never happens. Param: id (the pendingChange.id from that answer). Use it when the person no longer wants it or before preparing another version. It also clears stale or expired cards. For a change this person's own AI asked for from this same place, or, for whoever approves every card here, another person's function change (as pendingChanges_status); any other id reads "not found". It never approves anything. Returns { dismissed: true }; afterwards pendingChanges_status says "dismissed" (or "expired").

Parameters

idstringrequired

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/pendingChanges/dismiss \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "id": "example"
}'
POST
/api/v1/pendingChanges/status

Check what became of a change you asked for, answered with "pendingChange" (waiting for the person's OK). Param: id (the pendingChange.id from that answer). Returns { id, status, message, lines, expiresAt, resultNote, subjectKind }, and on an applied card that hands something back, `result` (a file link card: { url, expiresAt }, the 1-hour link the person allowed; give it only to the service that needs it, and ask for a new one once it has stopped). status is "waiting" (not answered yet; nothing changed, so do not say it is done), "applying" (Allow was tapped and it is being applied: check again in a moment), "applied" (allowed and applied), "dismissed" (cancelled, or they said no: do not ask again unless they ask), "expired" (not answered within 24 hours; nothing changed), "refused" or "moved" (it could not go ahead; nothing changed, the message says why) or "undone"; message says it in words to relay. Only reads; it cannot allow anything: the person answers on the card in the Serenities chat, on the Approvals page (/dashboard/approvals, which lists everything waiting for them) or at the link in the answer you were given (to cancel it, use pendingChanges_dismiss). It answers for a change this person's own AI asked for from this same place (this chat, AI app or API key) and, for whoever approves every card here, another person's function change (read-only), in this workspace; for one asked in another workspace this person belongs to, it returns { message, otherWorkspace: { name } } instead: relay the message (they switch workspaces to answer); any other id reads "not found". Call it when the person asks what happened to a change, or before telling them it is done; checking again too soon changes nothing.

Parameters

idstringrequired

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/pendingChanges/status \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "id": "example"
}'