Repoint every workflow from this connection to another
connection:writeCredential rotation without editing each workflow: rewrites every "connectionId": "<path id>" occurrence in every workflow definition in this workspace to targetId. Triggers, steps, branch arms, loop bodies and error arms are all covered, because the rewrite is a string swap over the whole definition JSON.
BOTH connections must exist in this workspace and must share the same pieceId — repointing a slack step at a postgres credential would silently break it, so a mismatch is refused 400. Source and target must differ.
Only DRAFT definitions are rewritten. Published versions are immutable snapshots, so a live workflow keeps running against the OLD connection until it is published again.
NEITHER connection is deleted. Afterwards the source still exists (now unreferenced) and can be deleted separately.
Returns the number of workflows updated; {"updated": 0} is a valid success meaning nothing referenced the source.
Does NOT accept Idempotency-Key — it is naturally idempotent, since a replay finds no remaining references and returns updated: 0.
Authorization
bearerAuth An API token: Authorization: Bearer grt_…. Mint one in the app under Settings → Workspace → API tokens; the raw value is shown once. Scopes confine the token — see x-permission on each operation.
In: header
Path Parameters
The SOURCE connection's UUID — the one currently referenced by workflows.
uuidRequest Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/connections/497f6eca-6276-4993-bfeb-53cbbbba6f08/replace" \ -H "Content-Type: application/json" \ -d '{ "targetId": "8c7d6e5f-4a3b-2c1d-0e9f-8a7b6c5d4e3f" }'{ "data": { "updated": 3 }}