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
- 200
- 400
- 404
- 409
- 422
- 500
The site after the change (or unchanged, for a repeat).
Malformed input: a body that is not valid JSON, a location code that is not seven [A-Z0-9] segments, a missing required identifier, a query parameter outside its documented enum, an invalid limit / cursor or an undeclared query parameter on a paged collection, or a missing / malformed Idempotency-Key on a POST.
The named site, zone, aisle, slot, location type or placement rule does not exist.
The site is decommissioned (site-not-active), or another writer changed it between this request's read and write (concurrent-modification).
The role is missing, UNSPECIFIED, or not one of the known site roles (invalid-site-role).
An unexpected failure, e.g. the datastore is unavailable.