{"openapi":"3.1.0","info":{"title":"dots.id integration API","version":"0.2.0-alpha.0","description":"Portable identity, explicit context consent and revocable note sharing. These are the supported integration operations; owner/admin console routes are documented separately in /docs/api."},"servers":[{"url":"https://www.dots.id"}],"paths":{"/.well-known/openid-configuration":{"get":{"operationId":"getOpenIdConfiguration","summary":"Discover OAuth endpoints and supported scopes","description":"Discover OAuth endpoints and supported scopes","tags":["Identity and context"],"security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Discovery"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Sign in or refresh the token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Consent or resource permission required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource unavailable to this caller","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State or request conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Content exceeds the configured limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; retry later","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable; retry shortly","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/.well-known/oauth-authorization-server":{"get":{"operationId":"getAuthorizationServer","summary":"Discover the authorization server","description":"Discover the authorization server","tags":["Identity and context"],"security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Discovery"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Sign in or refresh the token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Consent or resource permission required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource unavailable to this caller","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State or request conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Content exceeds the configured limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; retry later","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable; retry shortly","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/.well-known/oauth-protected-resource":{"get":{"operationId":"getMcpResource","summary":"Discover the MCP resource audience and authorization server","description":"Discover the MCP resource audience and authorization server","tags":["Identity and context"],"security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"resource":{"type":"string"},"authorization_servers":{"type":"array","items":{"type":"string"}},"scopes_supported":{"type":"array","items":{"type":"string"}}},"required":["resource","authorization_servers","scopes_supported"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Sign in or refresh the token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Consent or resource permission required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource unavailable to this caller","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State or request conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Content exceeds the configured limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; retry later","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable; retry shortly","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/.well-known/jwks.json":{"get":{"operationId":"getSigningKeys","summary":"Public signing keys for verifying RS256 tokens","description":"Public signing keys for verifying RS256 tokens","tags":["Identity and context"],"security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"keys":{"type":"array","items":{"type":"object","properties":{"kty":{"type":"string"},"kid":{"type":"string"},"use":{"type":"string"},"alg":{"type":"string"},"n":{"type":"string"},"e":{"type":"string"}},"required":["kty","kid","use","alg","n","e"]}}},"required":["keys"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Sign in or refresh the token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Consent or resource permission required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource unavailable to this caller","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State or request conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Content exceeds the configured limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; retry later","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable; retry shortly","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/oauth/authorize":{"get":{"operationId":"authorize","summary":"Start browser sign-in with PKCE S256 and explicit resource audiences","description":"Start browser sign-in. Register the actual connector callback, not the /oauth/device approval page. Public S256 PKCE clients may vary only the port of a registered HTTP loopback URI (localhost, 127.0.0.1 or [::1]); host, path and query remain exact. Other callbacks require exact registration matching. Invalid callbacks return 400 without redirecting.","tags":["OAuth"],"security":[],"responses":{"307":{"description":"Continue to login, consent or the validated callback","headers":{"Location":{"schema":{"type":"string"}}}},"400":{"description":"Invalid request; fix callback registration or PKCE before retrying","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"client_id","in":"query","required":true,"schema":{"type":"string"}},{"name":"redirect_uri","in":"query","required":true,"schema":{"type":"string"}},{"name":"response_type","in":"query","required":true,"schema":{"type":"string","enum":["code"]}},{"name":"scope","in":"query","required":false,"schema":{"type":"string"}},{"name":"state","in":"query","required":true,"schema":{"type":"string"}},{"name":"nonce","in":"query","required":false,"schema":{"type":"string"}},{"name":"code_challenge","in":"query","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{43}$"}},{"name":"code_challenge_method","in":"query","required":true,"schema":{"type":"string","enum":["S256"]}},{"name":"resource","in":"query","required":false,"schema":{"type":"array","maxItems":2,"items":{"type":"string","enum":["https://www.dots.id/api","https://www.dots.id/mcp"]},"description":"RFC 8707 resource identifiers. Omitted at authorization defaults to the API. Token/refresh requests may only select originally authorized resources."},"style":"form","explode":true}]}},"/api/oauth/device":{"post":{"operationId":"authorizeDevice","summary":"Create a device code; the person approves in their browser","description":"Create a device code; the person approves in their browser","tags":["OAuth"],"security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceAuthorization"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Sign in or refresh the token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Consent or resource permission required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource unavailable to this caller","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State or request conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Content exceeds the configured limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; retry later","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable; retry shortly","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"client_id":{"type":"string"},"scope":{"type":"string"},"resource":{"oneOf":[{"type":"string"},{"type":"array","maxItems":2,"items":{"type":"string","enum":["https://www.dots.id/api","https://www.dots.id/mcp"]},"description":"RFC 8707 resource identifiers. Omitted at authorization defaults to the API. Token/refresh requests may only select originally authorized resources."}]}},"required":["client_id"]},"example":{"client_id":"YOUR_PUBLIC_CLIENT","scope":"openid profile context:read offline_access","resource":["https://www.dots.id/api"]}}}}}},"/api/oauth/token":{"post":{"operationId":"exchangeToken","summary":"Exchange a code/device code or rotate a refresh token without broadening the original resource grant","description":"Exchange a code/device code or rotate a refresh token without broadening the original resource grant","tags":["OAuth"],"security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tokens"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Sign in or refresh the token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Consent or resource permission required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource unavailable to this caller","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State or request conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Content exceeds the configured limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; retry later","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable; retry shortly","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"grant_type":{"type":"string","enum":["authorization_code","refresh_token","urn:ietf:params:oauth:grant-type:device_code"]},"client_id":{"type":"string"},"client_secret":{"type":"string","writeOnly":true},"code":{"type":"string"},"redirect_uri":{"type":"string","description":"Authorization-code exchange requires the exact redirect_uri sent at authorize, including the selected loopback port."},"code_verifier":{"type":"string","pattern":"^[A-Za-z0-9._~-]{43,128}$","writeOnly":true},"device_code":{"type":"string"},"refresh_token":{"type":"string","writeOnly":true},"resource":{"type":"array","maxItems":2,"items":{"type":"string","enum":["https://www.dots.id/api","https://www.dots.id/mcp"]},"description":"RFC 8707 resource identifiers. Omitted at authorization defaults to the API. Token/refresh requests may only select originally authorized resources."}},"required":["grant_type","client_id"]},"encoding":{"resource":{"style":"form","explode":true}}}}}}},"/api/oauth/register":{"post":{"operationId":"registerPublicClient","summary":"Register one public PKCE or device-only client per app/environment","description":"Save and reuse client_id. Registration does not grant user access. Public registration may filter scopes; compare scope and dots_missing_scopes. Dynamic clients are unowned and cannot be edited in a user dashboard. For device-only apps, set grant_types to [urn:ietf:params:oauth:grant-type:device_code, refresh_token], response_types to [], and omit redirect_uris. All other clients must supply 1–10 exact callbacks. Use an owned dashboard client for restricted scopes or editable metadata.","tags":["OAuth"],"security":[],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"client_id":{"type":"string"},"client_name":{"type":"string"},"redirect_uris":{"type":"array","items":{"type":"string"}},"scope":{"type":"string"},"dots_missing_scopes":{"type":"array","items":{"type":"string"}},"grant_types":{"type":"array","items":{"type":"string"}},"response_types":{"type":"array","items":{"type":"string"}},"token_endpoint_auth_method":{"type":"string","enum":["none"]}},"required":["client_id","client_name","redirect_uris","scope","dots_missing_scopes","grant_types","response_types","token_endpoint_auth_method"]}}}},"400":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Registration rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"client_name":{"type":"string","minLength":1,"maxLength":100},"redirect_uris":{"type":"array","maxItems":10,"items":{"type":"string"}},"scope":{"type":"string"},"grant_types":{"type":"array","items":{"type":"string","enum":["authorization_code","refresh_token","urn:ietf:params:oauth:grant-type:device_code"]}},"response_types":{"type":"array","items":{"type":"string","enum":["code"]}},"token_endpoint_auth_method":{"type":"string","enum":["none"]}},"required":["client_name"]},"example":{"client_name":"Dots context in Cursor","token_endpoint_auth_method":"none","redirect_uris":["http://localhost:8787/callback","https://www.cursor.com/agents/mcp/oauth/callback"],"scope":"openid profile context:read offline_access"}}}}}},"/api/oauth/userinfo":{"get":{"operationId":"getUserinfo","summary":"Get scoped OIDC identity claims; store accounts by issuer and sub","description":"Get scoped OIDC identity claims; store accounts by issuer and sub","tags":["OAuth"],"security":[{"oauth2":["openid"]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Userinfo"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Sign in or refresh the token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Consent or resource permission required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource unavailable to this caller","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State or request conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Content exceeds the configured limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; retry later","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable; retry shortly","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/oauth/revoke":{"post":{"operationId":"revokeToken","summary":"Revoke a token owned by this OAuth client","description":"Revoke a token owned by this OAuth client","tags":["OAuth"],"security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{},"required":[]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Sign in or refresh the token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Consent or resource permission required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource unavailable to this caller","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State or request conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Content exceeds the configured limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; retry later","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable; retry shortly","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"token":{"type":"string","writeOnly":true},"client_id":{"type":"string"},"client_secret":{"type":"string","writeOnly":true},"token_type_hint":{"type":"string","enum":["access_token","refresh_token"]}},"required":["token","client_id"]}}}}}},"/api/oauth/introspect":{"post":{"operationId":"introspectToken","summary":"Inspect a token with client authentication","description":"Inspect a token with client authentication","tags":["OAuth"],"security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"active":{"type":"boolean"},"scope":{"type":"string"},"client_id":{"type":"string"},"sub":{"type":"string"},"exp":{"type":"integer"},"aud":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["active"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Sign in or refresh the token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Consent or resource permission required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource unavailable to this caller","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State or request conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Content exceeds the configured limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; retry later","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable; retry shortly","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"token":{"type":"string","writeOnly":true},"client_id":{"type":"string"},"client_secret":{"type":"string","writeOnly":true},"token_type_hint":{"type":"string","enum":["access_token","refresh_token"]}},"required":["token","client_id"]}}}}}},"/api/identity/bootstrap":{"get":{"operationId":"getIdentityBootstrap","summary":"Get identity and consented context. Cross-app reads additionally require context:read:all","description":"Get identity and consented context. Cross-app reads additionally require context:read:all","tags":["Identity and context"],"security":[{"oauth2":["openid"]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Bootstrap"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Sign in or refresh the token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Consent or resource permission required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource unavailable to this caller","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State or request conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Content exceeds the configured limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; retry later","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable; retry shortly","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/identity/context":{"get":{"operationId":"listContext","summary":"Read or search this app context; context:read:all explicitly broadens to all apps","description":"Read or search this app context; context:read:all explicitly broadens to all apps","tags":["Identity and context"],"security":[{"oauth2":["context:read"]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"context":{"type":"array","items":{"$ref":"#/components/schemas/Context"}},"policy":{"$ref":"#/components/schemas/ContextPolicy"},"indexed":{"type":"boolean"}},"required":["context","policy"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Sign in or refresh the token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Consent or resource permission required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource unavailable to this caller","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State or request conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Content exceeds the configured limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; retry later","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable; retry shortly","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"kind","in":"query","required":false,"schema":{"type":"string"}},{"name":"before","in":"query","required":false,"schema":{"type":"string"}}]},"post":{"operationId":"appendContext","summary":"Append to the token client namespace","description":"Append to the token client namespace","tags":["Identity and context"],"security":[{"oauth2":["context:write"]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"id":{"type":"string"},"policy":{"$ref":"#/components/schemas/ContextPolicy"}},"required":["ok","policy"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Sign in or refresh the token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Consent or resource permission required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource unavailable to this caller","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State or request conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Content exceeds the configured limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; retry later","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable; retry shortly","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"content":{"type":"string","minLength":1,"maxLength":262144},"kind":{"type":"string"},"role":{"type":"string"},"metadata":{"type":"object","additionalProperties":true}},"required":["content"]},"example":{"content":"Use short paragraphs in replies.","kind":"preference"}}}}},"delete":{"operationId":"deleteContext","summary":"Delete a context record from the token client namespace","description":"Delete a context record from the token client namespace","tags":["Identity and context"],"security":[{"oauth2":["context:write"]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Sign in or refresh the token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Consent or resource permission required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource unavailable to this caller","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State or request conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Content exceeds the configured limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; retry later","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable; retry shortly","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"query","required":true,"schema":{"type":"string"}}]}},"/api/identity/notes":{"get":{"operationId":"listNotes","summary":"List app-owned notes and accepted shared notes, rechecking current grants","description":"List app-owned notes and accepted shared notes, rechecking current grants","tags":["Notes and grants"],"security":[{"oauth2":["context:read"]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"notes":{"type":"array","items":{"$ref":"#/components/schemas/IdentityNote"}},"jazz":{"type":"object","additionalProperties":true}},"required":["notes"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Sign in or refresh the token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Consent or resource permission required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource unavailable to this caller","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State or request conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Content exceeds the configured limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; retry later","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable; retry shortly","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createNote","summary":"Create a note owned by this identity in the token client namespace","description":"Create a note owned by this identity in the token client namespace","tags":["Notes and grants"],"security":[{"oauth2":["context:write"]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"note":{"$ref":"#/components/schemas/IdentityNote"}},"required":["note"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Sign in or refresh the token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Consent or resource permission required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource unavailable to this caller","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State or request conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Content exceeds the configured limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; retry later","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable; retry shortly","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","maxLength":500},"content":{"type":"string","maxLength":262144},"appFileId":{"type":"string"}},"required":["content"]},"example":{"title":"Project brief","content":"Draft a reply using these notes."}}}}}},"/api/identity/notes/{noteId}":{"get":{"operationId":"readNote","summary":"Read an owned or accepted shared note; a share URL alone grants no access","description":"Read an owned or accepted shared note; a share URL alone grants no access","tags":["Notes and grants"],"security":[{"oauth2":["context:read"]}],"parameters":[{"name":"noteId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"note":{"$ref":"#/components/schemas/Note"},"grantId":{"type":["string","null"]},"owned":{"type":"boolean"}},"required":["note","grantId","owned"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Sign in or refresh the token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Consent or resource permission required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource unavailable to this caller","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State or request conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Content exceeds the configured limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; retry later","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable; retry shortly","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"operationId":"writeNote","summary":"Edit an owned note or consume an accepted note:write grant","description":"Edit an owned note or consume an accepted note:write grant","tags":["Notes and grants"],"security":[{"oauth2":["context:write"]}],"parameters":[{"name":"noteId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"note":{"$ref":"#/components/schemas/Note"}},"required":["note"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Sign in or refresh the token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Consent or resource permission required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource unavailable to this caller","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State or request conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Content exceeds the configured limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; retry later","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable; retry shortly","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","maxLength":500},"content":{"type":"string","maxLength":262144}},"required":["content"],"additionalProperties":false}}}}}},"/api/identity/notes/{noteId}/drafts":{"get":{"operationId":"listNoteDrafts","summary":"Read drafts for an authorized note","description":"Read drafts for an authorized note","tags":["Notes and grants"],"security":[{"oauth2":["context:read"]}],"parameters":[{"name":"noteId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"drafts":{"type":"array","items":{"$ref":"#/components/schemas/Draft"}}},"required":["drafts"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Sign in or refresh the token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Consent or resource permission required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource unavailable to this caller","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State or request conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Content exceeds the configured limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; retry later","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable; retry shortly","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"submitNoteDraft","summary":"Submit a separate draft using an accepted note:draft grant. requestId makes retries idempotent","description":"Submit a separate draft using an accepted note:draft grant. requestId makes retries idempotent","tags":["Notes and grants"],"security":[{"oauth2":["context:write"]}],"parameters":[{"name":"noteId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"draft":{"$ref":"#/components/schemas/Draft"}},"required":["draft"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Sign in or refresh the token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Consent or resource permission required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource unavailable to this caller","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State or request conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Content exceeds the configured limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; retry later","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable; retry shortly","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"content":{"type":"string","maxLength":262144},"requestId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["content","requestId"],"additionalProperties":false},"example":{"content":"Suggested reply for review.","requestId":"00000000-0000-4000-8000-000000000001"}}}}}},"/api/identity/grants":{"get":{"operationId":"listNoteGrants","summary":"List invitations sent by this app or addressed to the caller","description":"List invitations sent by this app or addressed to the caller","tags":["Notes and grants"],"security":[{"oauth2":["context:read"]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"grants":{"type":"array","items":{"$ref":"#/components/schemas/Grant"}}},"required":["grants"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Sign in or refresh the token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Consent or resource permission required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource unavailable to this caller","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State or request conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Content exceeds the configured limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; retry later","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable; retry shortly","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"inviteToNote","summary":"Invite a person or a specific agent client to one note. Defaults to read-only access for seven days","description":"Invite a person or a specific agent client to one note. Defaults to read-only access for seven days","tags":["Notes and grants"],"security":[{"oauth2":["notes:share"]}],"responses":{"201":{"description":"Pending invitation created","content":{"application/json":{"schema":{"type":"object","properties":{"grant":{"$ref":"#/components/schemas/Grant"}},"required":["grant"]}}}},"400":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"noteId":{"type":"string","minLength":1,"maxLength":200},"recipientSub":{"type":"string","minLength":1,"maxLength":200},"recipientUsername":{"type":"string","minLength":1,"maxLength":100},"clientId":{"type":"string","minLength":1,"maxLength":200},"permissions":{"minItems":1,"type":"array","items":{"type":"string","enum":["note:read","note:write","note:draft"]}},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"maxWrites":{"type":"integer","minimum":1,"maximum":100000}},"required":["noteId"],"additionalProperties":false},"example":{"noteId":"NOTE_ID","recipientUsername":"alex","permissions":["note:read","note:draft"],"clientId":"AGENT_CLIENT_ID","maxWrites":3}}}}}},"/api/identity/grants/{grantId}":{"get":{"operationId":"getNoteInvitation","summary":"Read invitation metadata without revealing private note content","description":"Read invitation metadata without revealing private note content","tags":["Notes and grants"],"security":[{"oauth2":["context:read"]}],"parameters":[{"name":"grantId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"grant":{"$ref":"#/components/schemas/Grant"}},"required":["grant"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Sign in or refresh the token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Consent or resource permission required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource unavailable to this caller","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State or request conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Content exceeds the configured limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; retry later","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable; retry shortly","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"respondToNoteInvitation","summary":"Only the addressed recipient/client may accept or decline","description":"Only the addressed recipient/client may accept or decline","tags":["Notes and grants"],"security":[{"oauth2":["context:read"]}],"parameters":[{"name":"grantId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"grant":{"$ref":"#/components/schemas/Grant"}},"required":["grant"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Sign in or refresh the token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Consent or resource permission required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource unavailable to this caller","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State or request conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Content exceeds the configured limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; retry later","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable; retry shortly","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"accept":{"type":"boolean"}},"required":["accept"],"additionalProperties":false},"example":{"accept":true}}}}},"delete":{"operationId":"revokeNoteGrant","summary":"End access as the recipient, or as the grant owner with notes:share","description":"End access as the recipient, or as the grant owner with notes:share","tags":["Notes and grants"],"security":[{"oauth2":["context:read"]}],"parameters":[{"name":"grantId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Sign in or refresh the token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Consent or resource permission required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource unavailable to this caller","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State or request conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Content exceeds the configured limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; retry later","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable; retry shortly","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/identity/notes/share":{"post":{"operationId":"shareNote","summary":"Compatibility alias for inviteToNote; accepts noteId and returns a pending grant","description":"Compatibility alias for inviteToNote; accepts noteId and returns a pending grant","tags":["Notes and grants"],"security":[{"oauth2":["notes:share"]}],"responses":{"201":{"description":"Pending invitation created","content":{"application/json":{"schema":{"type":"object","properties":{"grant":{"$ref":"#/components/schemas/Grant"}},"required":["grant"]}}}},"400":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"noteId":{"type":"string","minLength":1,"maxLength":200},"recipientSub":{"type":"string","minLength":1,"maxLength":200},"recipientUsername":{"type":"string","minLength":1,"maxLength":100},"clientId":{"type":"string","minLength":1,"maxLength":200},"permissions":{"minItems":1,"type":"array","items":{"type":"string","enum":["note:read","note:write","note:draft"]}},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"maxWrites":{"type":"integer","minimum":1,"maximum":100000}},"required":["noteId"],"additionalProperties":false},"example":{"noteId":"NOTE_ID","recipientUsername":"alex","permissions":["note:read","note:draft"],"clientId":"AGENT_CLIENT_ID","maxWrites":3}}}}},"get":{"operationId":"getSharedNoteInvitation","summary":"Resolve shareId as a grant invitation ID","description":"Resolve shareId as a grant invitation ID","tags":["Notes and grants"],"security":[{"oauth2":["context:read"]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"grant":{"$ref":"#/components/schemas/Grant"}},"required":["grant"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Sign in or refresh the token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Consent or resource permission required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource unavailable to this caller","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State or request conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Content exceeds the configured limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; retry later","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable; retry shortly","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"shareId","in":"query","required":true,"schema":{"type":"string"}}]}},"/api/identity/username":{"get":{"operationId":"checkUsername","summary":"Check global username availability for a client enabled to create names","description":"Check global username availability for a client enabled to create names","tags":["Identity and context"],"security":[{"oauth2":["username:create"]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"username":{"type":"string"},"available":{"type":"boolean"},"reason":{"type":"string"}},"required":["username","available","reason"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Sign in or refresh the token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Consent or resource permission required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource unavailable to this caller","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State or request conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Content exceeds the configured limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; retry later","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable; retry shortly","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"username","in":"query","required":true,"schema":{"type":"string"}}]},"post":{"operationId":"claimUsername","summary":"Claim a globally unique username for this identity","description":"Claim a globally unique username for this identity","tags":["Identity and context"],"security":[{"oauth2":["username:create"]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"username":{"type":"string"},"created":{"type":"boolean"}},"required":["username"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Sign in or refresh the token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Consent or resource permission required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource unavailable to this caller","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State or request conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Content exceeds the configured limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; retry later","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable; retry shortly","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"username":{"type":"string"}},"required":["username"]}}}}}},"/api/oauth/data":{"get":{"operationId":"readAppData","summary":"Read this client namespace in the identity personal database","description":"Read this client namespace in the identity personal database","tags":["OAuth"],"security":[{"oauth2":["data:read"]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/DataRecord"}}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Sign in or refresh the token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Consent or resource permission required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource unavailable to this caller","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State or request conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Content exceeds the configured limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; retry later","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable; retry shortly","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"collection","in":"query","required":true,"schema":{"type":"string"}},{"name":"key","in":"query","required":false,"schema":{"type":"string"}}]},"post":{"operationId":"writeAppData","summary":"Write to this client namespace; caller-supplied attribution cannot override the token","description":"Write to this client namespace; caller-supplied attribution cannot override the token","tags":["OAuth"],"security":[{"oauth2":["data:write"]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"client_id":{"type":"string"},"collection":{"type":"string"},"key":{"type":"string"}},"required":["success","client_id","collection","key"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Sign in or refresh the token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Consent or resource permission required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource unavailable to this caller","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State or request conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Content exceeds the configured limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; retry later","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable; retry shortly","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"collection":{"type":"string"},"key":{"type":"string"},"value":{}},"required":["collection","key","value"]}}}}},"delete":{"operationId":"deleteAppData","summary":"Delete a record in this client namespace","description":"Delete a record in this client namespace","tags":["OAuth"],"security":[{"oauth2":["data:write"]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"deleted":{"type":"integer"}},"required":["ok","deleted"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Sign in or refresh the token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Consent or resource permission required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource unavailable to this caller","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State or request conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Content exceeds the configured limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; retry later","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable; retry shortly","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"collection","in":"query","required":true,"schema":{"type":"string"}},{"name":"key","in":"query","required":true,"schema":{"type":"string"}}]}},"/api/pute/balance":{"get":{"operationId":"getCreditBalance","summary":"Read the identity credit balance","description":"Read the identity credit balance","tags":["Identity and context"],"security":[{"oauth2":["pute:read"]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"balance":{"type":"number"},"currency":{"type":"string"}},"required":["balance","currency"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Sign in or refresh the token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Consent or resource permission required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource unavailable to this caller","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State or request conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Content exceeds the configured limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; retry later","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable; retry shortly","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/pute/debit":{"post":{"operationId":"debitCredits","summary":"Debit credits using a stable idempotency requestId","description":"Debit credits using a stable idempotency requestId","tags":["Identity and context"],"security":[{"oauth2":["pute:spend"]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"balance":{"type":"number"},"idempotent":{"type":"boolean"}},"required":["ok","balance","idempotent"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Sign in or refresh the token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Consent or resource permission required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource unavailable to this caller","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State or request conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Content exceeds the configured limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; retry later","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable; retry shortly","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"type":"number","exclusiveMinimum":0},"requestId":{"type":"string"}},"required":["amount","requestId"]}}}}}},"/mcp":{"post":{"operationId":"callMcp","summary":"Streamable HTTP MCP: whoami, search, recent, remember, notes, note, stumble. Tokens must target the MCP resource","description":"Streamable HTTP MCP: whoami, search, recent, remember, notes, note, stumble. Tokens must target the MCP resource","tags":["Identity and context"],"security":[{"oauth2":["openid"]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"jsonrpc":{"type":"string","const":"2.0"},"id":{"type":["string","number","null"]},"result":{},"error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}},"required":["code","message"]}},"required":["jsonrpc"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Sign in or refresh the token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Consent or resource permission required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource unavailable to this caller","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State or request conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Content exceeds the configured limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; retry later","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable; retry shortly","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"jsonrpc":{"type":"string","const":"2.0"},"id":{"type":["string","number"]},"method":{"type":"string"},"params":{"type":"object","additionalProperties":true}},"required":["jsonrpc","method"]},"example":{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"note","arguments":{"action":"read","input":{"noteId":"NOTE_ID"}}}}}}},"x-dots-tools":{"whoami":["openid"],"search":["context:read"],"recent":["context:read"],"remember":["context:write"],"notes":["context:read"],"note":["context:read","context:write","notes:share"],"stumble":["context:read","context:read:all","context:write"]}}}},"components":{"securitySchemes":{"oauth2":{"type":"oauth2","flows":{"authorizationCode":{"authorizationUrl":"https://www.dots.id/api/oauth/authorize","tokenUrl":"https://www.dots.id/api/oauth/token","scopes":{"openid":"Verify your identity","profile":"Access your username and basic profile info","username:create":"Check availability and create your permanent dots.id username","email":"Access your email address","purchases:read":"Check your verified purchase history for rewards and access to this app","wallet":"Access your connected wallet address","social:twitter":"Access your connected Twitter/X username","social:instagram":"Access your connected Instagram username","social:google":"Access your connected Google account info","listen":"Read connected listening sources and recent plays","foodboard:read":"Import food places saved by your dots extension into Foodboard","chat:read":"Read messages and shared context in rooms that explicitly grant this app access","chat:write":"Send as you in rooms granting this app permission, respond to invitations, and create chats with 30-day read/send app access","worlds:read":"Read your world memberships and content available to members","worlds:write":"Accept or decline your world invitations and leave worlds","worlds:admin":"Create private worlds and manage channels, members and content in worlds you administer","data:read":"Read data this app has stored in your personal database","data:write":"Store data in your personal database","files:read":"List and download files in this app's dots-blob namespace","files:write":"Upload, move, and delete files in this app's dots-blob namespace","files:share":"Share files with dots people, orgs, and groups","demotapes:read":"List and download your shared Demotapes audio across connected music apps","demotapes:write":"Add audio to your shared Demotapes library for connected music apps","code:read":"Read source code and history across your account code repository","code:write":"Create your code repository, save code revisions and authorize agent branches","context:read":"Read context created by this app and notes explicitly shared with you","context:read:all":"Read your context, notes and history across all connected apps; requires context:read","notes:share":"Invite people or agents to specific notes, with an expiry and revocation","context:write":"Append to your dots context and history","pute:read":"See your pute credit balance","pute:spend":"Spend pute credits on your behalf","pute:topup":"Start a checkout to add pute credits to your balance","mcp:use":"Call MCP servers connected to your dots identity","cosign":"Vouch for others and co-sign them into your dots org","delegate":"Grant scoped, capped access to other dots or agents on your behalf","org:act":"Take whitelisted actions as a dots org you belong to","org:admin":"Manage members, roles, and grants for a dots org","offline_access":"Maintain access when you are not actively using the app"}}}}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"}},"required":["error"]},"Ok":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]},"Discovery":{"type":"object","properties":{"issuer":{"type":"string"},"authorization_endpoint":{"type":"string"},"token_endpoint":{"type":"string"},"device_authorization_endpoint":{"type":"string"},"jwks_uri":{"type":"string"},"scopes_supported":{"type":"array","items":{"type":"string"}}},"required":["issuer","authorization_endpoint","token_endpoint","device_authorization_endpoint","jwks_uri","scopes_supported"]},"DeviceAuthorization":{"type":"object","properties":{"device_code":{"type":"string"},"user_code":{"type":"string"},"verification_uri":{"type":"string"},"verification_uri_complete":{"type":"string"},"expires_in":{"type":"integer"},"interval":{"type":"integer"}},"required":["device_code","user_code","verification_uri","verification_uri_complete","expires_in","interval"]},"Tokens":{"type":"object","properties":{"access_token":{"type":"string"},"token_type":{"type":"string","enum":["Bearer"]},"expires_in":{"type":"integer"},"refresh_token":{"type":"string"},"id_token":{"type":"string"},"scope":{"type":"string"}},"required":["access_token","token_type","expires_in","scope"]},"Userinfo":{"type":"object","properties":{"sub":{"type":"string"},"iss":{"type":"string"},"username":{"type":["string","null"]},"email":{"type":"string"},"email_verified":{"type":"boolean"},"identity_stage":{"type":"string","enum":["authenticated","confirmed","full"]},"wallet_confirmed":{"type":"boolean"},"color":{"type":["string","null"]},"mcp":{"type":"string"},"bootstrap":{"type":"string"}},"required":["sub"]},"ContextPolicy":{"type":"object","properties":{"appClientId":{"type":"string"},"readEnabled":{"type":"boolean"},"ingestEnabled":{"type":"boolean"},"indexEnabled":{"type":"boolean"},"actionsEnabled":{"type":"boolean"},"maxContentBytes":{"type":"integer"},"retentionDays":{"type":["integer","null"]}},"required":["appClientId","readEnabled","ingestEnabled","indexEnabled","actionsEnabled","maxContentBytes","retentionDays"]},"Context":{"type":"object","properties":{"id":{"type":"string"},"content":{"type":["string","null"]},"kind":{"type":"string"},"app_client_id":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id"]},"Bootstrap":{"type":"object","properties":{"identity":{"$ref":"#/components/schemas/Userinfo"},"context":{"type":"object","properties":{"available":{"type":"boolean"},"mode":{"type":"string","enum":["app","agent"]},"policy":{"anyOf":[{"$ref":"#/components/schemas/ContextPolicy"},{"type":"null"}]},"counts":{"type":"object","properties":{"context":{"type":"integer"},"ingest":{"type":"integer"},"activity":{"type":"integer"}},"required":["context","ingest","activity"]},"recent":{"type":"object","properties":{"context":{"type":"array","items":{"$ref":"#/components/schemas/Context"}},"ingest":{"type":"array","items":{"type":"object"}},"activity":{"type":"array","items":{"type":"object"}}},"required":["context","ingest","activity"]},"apps":{"type":"array","items":{"type":"object","properties":{"client_id":{"type":"string"},"name":{"type":"string"}},"required":["client_id","name"]}}},"required":["available","mode","policy","counts","recent","apps"]},"endpoints":{"type":"object","properties":{"mcp":{"type":"string"},"bootstrap":{"type":"string"},"userinfo":{"type":"string"},"listen":{"type":"string"}},"required":["mcp","bootstrap","userinfo","listen"]}},"required":["identity","context","endpoints"]},"Note":{"type":"object","properties":{"id":{"type":"string"},"owner_id":{"type":"string"},"appClientId":{"type":"string"},"appFileId":{"type":"string"},"title":{"type":"string"},"content":{"type":"string"},"updatedAt":{"type":"string"},"updatedByDotsSub":{"type":["string","null"]}},"required":["id","owner_id","appClientId","appFileId","title","content","updatedAt"]},"IdentityNote":{"type":"object","properties":{"noteId":{"type":"string"},"appClientId":{"type":"string"},"appFileId":{"type":"string"},"title":{"type":"string"},"content":{"type":"string"},"preview":{"type":"string"},"updatedAt":{"type":"string"},"accessRole":{"type":"string","enum":["reader","writer"]},"owned":{"type":"boolean"},"app":{"type":"object","properties":{"name":{"type":"string"},"homepageUrl":{"type":["string","null"]}},"required":["name","homepageUrl"]}},"required":["noteId","appClientId","appFileId","title","content","preview","updatedAt","accessRole","owned","app"]},"Grant":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"noteId":{"type":"string"},"title":{"type":"string"},"owner":{"type":"object","properties":{"sub":{"type":"string"},"username":{"type":["string","null"]}},"required":[]},"recipient":{"type":"object","properties":{"sub":{"type":"string"},"username":{"type":["string","null"]}},"required":[]},"clientId":{"type":["string","null"]},"permissions":{"type":"array","items":{"type":"string","enum":["note:read","note:write","note:draft"]}},"status":{"type":"string","enum":["pending","accepted","declined","revoked","expired"]},"expiresAt":{"type":["string","null"],"format":"date-time"},"maxWrites":{"type":["integer","null"]},"used":{"type":"integer"},"url":{"type":"string","format":"uri"},"canAccept":{"type":"boolean"},"canRevoke":{"type":"boolean"}},"required":["id","noteId","title","owner","recipient","clientId","permissions","status","expiresAt","maxWrites","used","url","canAccept","canRevoke"]},"Draft":{"type":"object","properties":{"id":{"type":"string"},"note_id":{"type":"string"},"grant_id":{"type":["string","null"]},"actor_privy_user_id":{"type":"string"},"actor_client_id":{"type":"string"},"on_behalf_of":{"type":"string"},"content":{"type":"string"},"request_id":{"type":"string"},"created_at":{"type":"string"}},"required":["id","note_id","grant_id","actor_privy_user_id","actor_client_id","on_behalf_of","content","request_id","created_at"]},"DataRecord":{"type":"object","properties":{"collection":{"type":"string"},"key":{"type":"string"},"value":{},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["collection","key","value","created_at","updated_at"]}}}}