# Update a venue

Updates the fields supplied and returns the venue. Only the fields sent are touched,
so an empty body is a valid request that changes nothing.
Sending `address` replaces the address already held rather than merging into it, so
send the whole address every time. Sending `is_virtual` as true detaches the address
instead, and the response to that request still shows the old address even though it
is gone - read the venue back to see its settled state.
A venue stays under the location it was created in; this endpoint does not move it.

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

## Path parameters:

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

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

## 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 venue. Letters, numbers, commas, dashes and underscores only - spaces and other punctuation are rejected. Accounts configured to require unique venue codes reject a code already in use; otherwise codes may repeat.

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

  - `is_virtual` (boolean)
    Whether the venue has no physical address. A virtual venue is excluded from proximity searches and sorts after venues that have coordinates. Setting this on an existing venue **detaches the address**, and switching it back off does not restore it - send the address again.

  - `description` (string)
    A description of the venue, in HTML. Shown to volunteers alongside the venue name.

  - `address` (object)
    Where the venue is, as an address object with `street_address_1`, `street_address_2`, `street_address_3`, `city`, `region`, `postcode` and a two-letter `country`. Optional even for a venue that is not virtual. On create the address is stored as sent; on update it replaces the address already held. Ignored when `is_virtual` is set in the same request.

## Response 200 fields (application/json):

  - `object` (object)

  - `object.id` (integer)

  - `object.headcount_location_id` (integer)

  - `object.name` (string)

  - `object.frontend_name` (string)

  - `object.code` (string)

  - `object.is_virtual` (integer)

  - `object.description` (string)

  - `object.is_system` (integer)

  - `object.training_ids` (array)

  - `object.deleted_at` (string | null)

  - `object.created_at` (string)

  - `object.updated_at` (string)

  - `object.uuid` (string)

  - `object.address` (object)

  - `object.address.iso` (string)

  - `object.address.region_code` (string)

  - `object.address.coordinates` (object)

  - `object.address.coordinates.latitude` (string | null)

  - `object.address.coordinates.longitude` (string | null)

  - `object.address.street_address_1` (string)

  - `object.address.street_address_2` (string | null)

  - `object.address.street_address_3` (string | null)

  - `object.address.city` (string)

  - `object.address.postcode` (string)

  - `object.address.region` (string)

  - `object.address.country` (string)

  - `object.address.latitude` (string | null)

  - `object.address.longitude` (string | null)

  - `nice` (object)

  - `nice.rrn` (string)

  - `nice.address` (string)

  - `nice.address_oneline` (string)

  - `nice.address.country` (string)

  - `nice.address.country:raw` (string)

  - `nice.address.city` (string)

  - `nice.address.region` (string)

  - `nice.address.region:raw` (string)

  - `nice.address.postcode` (string)

  - `nice.address.street_address_1` (string)

  - `nice.address.street_address_2` (string | null)

  - `nice.address.street_address_3` (string | null)

  - `nice.address.latitude` (string | null)

  - `nice.address.longitude` (string | null)

  - `nice.location_name` (string)

  - `nice.headcount_location_type_name` (string)

  - `nice.headcount_location_type_id` (integer)

  - `relations` (object)

  - `relations.location` (object)

  - `relations.location.object` (object)

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

  - `relations.location.object.account_id` (integer)

  - `relations.location.object.headcount_location_type_id` (integer)

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

  - `relations.location.object.frontend_name` (string)

  - `relations.location.object.code` (string)

  - `relations.location.object.training_ids` (array)

  - `relations.location.object.is_system` (integer)

  - `relations.location.object.deleted_at` (string | null)

  - `relations.location.object.created_at` (string)

  - `relations.location.object.updated_at` (string)

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

  - `relations.location.nice` (object)

  - `relations.location.nice.rrn` (string)

  - `relations.location.nice.headcount_location_type_name` (string)

  - `relations.location.permissions` (object)

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

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

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

  - `permissions` (object)

  - `permissions.read` (boolean)

  - `permissions.update` (boolean)

  - `permissions.delete` (boolean)

