Me (current user)
Endpoints under the Me tag apply to the caller’s identity derived from the API key or session — there is no X-Org selector on these routes. Response shapes follow MeApartmentsResponse, MeInvitationsResponse, MePushSubscriptionStatusResponse, MePushVapidPublicKeyResponse, and PostMePushSubscriptionPayload in the API reference.
For installation and credentials, see Authentication. For organization-scoped lists (devices, entities, …), see Organization context & pagination.
Operations vs wire routes
Section titled “Operations vs wire routes”| Concern | HTTP | operationId | Notes |
|---|---|---|---|
| Resident apartments | GET /me/apartments | get_me_apartments | Apartments the user is a resident of. |
| Claimed invitations | GET /me/invitations | get_me_invitations | Invitations the user has claimed. |
| Push subscription flag | GET /me/push-subscription-status | get_me_push_subscription_status | Whether any Web Push subscription exists. |
| Store push subscription | POST /me/push-subscriptions | post_me_push_subscription | Body PostMePushSubscriptionPayload (endpoint, p256dh, auth). |
| VAPID public key | GET /me/push-vapid-public-key | get_me_push_vapid_public_key | 404 when push is not configured server-side. |
SDK coverage
Section titled “SDK coverage”| Capability | Python | Rust (openapp_sdk) | Go | TypeScript (AsyncClient) |
|---|---|---|---|---|
| Apartments | client.me.apartments() | client.me().apartments() | MeAPI.GetMeApartments | Not on façade yet |
| Invitations | client.me.invitations() | client.me().invitations() | MeAPI.GetMeInvitations | listInvitations (GET /me/invitations) |
| Push subscription status | client.me.push_subscription_status() | client.me().push_subscription_status() | MeAPI.GetMePushSubscriptionStatus | Not on façade yet |
| Push subscribe | client.me.subscribe_push(...) | client.me().subscribe_push(...) | MeAPI.PostMePushSubscription | Not on façade yet |
| VAPID key | client.me.push_vapid_public_key() | client.me().push_vapid_public_key() | MeAPI.GetMePushVapidPublicKey | Not on façade yet |
Typical errors
Section titled “Typical errors”401 when the key or session does not authenticate. get_me_push_vapid_public_key returns 404 when the server has no VAPID configuration. post_me_push_subscription may return 400 for invalid payloads. Error bodies follow ApiErrorResponse — see Errors & retries.
Examples
Section titled “Examples”List claimed invitations
Section titled “List claimed invitations”rows = await client.me.invitations()resp, httpResp, err := client.MeAPI.GetMeInvitations(ctx).Execute()if err != nil { return err}defer httpResp.Body.Close()_ = respuse openapp_sdk::Client;
let client = Client::builder() .api_key("https://api.openapp.house/api/v1_openapp_YOUR_SECRET") .build()?;
let rows = client.me().invitations().await?;import { AsyncClient } from "@tomers/openapp-sdk";
const client = new AsyncClient("https://api.openapp.house/api/v1_openapp_YOUR_SECRET");const raw = await client.listInvitations();The Node façade exposes listInvitations only for this tag; use another SDK or extend the client for other /me/* routes.
Resident apartments
Section titled “Resident apartments”apartments = await client.me.apartments()resp, httpResp, err := client.MeAPI.GetMeApartments(ctx).Execute()if err != nil { return err}defer httpResp.Body.Close()_ = resplet apartments = client.me().apartments().await?;const apartments = await fetch( "https://api.openapp.house/api/v1/me/apartments", { headers: { authorization: "Bearer v1_openapp_YOUR_SECRET" } },).then((r) => r.json());The /me/* routes derive identity from the API key (or session) — no X-Org required. Replace with AsyncClient.getMeApartments once the Node façade exposes it.
Push subscription status (GET /me/push-subscription-status)
Section titled “Push subscription status (GET /me/push-subscription-status)”Returns MePushSubscriptionStatusResponse — whether the caller already has at least one Web Push subscription stored. Use this before post_me_push_subscription to avoid duplicate work or to branch UI.
status = await client.me.push_subscription_status()resp, httpResp, err := client.MeAPI.GetMePushSubscriptionStatus(ctx).Execute()if err != nil { return err}defer httpResp.Body.Close()_ = respuse openapp_sdk::Client;
let client = Client::builder() .api_key("https://api.openapp.house/api/v1_openapp_YOUR_SECRET") .build()?;
let status = client.me().push_subscription_status().await?;const status = await fetch( "https://api.openapp.house/api/v1/me/push-subscription-status", { headers: { authorization: "Bearer v1_openapp_YOUR_SECRET" } },).then((r) => r.json() as Promise<{ subscribed: boolean }>);
if (!status.subscribed) { // Drive the Service Worker push prompt + POST /me/push-subscriptions below.}Branch on status.subscribed before triggering the browser push prompt to avoid duplicate work. Replace with AsyncClient.getMePushSubscriptionStatus once the Node façade exposes it.
Web Push (subscribe)
Section titled “Web Push (subscribe)”Browser-derived endpoint, p256dh, and auth keys must be passed as in PostMePushSubscriptionPayload.
await client.me.subscribe_push( endpoint="https://fcm.googleapis.com/...", p256dh="...", auth="...",)payload := openapiclient.NewPostMePushSubscriptionPayload( "authSecret", "https://push.endpoint.example/", "p256dhKeyMaterial",)httpRes, err := client.MeAPI.PostMePushSubscription(ctx). PostMePushSubscriptionPayload(*payload). Execute()if err != nil { return err}defer httpRes.Body.Close()use serde_json::json;
client .me() .subscribe_push(&json!({ "endpoint": "https://push.endpoint.example/", "p256dh": "…", "auth": "…", })) .await?;const subscription = await navigator.serviceWorker.ready .then((reg) => reg.pushManager.subscribe({ userVisibleOnly: true, applicationServerKey: vapidPublicKey, })) .then((sub) => sub.toJSON());
await fetch("https://api.openapp.house/api/v1/me/push-subscriptions", { method: "POST", headers: { authorization: "Bearer v1_openapp_YOUR_SECRET", "content-type": "application/json", }, body: JSON.stringify({ endpoint: subscription.endpoint, p256dh: subscription.keys?.p256dh, auth: subscription.keys?.auth, }),});Body matches PostMePushSubscriptionPayload — pull endpoint / p256dh / auth straight off the PushSubscription.toJSON() payload the browser produced. Replace with AsyncClient.postMePushSubscription once the Node façade exposes it.
VAPID public key
Section titled “VAPID public key”try: key = await client.me.push_vapid_public_key()except Exception: # 404 when not configured — handle per deployment raiseGetMePushVapidPublicKey returns 404 when unconfigured; check HTTP status when you need to distinguish.
resp, httpResp, err := client.MeAPI.GetMePushVapidPublicKey(ctx).Execute()if err != nil { return err}defer httpResp.Body.Close()_ = resplet key = client.me().push_vapid_public_key().await?;const res = await fetch( "https://api.openapp.house/api/v1/me/push-vapid-public-key", { headers: { authorization: "Bearer v1_openapp_YOUR_SECRET" } },);
if (res.status === 404) { // Server has no VAPID configuration — fall back to native push or surface // the missing-config state to the user. return;}const { key } = (await res.json()) as { key: string };The 404 branch is expected when the deployment has not configured Web Push — treat it as a feature flag, not an error. Replace with AsyncClient.getMePushVapidPublicKey once the Node façade exposes it.