---
title: "Create or replace a location by id"
method: PUT
path: "/api/v2/location/{id}"
tags: ["Location"]
---

# Create or replace a location by id

`PUT /api/v2/location/{id}`

## Request

- Base URL: `https://www.onlyworlds.com`
- URL: `https://www.onlyworlds.com/api/v2/location/{id}`
- Auth: API key in header `API-Key` and API key in header `API-Pin`

## Path parameters

- `id` string, uuid, required

## Headers

- `X-OW-Agent` string

## Request body

- LocationWrite: A full location write (POST creates; PUT creates or fully replaces, resetting omitted fields to empty). Any key that is neither a field below nor an extension field (atlas_*, shadow_*, x_*) is a 422, including the server-managed type, created_at, updated_at and change_seq.
  - `id` string, uuid: POST: optional client-minted id (any RFC 4122 UUID; the server mints a UUIDv7 otherwise). PUT/PATCH: ignored, the path id wins.
  - `name` string, nullable, required: Name of the element. null stores ''.
  - `description` string, nullable: Any kind of details about the element. null stores ''.
  - `supertype` string, nullable: The top level category to which the element belongs. null stores ''.
  - `subtype` string, nullable: The sub level category through which the element is further classified. null stores ''.
  - `image_url` string, nullable: URL to an image representing the element. null stores ''.
  - `form` string, nullable: Visual and environmental aspects of the location. null stores ''.
  - `function` string, nullable: Main use, role, or purpose of the location within the world. null stores ''.
  - `political_climate` string, nullable: Political structure, stability, and dynamics of the location. null stores ''.
  - `customs` string, nullable: Cultural practices, habits, or festivals. null stores ''.
  - `infrastructure` string, nullable: Roads, ports, and other physical systems that enable the movement of goods and people. null stores ''.
  - `architecture` string, nullable: Look, form, and materials used in the built environment and location design. null stores ''.
  - `defensibility` string, nullable: Qualities of natural, constructed, and implemented defenses at the location. null stores ''.
  - `founding_date` integer, nullable: Date on which the location was founded, established, or designated.
  - `elevation` integer, nullable: Height or elevation of the location relative to surrounding terrain, in the world's distance unit (World distance_unit).
  - `parent_location` string, uuid, nullable: Wider location that this location is part of. Links a Location: an existing one in this world.
  - `primary_power` string, uuid, nullable: Institution that has the highest degree of political control over the location. Links an Institution: an existing one in this world.
  - `governing_title` string, uuid, nullable: Governing figure assigned by the location's primary power. Links a Title: an existing one in this world.
  - `zone` string, uuid, nullable: Zone of interest that is associated with the location. Links a Zone: an existing one in this world.
  - `rival` string, uuid, nullable: Location with an active, traditional, or historical rivalry with this one. Links a Location: an existing one in this world.
  - `partner` string, uuid, nullable: Location with active, cooperative, or historical ties to this one. Links a Location: an existing one in this world.
  - `populations` string[], nullable: Distinct collective groups or communities residing within the location. Links Collective elements; replaces the whole list (null is the same as []). Every id must name an existing one in this world.
  - `secondary_powers` string[], nullable: Institutions with significant political control. Links Institution elements; replaces the whole list (null is the same as []). Every id must name an existing one in this world.
  - `founders` string[], nullable: Individual(s) who founded or named the location. Links Character elements; replaces the whole list (null is the same as []). Every id must name an existing one in this world.
  - `cults` string[], nullable: Significant religious constructs practiced or recognized at the location. Links Construct elements; replaces the whole list (null is the same as []). Every id must name an existing one in this world.
  - `delicacies` string[], nullable: Organisms or other species locally consumed or celebrated as specialty foods. Links Species elements; replaces the whole list (null is the same as []). Every id must name an existing one in this world.
  - `extraction_methods` string[], nullable: Techniques or strategies used to gather natural resources. Links Construct elements; replaces the whole list (null is the same as []). Every id must name an existing one in this world.
  - `extraction_goods` string[], nullable: Products and materials that are gathered or obtained. Links Construct elements; replaces the whole list (null is the same as []). Every id must name an existing one in this world.
  - `industry_methods` string[], nullable: Techniques or workflows used to refine or manufacture goods. Links Construct elements; replaces the whole list (null is the same as []). Every id must name an existing one in this world.
  - `industry_goods` string[], nullable: Products and materials that are refined or manufactured. Links Construct elements; replaces the whole list (null is the same as []). Every id must name an existing one in this world.
  - `extraction_markets` string[], nullable: Locations that receive extracted goods through trade, interchange, or seizure. Links Location elements; replaces the whole list (null is the same as []). Every id must name an existing one in this world.
  - `industry_markets` string[], nullable: Locations that receive industrial goods through trade, interchange, or seizure. Links Location elements; replaces the whole list (null is the same as []). Every id must name an existing one in this world.
  - `currencies` string[], nullable: Trade media recognized or circulated at the location. Links Construct elements; replaces the whole list (null is the same as []). Every id must name an existing one in this world.
  - `buildings` string[], nullable: Notable structural objects at the location. Links Object elements; replaces the whole list (null is the same as []). Every id must name an existing one in this world.
  - `building_methods` string[], nullable: Techniques or systems used to construct structures at the location. Links Construct elements; replaces the whole list (null is the same as []). Every id must name an existing one in this world.
  - `fighters` string[], nullable: Military units or forces responsible for defending the location. Links Construct elements; replaces the whole list (null is the same as []). Every id must name an existing one in this world.
  - `defensive_objects` string[], nullable: Objects or installations for defending the location. Links Object elements; replaces the whole list (null is the same as []). Every id must name an existing one in this world.
  - `world` unknown
  - `created_by` unknown
  - `changed_by` unknown
  - `changed_via` unknown

## Response `200`

Replaced: the full element.

- Location: A location as the API returns it. Single links are an id or null, multi links an array of ids; extension fields appear inline. `?fields=` returns only the named keys, and `?expand=` replaces the named links' ids with ElementStub objects.
  - `type` 'location', required
  - `id` string, uuid, required
  - `name` string, required: Name of the element.
  - `description` string, required: Any kind of details about the element.
  - `supertype` string, required: The top level category to which the element belongs.
  - `subtype` string, required: The sub level category through which the element is further classified.
  - `image_url` string, required: URL to an image representing the element.
  - `form` string, required: Visual and environmental aspects of the location.
  - `function` string, required: Main use, role, or purpose of the location within the world.
  - `political_climate` string, required: Political structure, stability, and dynamics of the location.
  - `customs` string, required: Cultural practices, habits, or festivals.
  - `infrastructure` string, required: Roads, ports, and other physical systems that enable the movement of goods and people.
  - `architecture` string, required: Look, form, and materials used in the built environment and location design.
  - `defensibility` string, required: Qualities of natural, constructed, and implemented defenses at the location.
  - `founding_date` integer, nullable, required: Date on which the location was founded, established, or designated.
  - `elevation` integer, nullable, required: Height or elevation of the location relative to surrounding terrain, in the world's distance unit (World distance_unit).
  - `parent_location` string, uuid, nullable, required: Wider location that this location is part of. A Location's id.
  - `primary_power` string, uuid, nullable, required: Institution that has the highest degree of political control over the location. An Institution's id.
  - `governing_title` string, uuid, nullable, required: Governing figure assigned by the location's primary power. A Title's id.
  - `zone` string, uuid, nullable, required: Zone of interest that is associated with the location. A Zone's id.
  - `rival` string, uuid, nullable, required: Location with an active, traditional, or historical rivalry with this one. A Location's id.
  - `partner` string, uuid, nullable, required: Location with active, cooperative, or historical ties to this one. A Location's id.
  - `populations` string[], required: Distinct collective groups or communities residing within the location. Collective ids.
  - `secondary_powers` string[], required: Institutions with significant political control. Institution ids.
  - `founders` string[], required: Individual(s) who founded or named the location. Character ids.
  - `cults` string[], required: Significant religious constructs practiced or recognized at the location. Construct ids.
  - `delicacies` string[], required: Organisms or other species locally consumed or celebrated as specialty foods. Species ids.
  - `extraction_methods` string[], required: Techniques or strategies used to gather natural resources. Construct ids.
  - `extraction_goods` string[], required: Products and materials that are gathered or obtained. Construct ids.
  - `industry_methods` string[], required: Techniques or workflows used to refine or manufacture goods. Construct ids.
  - `industry_goods` string[], required: Products and materials that are refined or manufactured. Construct ids.
  - `extraction_markets` string[], required: Locations that receive extracted goods through trade, interchange, or seizure. Location ids.
  - `industry_markets` string[], required: Locations that receive industrial goods through trade, interchange, or seizure. Location ids.
  - `currencies` string[], required: Trade media recognized or circulated at the location. Construct ids.
  - `buildings` string[], required: Notable structural objects at the location. Object ids.
  - `building_methods` string[], required: Techniques or systems used to construct structures at the location. Construct ids.
  - `fighters` string[], required: Military units or forces responsible for defending the location. Construct ids.
  - `defensive_objects` string[], required: Objects or installations for defending the location. Object ids.
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required
  - `change_seq` integer, required: The world change sequence at this element's last write.
  - `created_by` string, uuid, nullable, required: The world membership that created this element, or null when the world's owner did.
  - `changed_by` string, uuid, nullable, required: The world membership that last changed this element, or null when the world's owner (or the server) did, or no write has touched it since doors were recorded.
  - `changed_via` 'seat' | 'mcp' | 'declared' | 'api' | 'v1' | 'sync' | 'server' | 'null', nullable, required: The door of the last change: `seat` (an agent seat), `mcp` (the MCP server), `declared` (the request sent an X-OW-Agent header), `api`, `v1`, `sync` (the mobile app's sync) or `server` (the server, on its own behalf). The first three mean an agent made it. Null: no write since doors were recorded.
  - `known_of` true: Present, and true, only on an element this reader knows of but does not see whole: a guest or player reaches it only because its own Character's sheet links to it (one step out). Such a row keeps `id`, `type`, `name`, `description`, `supertype`, `subtype`, `image_url`, `created_at`, `updated_at` and `change_seq`; every other field reads as unset (text "", numbers and single links null, multi links [], `created_by`, `changed_by` and `changed_via` null, no extension fields), its files are 404, and search matches only its name and description. Absent: the element is whole. Any other grant (it names the reader's Character, the reader knows it, it is on the roster, the reader made it) makes it whole; a hidden element is never even a stub.

## Other responses

- `201`: Created: the full element.
- `400`: A link names an element that does not exist in this world (code invalid_link).
- `401`: Missing, invalid or revoked credential, or a wrong PIN (authentication_error; code key_revoked for a revoked key, invalid_credentials otherwise).
- `403`: The credential is valid but lacks the scope: a read key on a write route (permission_error). Or a contributor or guest key changed, replaced, relinked or deleted an element someone else created (code not_author); those members change only their own, and, for an agent seat the owner gave a Character, that Character (never deleting it).
- `409`: The id is held by an element in another world (id_conflict).
- `422`: Invalid request: unknown or read-only field, bad value, unknown query parameter, over-long text, extensions over the size cap (invalid_request); `param` names the culprit.
- `429`: Too many failed PIN attempts; see the Retry-After header (rate_limited). Or too many requests: over the request budget (code too_many_requests, type rate_limited): 300 requests a minute per key or account token, 60 a minute per address for a request with neither. Retry after the Retry-After header's seconds.
- `503`: The server is busy: every request slot stayed full for 10 s (code server_busy, type api_error). Retry after the Retry-After header's seconds.

## Changes

- **2026-10-20** `4dd5b1cd0687`: 14 warning, 2 info
  - added the new `character_taken` enum value to the `error/code` response property for the response status `400`
  - added the new `character_taken` enum value to the `error/code` response property for the response status `401`
  - added the new `character_taken` enum value to the `error/code` response property for the response status `403`
  - added the new `character_taken` enum value to the `error/code` response property for the response status `409`
  - …12 more

[Operation history](https://skmtc.dev/onlyworlds/apis/onlyworlds-api/changes/api/v2/location/:id/put.md)

---

[API](https://skmtc.dev/onlyworlds/apis/onlyworlds-api.md) · [All operations](https://skmtc.dev/onlyworlds/apis/onlyworlds-api/llms.txt) · [OpenAPI document](https://skmtc.dev/onlyworlds/apis/onlyworlds-api/revisions/4dd5b1cd0687?raw)
