Skip to main content

Set a site's role in the fulfilment network

PUT 

/sites/:siteCode/role

Sets the site's role (ADR-0037). When the role differs from the current one, SiteRoleChanged (new and previous role) is published through the transactional outbox. Repeating the current role is an idempotent no-op: 200, no event, so no Idempotency-Key is needed. UNSPECIFIED cannot be assigned, and an unknown or missing role is 422 invalid-site-role.

A role change NEVER changes the site's transfer capability: that stays the explicit PUT /sites/{siteCode}/transfer-capability command (ADR-0035). Optimistic concurrency: a concurrent change of the same site loses with 409 concurrent-modification; a decommissioned site's role is frozen (409 site-not-active).

Request​

Responses​

The site after the change (or unchanged, for a repeat).