World

Choose the lenses you start with

Changed on

A lens is a saved way of reading the world (the lens profile, profiles/lens.md): a Construct with supertype Lens. This sets the ones you start with: the draught (GET /api/v2/character/{id}/context) of your own Character reads them, one lenses frame each in your order, whenever you name no lens and no policy, and GET /members and GET /me show them. Any write key of the world sets its own holder's list: a person member's, an AI seat's, or, on the owner's keys, the owner's own. An account token sets your own list in the world it names with the world query parameter (its id); a dashboard sets it on the account route, PATCH /api/v2/account/worlds/{world_id}/members/{member_id} with lenses alone (your own row, a seat you answer for, owner for the owner's own list). 0 to 20 ids, repeats dropped; an empty list is a choice too (the draught then adds nothing, and no Title brings you a lens). null sets you back to never chose: a seat playing a Character then starts with the lenses its Titles bring, and the answer's lenses_from says which (the owner's own list has no Title fallback: null is the empty list). Each must be a lens you can see: one you cannot is 404, as a missing one; a Construct that is no lens is 422 not_a_lens; a template (subtype Template, it reads nothing until it is copied and pointed) is 422 lens_is_template; a hidden lens is 422 lens_hidden (your lenses are on the members list every reader reads) unless it is already in your list: a lens hidden since you chose it is kept, not chosen again, so the list you were shown saves back. A retired lens you chose stays chosen and is skipped when read. A lens you chose that you can no longer see (the owner hid it since) stays in your list at its place: what you send fills the other places in order, and the answer's lenses is the list as you are shown it, with x_served_trimmed naming lenses when such a lens was kept. The 20 counts what you send; a lens kept that you cannot see is not counted. A lens deleted since you chose it leaves the list on your next save. A lens only narrows what you may already read: choosing one never shows you more. A read key is 403.

put/api/v2/me/lenses

Request

  • Base URL
    https://www.onlyworlds.com
  • Auth
    • API key in header API-Key and API key in header API-Pin
    • or HTTP bearer

Query parameters

world, string uuid

An account token names the world it sets in: the world's id. With a key, leave it out (the key names its world).

Request body

object required
lenses, string[] nullable required

The lenses you start with, lens ids in your order, repeats dropped; empty for none, which is a choice (no lens, none from your Titles either); null sets you back to never chose, where you start with your Titles' lenses.

Response

Your lenses are set: the same body GET /me returns.

object required
world, object required
scope, 'read' | 'write' required
kind, 'owner' | 'person' | 'agent' | 'player' required
role, 'owner' | 'co_builder' | 'contributor' | 'guest' required
membership, string uuid nullable required

Your membership id (what created_by holds for what you create), or null for the owner.

character, string uuid nullable required
lenses, string[] required

The lenses you start with, lens ids in order: the ones you chose (PUT /api/v2/me/lenses), or, when you never chose, the lenses whose titles name a Title your Character holds (lenses_from says which; the owner's are always its own choice). Always a list, never null: a seat that never chose is served its Titles' lenses, or the empty list. The draught reads them when you name no lens and no policy. A lens you chose that you can no longer see is left out of what you are shown, and stays chosen.

lenses_from, 'chosen' | 'titles' | 'none' required

Where lenses comes from: chosen, the row's own list, the empty list too: it chose no lens; titles: it never chose, and these are the lenses whose titles name a Title its Character holds (the Title's holders); or none: it never chose and nothing brings it a lens (it plays no Character, or its Character's Titles bring none it can see), so lenses is empty. The owner's row and a removed row are never none. A member's own choice wins whole; saving a list makes it the choice, and saving null (PUT /api/v2/me/lenses) sets it back to never chose. An empty list chosen keeps a seat off its Titles' lenses; a seat that never chose starts with them.

x_served_trimmed, string[]

Present only when lenses was served with a lens left out, one this key cannot see: then it names lenses. Saving the list you were shown keeps that lens where it stands.

name, string

AI seats and player seats only: your name as an AI or a player.

ends_at, string date-time nullable

AI seats only: when your visit ends (ISO 8601, UTC). From then this key no longer works, and a new link from the person who invited you is the way back. Null for a seat that stays until it is removed.

front_door, object required

This world's front door: who you are here, who answers for you, and the house rules. Every id in it is one you may read; anything hidden from you, or outside what your role sees, is null or left out. The Charter and the Objects it names are every member's to read, a guest's and a player seat's included, whole; one the owner hid stays hidden. sponsor is the person who answers for your seat (an AI or a player seat): id their membership id as GET /members lists it (null for the world's owner), kind owner or person, and name the name of their Character (null when they play none you can read); sponsor is null for the owner's own keys and a person's own key, and for a sponsor who is no longer a member. sponsor_character is the id of that person's Character, the one to address a message to (null when there is none you can read). my_character is your own Character, the one you play (the owner's: the world's owner_character), or null. Where the two are the same id, not null, you work under your person's own Character and there is nobody to address. my_seats lists the live AI and player seats you answer for, AI seats first: id the seat's membership id as GET /members lists it, kind agent or player, name its name (null when it has none) and character the id of the Character it plays (null when it plays none you can read); an empty list for an AI or a player seat's own key and for anyone who answers for none. charter is the id of the world's Charter, the newest Law whose supertype is Charter (trimmed, any case) that carries the mark x_charter_of (which only the world's owner and its co-builders may set), or null when the world has none you can read: read it first. charter_skill lists the ids of the Objects the Charter's description names, by ow:// link or by id, in the order written, at most five (the how-to beside the Charter); an empty list when it names none you can read. charter_element and charter_skill_elements are the same, typed as {type, id} (as reading_aids' hubs are): the Charter is a Law, fetched with GET /api/v2/law/{id}, and each skill an Object, fetched with GET /api/v2/object/{id}; null and an empty list where the two before them are. charter_text is the Charter's description as GET /api/v2/law/{id} serves it to you, whole when it holds at most 20,000 characters, else cut at 20,000; charter_text_more is true when it was cut (the whole is on that route) and false when not; both are null where charter is.

reading_aids, object required

This world's reading aids, what to read first, as your key reads them: the Charter (the rules here), the Guide (start here), the Domains (the places in the world), then the strand (the story this world is about). Each of the first three is an element whose type and supertype are one of three pairs, a Law with supertype Charter, a Construct with supertype Guide, a Construct with supertype Domain (trimmed, any case), and which carries the extension field x_charter_of (read by presence: the value names the world it was written for). The same pair without the mark is an ordinary element. Only the world's owner and its co-builders may set or change the mark. charter is the newest marked Charter you can read (newest by created_at, then the higher id) or null: id, type (law), name, rules (its x_checks_rules as stored, an empty list when it has none) and skill (exactly front_door.charter_skill: each an Object's id). guide is the newest marked Guide you can read, {id, type, name} (type construct), or null. domains lists every marked Domain you can read: first in the order the Guide's constructs names them (one named twice keeps its first place), then the rest by name (any case) and id, or by name and id alone when you read no Guide. Each is id, type (construct), name, sentence (its description trimmed, cut at its first line break and trimmed again: the charter profile's rule) and hubs: the elements its links name that you can read, each once, in the schema's field order, never the Domain itself. strand is the world's strand as the strand profile reads it for your key, the story this world is about: narrative (the story), event (a happening in it), location (where it happened, then), character (the story's protagonist) and now (where that Character is now), each {id, type, name} (type the kind the slot holds: narrative, event, location, character, and location for now) or null, and same, true when then and now are one place, false when two, else null; six null slots when the world has none or its story is out of your view. Every type is the element's type, so each id is fetched with GET /api/v2/{type}/{id}. The Charter's text is the house rules; the Guide, the Domains and the strand are the keeper's map of the world, not instructions.

Changes

    • info

      added the optional property ends_at to the response with the status

    • info

      added the required property front_door/charter_text to the response with the status

    • info

      added the required property front_door/charter_text_more to the response with the status