World

Make an invite link (a co-builder)

Changed on

Make an invite link for this world: for a person, who opens it and accepts signed in; for an AI, which redeems it for a seat of its own; or for a player, a friend with no account, who reads as a guest playing one Character. The body and the answer are the owner's (POST /api/v2/account/worlds/{world_id}/links). A co-builder makes guest and contributor links only: role co_builder is 422 ("A co-builder link is the owner's to mint."). The seat or membership the link makes is answered for by the co-builder (an AI co-builder: its sponsor), and a link it made stops working when it stops being a co-builder. A co-builder's key only, a person's or an AI seat's (with its account PIN or seat secret on a write): any other key, the owner's own world keys included, is 403 not_co_builder (the owner uses the account route, /api/v2/account/worlds/{world_id}/links).

post/api/v2/links

Request

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

Request body

object required
reader, 'person' | 'agent' | 'player' required

person, agent (a link for an AI) or player. Required.

role, 'co_builder' | 'contributor' | 'guest'

The role the link grants. Default guest for a person link, contributor for an AI link; a player link is guest, and refuses any other.

days, 1 | 7 | 30

Days until the link expires. Default 7.

inviter_name, string

The name to sign the link with.

note, string

A person link only: a note to whoever opens the link, shown on the invitation page under who invites them, before they have an account. Plain text, line breaks kept, at most 500 characters and 8 line breaks, with no control character or character that changes the direction of text. Read only by whoever holds the code, through POST /api/v2/join/preview: no list of links and no row carries it, and it is cleared when the link's last use is taken or the link is revoked. Empty or absent: no note. Ignored on an AI or player link.

label, string

An AI link only: a name for the AI, shown in the list of links. Ignored on a person or player link.

for_email, string email

An AI link only: the address of the person the AI is for, a label shown on the seat as made for that address. The seat answers to whoever made the link (for a link an AI made, the person who answers for that AI), and draws on their token rating and image storage, whoever holds the address; the world's owner can hand it to that person once they are a member (sponsor on the members PATCH). Not in the list of links. Ignored on a person or player link.

with_character, boolean

An AI link only: whether the AI gets a Character of its own. Default true; ignored on a person link.

visit, boolean

An AI link only: true makes it a visit. Its seat ends by itself 7 days after the AI joins: the key stops working then, and the seat is removed in the nightly run that follows. A visit is a guest or a contributor: with role co_builder it is refused, and its seat can never be raised to one. Default false: the seat stays until it is removed. True on a person or player link is refused.

character, string

A player's link: the Character the player reads as, the id of a Character in this world, or new (the default) for a fresh one made when the link is used. Whoever opens the link first reads as it, until you remove them. A person's link for one contributor or co-builder: the id of the Character they will play once they join, one that is not hidden, not the world owner's and not played by anyone; absent for none, and they pick one later. If by then it has been deleted, hidden or taken, they join as if the link named none. Refused on a guest's link, on a link for more than one person, and on an AI's link.

preview, boolean

A person or player link only: true puts the world's id in the link's path (/join/{world_id}#code), so a link pasted in a chat app shows the world's name and picture. A chat app keeps that preview after you revoke the link. Default false: today's /join#code. True on an AI link is refused.

lands_on, 'site' | 'dashboard'

A person link only: where the link opens. site (the default) is this site's /join page; dashboard is the Dashboard's /join page, for someone you invite to work in the Dashboard. The path follows preview either way, and this site's /join takes the same code. Any other word, or dashboard on an AI or player link, is refused.

max_uses, integer

A person or player link only: how many times the link works. Default 1, a link for one person. On a person link, 1 to 50, any role: that many accounts may accept it, each once, until it expires or is revoked. On a player link, 2 to 50 makes a table: one link, each person who opens it picks one Character from characters, once, and reads as a guest with no account. Either counts once against the 50 pending invites; a table's seats count against the world's 50 players as each is made, so a full world refuses the pick, never the mint. Any other value, or the key on an AI link, is refused.

characters, string[]

A table only (max_uses 2 or more): the Characters its players may pick, ids of Characters in this world, in the order they are shown. A hidden Character is refused: it can never be picked. Empty or absent: each player names a fresh Character after themselves. A table takes no character.

Response

The link, with its code, the invite link and the line to send. The code is shown this once: the server keeps only a hash of it, so it can never be read again (list the links later without their codes, and revoke one by id).

object required
id, string uuid required

The link; DELETE it to revoke.

reader, 'person' | 'agent' | 'player' required

Who the link is for: a person, who accepts it signed in (POST /api/v2/account/join); an AI, which redeems it for a seat (POST /api/v2/join); or a player, a friend with no account, who redeems it at POST /api/v2/join for a read key and reads as a guest.

role, 'co_builder' | 'contributor' | 'guest' required
label, string required

The name given to an AI link, or empty.

inviter_name, string required

The name the link is signed with, or empty (the invite line then reads "Someone").

with_character, boolean required

Whether redeeming gives the AI a Character of its own. Always false on a person link, always true on a player link.

visit, boolean required

An AI link only: true when it is a visit, a seat that ends by itself 7 days after the AI joins. False on every other link.

preview, boolean required

Whether the link carries the world's id in its path (/join/{world_id}#code), so a link pasted in a chat unfurls with the world's name and picture; false for today's /join#code. Always false on an AI link.

lands_on, 'site' | 'dashboard' required

Where the link opens: site, this site's /join page; dashboard, the Dashboard's /join page. Either takes the same code. Always site on an AI or player link.

last4, string required

The code's last four characters, to tell links apart.

minted_by, string uuid nullable required

The membership (its id in GET /api/v2/members) of the co-builder who minted the link over POST /api/v2/links; null for a link the owner made.

created_at, string date-time required
expires_at, string date-time required
uses, integer required

How many times the link was used: 0 or 1 for a link for one; a link that works several times (a table, or a person's link with max_uses) counts the members it made, removed ones included.

status, 'pending' | 'used' | 'revoked' | 'expired' required

pending (still works), used, revoked or expired.

character, object nullable

A player's link: the Character the player reads as, {id, name}; null while a link for a fresh Character is unused (the one made at the door once it is). A person's link has this key only while it names a Character: the one the link names for its person, which the join sets if it is still free then; once used, the one its join set, and a link whose join could not set it has no such key. name is null if the Character was deleted (a player's link then makes a fresh one).

max_uses, integer

A link that works several times (a table, or a person's link) only: how many times the link works. status is pending while uses < max_uses (and the link is neither revoked nor expired), used once full.

characters, object[]

A table link only: the Characters its players may pick, in the order you picked them; empty when each player gets a fresh Character named after them. taken: a live seat in the world plays it. name is null if the Character was deleted.

code, string required

The ow_j_ join code. Shown in this answer only: the server keeps a hash, so it can never be read again.

link, string uri required

The invite link: the /join page with the code after #; with preview on, /join/{world_id} with the code after #, on this site or, with lands_on dashboard, on the Dashboard. The code is only ever in the fragment: read it from there, whatever the path.

line, string required

The one line to send: who invites, to which world, and the link.

Changes

    • info

      added the new optional request property visit

    • info

      added the required property visit to the response with the status

    • info

      added the optional property error/limit to the response with the status

    4 more changes in this revision