Create location

Create a new location. Returns the id and name of the new location. A campus needs an organization while multi-org is on (400 when missing, 403 HTTP response when a limited caller names one outside their reach) and takes the default organization otherwise; a sent organization that is archived returns 400 and an unknown one 404, multi-org on or off. Any other location type (a venue) takes the organization sent while multi-org is on, for every caller (403 HTTP response for one outside their reach; archived 400, unknown 404). With none sent it belongs to the caller's organization when their limit reaches exactly one, a caller whose limit reaches several gets 400, and anyone else's belongs to the default organization. While multi-org is off a venue ignores a sent organization and belongs to the default organization. A type from another list (such as a gender, or the location_types list itself) returns 400 with the message location_type_invalid_desc.

Required permission: Locations

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params

The details of the new location

string | null
required

The location's name (max 50 characters).

type
object | null
required

The location type. On writes, provide either id or code (code wins when both are set). A value from another list (such as a gender, or the location_types list itself) returns 400 location_type_invalid_desc on create, and on edit when the type changes to it; a location that already holds such a value still saves while its type is sent back unchanged. Hidden location types are accepted. On edit, a type change that crosses the campus/venue line (a campus to a venue type, or a venue to the campus type) returns 400 location_convert_required_desc: convert the location from the Locations page instead. That check runs first, so a campus sent a value from another list also gets location_convert_required_desc. Changing between venue types is allowed. Values come from /api/property_values/location_types/values.

string | null

The location's description (max 2,000 characters).

timeZone
object | null

The campus's own time zone, a Windows id in code with its display name in name; values come from /api/accounts/timezones. Applies to campus-type locations only (a value sent for any other type is ignored) and is omitted when the campus has none, in which case it inherits its organization's zone, else the account's. On writes, provide the code; blank or omitted clears it.

boolean | null

Write-only. When the save changes the campus's effective time zone, its records are re-anchored so they keep their wall-clock (the default). Send true to keep the stored instants instead, so the times are relabeled in the new zone. Ignored when the zone does not change.

organization
object | null

The organization the location belongs to. Every location has one. On create, required for a campus while multi-org is on (400 when missing), otherwise the default organization is used; an archived organization returns 400 whether multi-org is on or off, and an unknown one returns 404. A location that is not a campus (a venue) takes the organization named here while multi-org is on, for every caller: one outside the caller's reach returns 403. Omitted, a new venue belongs to the caller's organization when their limit reaches exactly one, a caller whose limit reaches several gets 400, and anyone else's venue belongs to the default organization. On edit while multi-org is on, a venue moves to the organization named here when it differs from its current one: the caller must reach both (403), an archived organization returns 400 and an unknown one 404; its rooms and items follow it and its existing bookings stay as they are. Omitted on edit, the venue keeps its organization. While multi-org is off, a venue's organization is ignored on create (it belongs to the default organization) and on edit (it never changes). On edit, a campus cannot change organization: a different one returns 400; omit it or send the current one. Move a campus to another organization from the Locations page; a plain update that sends a different organization is refused. An inactive campus of an archived organization cannot be reactivated (400); it stays editable while it stays inactive.

address
object | null

The location's address, when one is set.

boolean

Whether the location is active.

Headers
string
enum
Defaults to application/json

Generated from available response content types

Allowed:
Responses

401

Authentication is required, or the Ocs-Api-Key header is missing or invalid.

Language
Credentials
Header
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
text/plain
application/json
text/json