Transfer a principal and move an Account

Make another Person an Account's Principal, and move an Account to a new parent, with the Wingspan V3 API.

Two Account calls change who owns an Account or where it sits in the tree. One makes a different Person the Account's Principal. The other re-parents the Account.

Prerequisites

  • An Account credential. Use X-Wingspan-Account when you act on a child Account.
  • Scope users.account-ownership:write to transfer a Principal. Scope users.account:write to move an Account.
  • Send an Idempotency-Key on both calls.

Endpoints

Method and pathOperation
POST /v3/platform/accounts/{accountId}/transfer-principaltransferAccountPrincipal
POST /v3/platform/accounts/{accountId}/movemoveAccount

Transfer the Principal

The body is { "personId": "..." }, and personId is required. The named Person becomes the Account's Principal. Wingspan creates that Person's Stakeholder row, or promotes it if it exists. Any Account Admin can call it.

This call needs an elevated session from the signed-in Person (step-up), because it's a stakeholder change. A generic Stakeholder PATCH can't promote or demote the Principal. See Team access and roles and Stakeholder invitations.

curl -X POST https://api.wingspan.app/v3/platform/accounts/$ACCOUNT_ID/transfer-principal \
  -H "Authorization: Bearer $WINGSPAN_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{ "personId": "Zk4rT9wQmL2xNb7vHc3PdS" }'

The 200 response is the Account with the new Principal. The id in the example is illustrative.

StatusWhen
403The caller isn't an Account Admin, or the session isn't elevated.
404The Account or Person isn't visible to the caller.
409The transfer conflicts with the Account's current state.
422The Account is not a business.

Move an Account

The body is { "newParentAccountId": "..." }, and newParentAccountId is required. The call re-parents the Account within the hierarchy and returns the moved Account with 200. It costs two units of rate limit.

curl -X POST https://api.wingspan.app/v3/platform/accounts/$ACCOUNT_ID/move \
  -H "Authorization: Bearer $WINGSPAN_TOKEN" \
  -H "X-Wingspan-Account: $ACCOUNT_ID" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{ "newParentAccountId": "Nw7kQ2pLx9RtVb3mHc5dZa" }'
StatusWhen
403The caller lacks write authority on the Account.
404The Account or the new parent isn't visible to the caller.
409The move would create a cycle, or cross an organization boundary.
422newParentAccountId is missing or invalid.

After a move, read the new position with GET .../ancestors or GET .../parent-link. See Account hierarchy and settings.

Related pages


Did this page help you?