{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"https://api.pagenail.com","description":"Generated server url"}],"tags":[{"name":"Share","description":"Creates share tokens for notes and returns short URLs"}],"paths":{"/webhooks/stripe":{"post":{"tags":["billing-controller"],"operationId":"stripeWebhook","parameters":[{"name":"Stripe-Signature","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"string"}}},"required":true},"responses":{"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"204":{"description":"No Content"}}}},"/share":{"post":{"tags":["Share"],"summary":"Create a share token","description":"Called by the extension when the user clicks the share button on a note. Returns a short URL the user can send to anyone.","operationId":"create","parameters":[{"name":"userId","in":"query","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShareRequest"}}},"required":true},"responses":{"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"400":{"description":"Missing or invalid request body","content":{}},"200":{"description":"Share token created successfully","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ShareResponse"}}}}}}},"/notes/batch":{"post":{"tags":["Notes"],"summary":"Upsert one URL's notes. Per-item results; items never roll each other back.","operationId":"flushNotes","parameters":[{"name":"userId","in":"query","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NoteBatchRequest"}}},"required":true},"responses":{"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/NoteBatchItemResult"}}}}}}}},"/billing/portal":{"post":{"tags":["billing-controller"],"operationId":"createPortalSession","parameters":[{"name":"userId","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object","additionalProperties":{"type":"string"}}}}}}}},"/billing/checkout":{"post":{"tags":["billing-controller"],"operationId":"createCheckoutSession","parameters":[{"name":"userId","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object","additionalProperties":{"type":"string"}}}}}}}},"/auth/web-pair":{"post":{"tags":["Extension Pair"],"operationId":"createWebPairCode","parameters":[{"name":"userId","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/WebPairCodeResponse"}}}}}}},"/auth/web-pair/redeem":{"post":{"tags":["Extension Pair"],"operationId":"redeemWebPairCode","parameters":[{"name":"code","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}}}}},"/auth/reset-password":{"post":{"tags":["Basic Auth"],"operationId":"resetPassword","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetPasswordRequest"}}},"required":true},"responses":{"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}}}}},"/auth/register":{"post":{"tags":["Basic Auth"],"operationId":"register","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterRequest"}}},"required":true},"responses":{"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"202":{"description":"Accepted","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}}}}},"/auth/refresh":{"post":{"tags":["Auth Base"],"operationId":"refresh","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshRequest"}}}},"responses":{"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}}}}},"/auth/magic/send":{"post":{"tags":["Magic Link"],"operationId":"sendMagicLink","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MagicLinkRequest"}}},"required":true},"responses":{"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"202":{"description":"Accepted","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}}}}},"/auth/logout":{"post":{"tags":["Auth Base"],"operationId":"logout","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshRequest"}}}},"responses":{"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"204":{"description":"No Content"}}}},"/auth/login":{"post":{"tags":["Basic Auth"],"operationId":"login","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}},"required":true},"responses":{"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}}}}},"/auth/forgot-password":{"post":{"tags":["Basic Auth"],"operationId":"forgotPassword","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForgotPasswordRequest"}}},"required":true},"responses":{"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}}}}},"/auth/extension-pair":{"post":{"tags":["Extension Pair"],"operationId":"createExtensionPairCode","parameters":[{"name":"userId","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ExtensionPairCodeResponse"}}}}}}},"/auth/extension-pair/redeem":{"post":{"tags":["Extension Pair"],"operationId":"redeemExtensionPairCode","parameters":[{"name":"code","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}}}}},"/admin/users/{id}":{"get":{"tags":["admin-controller"],"operationId":"getUser","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object","additionalProperties":{}}}}}}},"patch":{"tags":["admin-controller"],"operationId":"updateUser","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"}}}},"required":true},"responses":{"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/User"}}}}}}},"/{token}":{"get":{"tags":["Share"],"summary":"Render shared note interstitial","description":"Serves the public-facing page for a shared note. Detects browser and extension state client-side to show the appropriate CTA.","operationId":"interstitial","parameters":[{"name":"token","in":"path","description":"Share token generated when the note was shared","required":true,"schema":{"type":"string"},"example":"aB3xZ9"}],"responses":{"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"200":{"description":"Interstitial page rendered","content":{"*/*":{"schema":{"type":"string"}}}},"404":{"description":"Token not found or expired","content":{"*/*":{"schema":{"type":"string"}}}}}}},"/share/{shareId}":{"get":{"tags":["Share"],"summary":"Fetch a shared note","description":"Called by the extension to resolve a share token into the shared note's content.","operationId":"get","parameters":[{"name":"shareId","in":"path","description":"Share token generated when the note was shared","required":true,"schema":{"type":"string"},"example":"aB3xZ9"}],"responses":{"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"200":{"description":"Shared note found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/SharedNoteResponse"}}}},"404":{"description":"Share token not found or expired"}}}},"/notes":{"get":{"tags":["Notes"],"summary":"Pull notes for a URL, globals, or the whole account. Includes tombstones by default.","operationId":"getNotes","parameters":[{"name":"userId","in":"query","required":true,"schema":{"type":"string"}},{"name":"url","in":"query","required":false,"schema":{"type":"string"}},{"name":"include_global","in":"query","required":false,"schema":{"type":"boolean","default":false}},{"name":"include_deleted","in":"query","required":false,"schema":{"type":"boolean","default":true}}],"responses":{"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/NoteResponse"}}}}}}}},"/billing/subscription":{"get":{"tags":["billing-controller"],"operationId":"getSubscription","parameters":[{"name":"userId","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/SubscriptionResponse"}}}}}}},"/auth/verify":{"get":{"tags":["Basic Auth"],"operationId":"verifyEmail","parameters":[{"name":"token","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}}}}},"/auth/me":{"get":{"tags":["Auth Base"],"operationId":"me","parameters":[{"name":"userId","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}}}},"delete":{"tags":["Auth Base"],"operationId":"deleteMe","parameters":[{"name":"userId","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"204":{"description":"No Content"}}}},"/auth/magic/verify":{"get":{"tags":["Magic Link"],"operationId":"verifyMagicLink","parameters":[{"name":"token","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}}}}},"/auth/google":{"get":{"tags":["OAuth Google"],"operationId":"googleRedirect","responses":{"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"200":{"description":"OK"}}}},"/auth/google/callback":{"get":{"tags":["OAuth Google"],"operationId":"googleCallback","parameters":[{"name":"code","in":"query","required":true,"schema":{"type":"string"}},{"name":"state","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"200":{"description":"OK"}}}},"/admin/users":{"get":{"tags":["admin-controller"],"operationId":"listUsers","parameters":[{"name":"pageable","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Pageable"}}],"responses":{"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PageUser"}}}}}}},"/admin/stats":{"get":{"tags":["admin-controller"],"operationId":"getStats","responses":{"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object","additionalProperties":{}}}}}}}},"/notes/{id}":{"delete":{"tags":["Notes"],"summary":"Tombstone a note. Idempotent.","operationId":"deleteNote","parameters":[{"name":"userId","in":"query","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"204":{"description":"No Content"}}}}},"components":{"schemas":{"MessageResponse":{"type":"object","properties":{"message":{"type":"string"}}},"ShareRequest":{"type":"object","description":"Payload sent by the extension when a user shares a note","properties":{"noteId":{"type":"string","description":"ID of the source note to share","example":"aB3xZ9cDfG","minLength":1}},"required":["noteId"]},"ShareResponse":{"type":"object","description":"Returned after a share token is created","properties":{"url":{"type":"string","description":"Full short URL to send to the recipient","example":"https://pgnl.co/s/aB3xZ9"},"token":{"type":"string","description":"The raw token, if the extension needs it separately","example":"aB3xZ9"}}},"NoteBatchItem":{"type":"object","description":"One note to create or update. Update replaces all fields; nulls clear.","properties":{"id":{"type":"string","description":"Client-generated id, 10-char nanoid. The server never mints note ids.","example":"V1StGXR8Z5"},"intent":{"type":"string","description":"create inserts; update no-ops against a missing or tombstoned row","enum":["create","update"]},"text":{"type":"string","description":"Note body. Required. Capped at 65536 characters."},"surface":{"type":"string","description":"Required. Must be 'global' exactly when the request's url is null, and 'anchor' exactly when anchor is set.","enum":["floating","thread","global","anchor"]},"authoredAt":{"type":"string","format":"date-time","description":"Required. Immutable after create — ignored on update."},"editedAt":{"type":"string","format":"date-time","description":"Required. Client clock, display only."},"position":{"type":"object","additionalProperties":{"type":"number","format":"double"},"description":"Viewport position {x, y}. Fractional; optional."},"dimensions":{"type":"object","additionalProperties":{"type":"number","format":"double"},"description":"Size {width, height}. Fractional; optional."},"anchor":{"type":"object","additionalProperties":{},"description":"Anchor blob. Set exactly when surface is 'anchor'."},"collapsed":{"type":"boolean","description":"Whether the user collapsed the note. Null is treated as false."}}},"NoteBatchRequest":{"type":"object","description":"One URL's notes to upsert. url null means the global partition.","properties":{"url":{"type":"string","description":"Raw page URL, normalized server-side. Null for the global partition.","example":"https://example.com/article?utm_source=x"},"notes":{"type":"array","description":"Notes to create or update, all belonging to url","items":{"$ref":"#/components/schemas/NoteBatchItem"},"maxItems":200,"minItems":0}},"required":["notes"]},"NoteBatchItemResult":{"type":"object","description":"Outcome of one item in a batch","properties":{"id":{"type":"string","description":"The id of the submitted item","example":"V1StGXR8Z5"},"status":{"type":"string","description":"ok or failed","enum":["ok","failed"]},"error":{"type":"string","description":"Why the item failed. Null when status is ok.","example":"surface must be 'global' when url is null"}}},"WebPairCodeResponse":{"type":"object","properties":{"code":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"}}},"AuthResponse":{"type":"object","properties":{"accessToken":{"type":"string"},"refreshToken":{"type":"string"},"user":{"$ref":"#/components/schemas/UserResponse"}}},"UserResponse":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"role":{"type":"string"},"emailVerified":{"type":"boolean"},"googleId":{"type":"string"},"avatarUrl":{"type":"string"},"displayName":{"type":"string"},"stripeCustId":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"ResetPasswordRequest":{"type":"object","properties":{"token":{"type":"string","minLength":1},"password":{"type":"string","minLength":1}},"required":["password","token"]},"RegisterRequest":{"type":"object","properties":{"email":{"type":"string","format":"email","minLength":1},"password":{"type":"string","minLength":1}},"required":["email","password"]},"RefreshRequest":{"type":"object","properties":{"refreshToken":{"type":"string"}}},"MagicLinkRequest":{"type":"object","properties":{"email":{"type":"string","format":"email","minLength":1}},"required":["email"]},"LoginRequest":{"type":"object","properties":{"email":{"type":"string","format":"email","minLength":1},"password":{"type":"string","minLength":1}},"required":["email","password"]},"ForgotPasswordRequest":{"type":"object","properties":{"email":{"type":"string","format":"email","minLength":1}},"required":["email"]},"ExtensionPairCodeResponse":{"type":"object","properties":{"code":{"type":"string"}}},"User":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"role":{"type":"string"},"emailVerified":{"type":"boolean"},"googleId":{"type":"string"},"avatarUrl":{"type":"string"},"displayName":{"type":"string"},"stripeCustId":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"SharedNoteResponse":{"type":"object","description":"A shared note, returned when fetching by share token","properties":{"sourceUrl":{"type":"string","description":"URL the note was originally pinned to","example":"https://example.com/article"},"note":{"type":"string","description":"Snapshot of the note text at share time"},"sharedByName":{"type":"string","description":"Display name of the user who shared the note","example":"Jane Doe"},"timestamp":{"type":"string","format":"date-time","description":"When the note was shared"},"position":{"type":"object","additionalProperties":{"type":"number","format":"double"},"description":"Note position at share time, if the original note had one; null falls back to default placement"},"dimensions":{"type":"object","additionalProperties":{"type":"number","format":"double"},"description":"Note dimensions at share time, if the original note had them; null falls back to default size"}}},"NoteResponse":{"type":"object","description":"A note owned by the caller. Tombstones appear as items with deletedAt set and content nulled.","properties":{"id":{"type":"string","description":"Client-generated id, 10-char nanoid","example":"V1StGXR8Z5"},"url":{"type":"string","description":"Raw page URL this note belongs to. Null for a global note, which is not URL-scoped.","example":"https://example.com/article"},"text":{"type":"string","description":"Note body. Null on a tombstone."},"surface":{"type":"string","description":"Which surface renders the note. 'global' means the note is not URL-scoped.","enum":["floating","thread","global","anchor"]},"authoredAt":{"type":"string","format":"date-time","description":"When the user created the note, client clock. Immutable; the thread rail sorts on it."},"editedAt":{"type":"string","format":"date-time","description":"When the user last edited the note, client clock. Display only — never a conflict tiebreaker."},"position":{"type":"object","additionalProperties":{"type":"number","format":"double"},"description":"Viewport position {x, y}. Fractional. Null on a tombstone."},"dimensions":{"type":"object","additionalProperties":{"type":"number","format":"double"},"description":"Size {width, height}. Fractional. Null on a tombstone."},"anchor":{"type":"object","additionalProperties":{},"description":"Anchor blob identifying the selected text. Non-null exactly when surface is 'anchor'. Null on a tombstone."},"collapsed":{"type":"boolean","description":"Whether the user collapsed the note"},"deletedAt":{"type":"string","format":"date-time","description":"Set only on a tombstone. Its presence is an instruction to delete the local row."}}},"SubscriptionResponse":{"type":"object","description":"The authenticated user's subscription.","properties":{"id":{"type":"string","description":"Internal subscription id, 10-char nanoid","example":"V1StGXR8Z5"},"status":{"type":"string","description":"active | trialing | past_due | canceled","example":"active"},"currentPeriodStart":{"type":"string","format":"date-time","description":"Start of the current billing period"},"currentPeriodEnd":{"type":"string","format":"date-time","description":"End of the current billing period"},"cancelAtPeriodEnd":{"type":"boolean","description":"True if the subscription will not renew at currentPeriodEnd"}}},"Pageable":{"type":"object","properties":{"page":{"type":"integer","format":"int32","minimum":0},"size":{"type":"integer","format":"int32","minimum":1},"sort":{"type":"array","items":{"type":"string"}}}},"PageUser":{"type":"object","properties":{"totalElements":{"type":"integer","format":"int64"},"totalPages":{"type":"integer","format":"int32"},"size":{"type":"integer","format":"int32"},"content":{"type":"array","items":{"$ref":"#/components/schemas/User"}},"number":{"type":"integer","format":"int32"},"sort":{"$ref":"#/components/schemas/SortObject"},"numberOfElements":{"type":"integer","format":"int32"},"pageable":{"$ref":"#/components/schemas/PageableObject"},"first":{"type":"boolean"},"last":{"type":"boolean"},"empty":{"type":"boolean"}}},"PageableObject":{"type":"object","properties":{"offset":{"type":"integer","format":"int64"},"sort":{"$ref":"#/components/schemas/SortObject"},"paged":{"type":"boolean"},"pageNumber":{"type":"integer","format":"int32"},"pageSize":{"type":"integer","format":"int32"},"unpaged":{"type":"boolean"}}},"SortObject":{"type":"object","properties":{"empty":{"type":"boolean"},"unsorted":{"type":"boolean"},"sorted":{"type":"boolean"}}}}}}