# Update a location

Updates the fields supplied and returns the location in the same shape as reading
it. Only the fields sent are touched, so an empty body is a valid request that
changes nothing.

Renaming a location does not affect the venues under it or the roles advertised at
those venues.

Endpoint: PUT /api/v2/headcount/location/{id}
Version: 2.0.0
Security: default

## Path parameters:

  - `id` (integer, required)
    The ID of the location.

## Header parameters:

  - `Rosterfy-Platform` (string)

## Request fields (application/json):

  - `name` (string)
    The name administrators see. Required.

  - `frontend_name` (string)
    The name volunteers see in the portal. Required, and shown in place of `name` to anyone without administrator access, so it is worth setting even when the two match.

  - `code` (string)
    A short reference for the location, unique within the account regardless of case. Letters, numbers, dashes and underscores only - spaces and punctuation are rejected. Stored and returned in upper case whatever case it is sent in.

  - `training_ids` (array)
    The IDs of the training modules assigned to anyone who accepts a role at this location. **Replaces the whole list** rather than adding to it, so send every module you want kept. Omitting the field leaves the stored list untouched.

  - `headcount_location_type_id` (integer)
    The ID of the location type to file this location under. Optional; omit or send null to leave the location untyped. Must be the ID of a type the account holds.

## Response 200 fields (application/json):

  - `object` (object)

  - `object.id` (integer)

  - `object.account_id` (integer)

  - `object.headcount_location_type_id` (integer)

  - `object.name` (string)

  - `object.frontend_name` (string)

  - `object.code` (string)

  - `object.training_ids` (array)

  - `object.is_system` (integer)

  - `object.deleted_at` (string | null)

  - `object.created_at` (string)

  - `object.updated_at` (string)

  - `object.uuid` (string)

  - `nice` (object)

  - `nice.rrn` (string)

  - `nice.headcount_location_type_name` (string)

  - `relations` (object)

  - `relations.headcount_location_type` (object)

  - `relations.headcount_location_type.object` (object)

  - `relations.headcount_location_type.object.id` (integer)

  - `relations.headcount_location_type.object.name` (string)

  - `relations.headcount_location_type.object.sort_order` (integer)

  - `relations.headcount_location_type.object.uuid` (string)

  - `relations.headcount_location_type.nice` (array)

  - `relations.headcount_location_type.permissions` (object)

  - `relations.headcount_location_type.permissions.read` (boolean)

  - `relations.headcount_location_type.permissions.update` (boolean)

  - `relations.headcount_location_type.permissions.delete` (boolean)

  - `permissions` (object)

  - `permissions.read` (boolean)

  - `permissions.update` (boolean)

  - `permissions.delete` (boolean)

