# Liveness of the Worker (/reference/status) ```json { "GET /api/status": { "operationId": "status", "summary": "Liveness of the Worker", "tags": [ "status" ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "type": "string", "const": "ok" }, "service": { "type": "string", "description": "The Worker that answered" }, "release": { "type": "string", "description": "The deployed version's ID, or \"local\"" } }, "required": [ "status", "service", "release" ], "additionalProperties": false } } } } } } } ``` # The signed-in account (/reference/me) Needs a session (the cookie Better Auth sets at sign-in). Answers 401 without one. ```json { "GET /api/me": { "operationId": "me", "summary": "The signed-in account", "description": "Needs a session (the cookie Better Auth sets at sign-in). Answers 401 without one.", "tags": [ "account" ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string", "description": "The account's ID" }, "name": { "type": "string", "description": "The display name; empty until the person gives one" }, "email": { "type": "string", "description": "The address the person signs in with" }, "emailVerified": { "type": "boolean", "description": "Whether a sign-in code has proved the address" } }, "required": [ "id", "name", "email", "emailVerified" ], "additionalProperties": false } } } }, "401": { "description": "Nobody is signed in.", "content": { "application/json": { "schema": { "oneOf": [ { "$ref": "#/components/schemas/Unauthorized" }, { "$ref": "#/components/schemas/UndefinedError" } ] } } } } } } } ``` # The signed-in person's notes (/reference/notes.list) The notes they wrote and the notes shared with them, each with what they may do to it. ```json { "GET /api/notes": { "operationId": "notes.list", "summary": "The signed-in person's notes", "description": "The notes they wrote and the notes shared with them, each with what they may do to it.", "tags": [ "notes" ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "notes": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "string" }, "body": { "type": "string" }, "mine": { "type": "boolean", "description": "Whether the viewer wrote it" }, "sharedWith": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "How many people it is shared with; only its author is told, others read 0" }, "updatedAt": { "type": "string", "description": "When it last changed, ISO 8601" }, "can": { "type": "object", "properties": { "VIEW_NOTE": { "type": "boolean" }, "EDIT_NOTE": { "type": "boolean" }, "SHARE_NOTE": { "type": "boolean" }, "DELETE_NOTE": { "type": "boolean" } }, "required": [ "VIEW_NOTE", "EDIT_NOTE", "SHARE_NOTE", "DELETE_NOTE" ], "additionalProperties": false, "description": "What this viewer may do to it" } }, "required": [ "id", "title", "body", "mine", "sharedWith", "updatedAt", "can" ], "additionalProperties": false } }, "can": { "type": "object", "properties": { "CREATE_NOTE": { "type": "boolean" } }, "required": [ "CREATE_NOTE" ], "additionalProperties": false } }, "required": [ "notes", "can" ], "additionalProperties": false } } } }, "401": { "description": "Nobody is signed in.", "content": { "application/json": { "schema": { "oneOf": [ { "$ref": "#/components/schemas/Unauthorized" }, { "$ref": "#/components/schemas/UndefinedError" } ] } } } } } } } ``` # Write a note (/reference/notes.create) ```json { "POST /api/notes": { "operationId": "notes.create", "summary": "Write a note", "tags": [ "notes" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "title": { "type": "string", "minLength": 1, "maxLength": 120 }, "body": { "type": "string", "maxLength": 4000 } }, "required": [ "title", "body" ] } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "string" }, "body": { "type": "string" }, "mine": { "type": "boolean", "description": "Whether the viewer wrote it" }, "sharedWith": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "How many people it is shared with; only its author is told, others read 0" }, "updatedAt": { "type": "string", "description": "When it last changed, ISO 8601" }, "can": { "type": "object", "properties": { "VIEW_NOTE": { "type": "boolean" }, "EDIT_NOTE": { "type": "boolean" }, "SHARE_NOTE": { "type": "boolean" }, "DELETE_NOTE": { "type": "boolean" } }, "required": [ "VIEW_NOTE", "EDIT_NOTE", "SHARE_NOTE", "DELETE_NOTE" ], "additionalProperties": false, "description": "What this viewer may do to it" } }, "required": [ "id", "title", "body", "mine", "sharedWith", "updatedAt", "can" ], "additionalProperties": false } } } }, "401": { "description": "Nobody is signed in.", "content": { "application/json": { "schema": { "oneOf": [ { "$ref": "#/components/schemas/Unauthorized" }, { "$ref": "#/components/schemas/UndefinedError" } ] } } } } } } } ``` # Change a note (/reference/notes.update) Its author and the people it is shared with as editors may. ```json { "POST /api/notes/{id}": { "operationId": "notes.update", "summary": "Change a note", "description": "Its author and the people it is shared with as editors may.", "tags": [ "notes" ], "parameters": [ { "in": "path", "required": true, "name": "id", "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "title": { "type": "string", "minLength": 1, "maxLength": 120 }, "body": { "type": "string", "maxLength": 4000 } }, "required": [ "title", "body" ] } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "string" }, "body": { "type": "string" }, "mine": { "type": "boolean", "description": "Whether the viewer wrote it" }, "sharedWith": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "How many people it is shared with; only its author is told, others read 0" }, "updatedAt": { "type": "string", "description": "When it last changed, ISO 8601" }, "can": { "type": "object", "properties": { "VIEW_NOTE": { "type": "boolean" }, "EDIT_NOTE": { "type": "boolean" }, "SHARE_NOTE": { "type": "boolean" }, "DELETE_NOTE": { "type": "boolean" } }, "required": [ "VIEW_NOTE", "EDIT_NOTE", "SHARE_NOTE", "DELETE_NOTE" ], "additionalProperties": false, "description": "What this viewer may do to it" } }, "required": [ "id", "title", "body", "mine", "sharedWith", "updatedAt", "can" ], "additionalProperties": false } } } }, "401": { "description": "Nobody is signed in.", "content": { "application/json": { "schema": { "oneOf": [ { "$ref": "#/components/schemas/Unauthorized" }, { "$ref": "#/components/schemas/UndefinedError" } ] } } } }, "403": { "description": "The signed-in person holds no relation to this note that allows it.", "content": { "application/json": { "schema": { "oneOf": [ { "$ref": "#/components/schemas/Forbidden" }, { "$ref": "#/components/schemas/UndefinedError" } ] } } } }, "404": { "description": "There is no such note.", "content": { "application/json": { "schema": { "oneOf": [ { "$ref": "#/components/schemas/NotFound" }, { "$ref": "#/components/schemas/UndefinedError" } ] } } } } } } } ``` # Share a note with an address (/reference/notes.share) Only its author may. The person sees the note once they sign in with that address; the answer is the same whether or not the address has an account. ```json { "POST /api/notes/{id}/share": { "operationId": "notes.share", "summary": "Share a note with an address", "description": "Only its author may. The person sees the note once they sign in with that address; the answer is the same whether or not the address has an account.", "tags": [ "notes" ], "parameters": [ { "in": "path", "required": true, "name": "id", "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "email": { "type": "string", "maxLength": 254, "format": "email", "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" }, "role": { "type": "string", "enum": [ "reader", "editor" ] } }, "required": [ "email", "role" ] } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "string" }, "body": { "type": "string" }, "mine": { "type": "boolean", "description": "Whether the viewer wrote it" }, "sharedWith": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "How many people it is shared with; only its author is told, others read 0" }, "updatedAt": { "type": "string", "description": "When it last changed, ISO 8601" }, "can": { "type": "object", "properties": { "VIEW_NOTE": { "type": "boolean" }, "EDIT_NOTE": { "type": "boolean" }, "SHARE_NOTE": { "type": "boolean" }, "DELETE_NOTE": { "type": "boolean" } }, "required": [ "VIEW_NOTE", "EDIT_NOTE", "SHARE_NOTE", "DELETE_NOTE" ], "additionalProperties": false, "description": "What this viewer may do to it" } }, "required": [ "id", "title", "body", "mine", "sharedWith", "updatedAt", "can" ], "additionalProperties": false } } } }, "401": { "description": "Nobody is signed in.", "content": { "application/json": { "schema": { "oneOf": [ { "$ref": "#/components/schemas/Unauthorized" }, { "$ref": "#/components/schemas/UndefinedError" } ] } } } }, "403": { "description": "The signed-in person holds no relation to this note that allows it.", "content": { "application/json": { "schema": { "oneOf": [ { "$ref": "#/components/schemas/Forbidden" }, { "$ref": "#/components/schemas/UndefinedError" } ] } } } }, "404": { "description": "There is no such note.", "content": { "application/json": { "schema": { "oneOf": [ { "$ref": "#/components/schemas/NotFound" }, { "$ref": "#/components/schemas/UndefinedError" } ] } } } } } } } ``` # Delete a note (/reference/notes.remove) Only its author may. ```json { "POST /api/notes/{id}/delete": { "operationId": "notes.remove", "summary": "Delete a note", "description": "Only its author may.", "tags": [ "notes" ], "parameters": [ { "in": "path", "required": true, "name": "id", "schema": { "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string" } }, "required": [ "id" ], "additionalProperties": false } } } }, "401": { "description": "Nobody is signed in.", "content": { "application/json": { "schema": { "oneOf": [ { "$ref": "#/components/schemas/Unauthorized" }, { "$ref": "#/components/schemas/UndefinedError" } ] } } } }, "403": { "description": "The signed-in person holds no relation to this note that allows it.", "content": { "application/json": { "schema": { "oneOf": [ { "$ref": "#/components/schemas/Forbidden" }, { "$ref": "#/components/schemas/UndefinedError" } ] } } } }, "404": { "description": "There is no such note.", "content": { "application/json": { "schema": { "oneOf": [ { "$ref": "#/components/schemas/NotFound" }, { "$ref": "#/components/schemas/UndefinedError" } ] } } } } } } } ``` # Reserve seats in the demo (nothing is stored) (/reference/reservations.create) Answers in the language of Accept-Language (the page's language when the app calls it). A name must not be blank once trimmed and the seats are a whole number from 1 to 20. ```json { "POST /api/reservations": { "operationId": "reservations.create", "summary": "Reserve seats in the demo (nothing is stored)", "description": "Answers in the language of Accept-Language (the page's language when the app calls it). A name must not be blank once trimmed and the seats are a whole number from 1 to 20.", "tags": [ "demo" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string" }, "guests": { "type": "number" } }, "required": [ "name", "guests" ] } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } }, "required": [ "message" ], "additionalProperties": false } } } }, "400": { "description": "The reservation breaks a rule; data holds the first broken rule per field, in the language asked for.", "content": { "application/json": { "schema": { "oneOf": [ { "$ref": "#/components/schemas/InvalidReservation" }, { "$ref": "#/components/schemas/UndefinedError" } ] } } } } } } } ```