openapi: 3.1.0 info: # Do not change the title, if the title changes, the import paths will be broken title: Api version: 0.1.0 description: API specification servers: - url: /api description: Base API path tags: - name: health description: Health operations - name: auth description: Auth operations - name: tabs description: Notepad tabs paths: /healthz: get: operationId: healthCheck tags: [health] summary: Health check description: Returns server health status responses: "200": description: Healthy content: application/json: schema: $ref: "#/components/schemas/HealthStatus" /auth/user: get: operationId: getCurrentAuthUser tags: [auth] summary: Get current user responses: "200": description: Current auth user content: application/json: schema: $ref: "#/components/schemas/GetCurrentAuthUserResponse" /tabs: get: operationId: getTabs tags: [tabs] summary: Get all tabs for the current user security: - cookieAuth: [] responses: "200": description: List of tabs content: application/json: schema: type: array items: $ref: "#/components/schemas/Tab" "401": description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" post: operationId: createTab tags: [tabs] summary: Create a new tab security: - cookieAuth: [] requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CreateTabBody" responses: "201": description: Tab created content: application/json: schema: $ref: "#/components/schemas/Tab" "401": description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /tabs/{tabId}: get: operationId: getTab tags: [tabs] summary: Get a specific tab security: - cookieAuth: [] parameters: - name: tabId in: path required: true schema: type: string responses: "200": description: Tab content: application/json: schema: $ref: "#/components/schemas/Tab" "401": description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" "404": description: Not found content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" put: operationId: updateTab tags: [tabs] summary: Update a tab security: - cookieAuth: [] parameters: - name: tabId in: path required: true schema: type: string requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/UpdateTabBody" responses: "200": description: Updated tab content: application/json: schema: $ref: "#/components/schemas/Tab" "401": description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" "404": description: Not found content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" delete: operationId: deleteTab tags: [tabs] summary: Delete a tab security: - cookieAuth: [] parameters: - name: tabId in: path required: true schema: type: string responses: "204": description: Tab deleted "401": description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" "404": description: Not found content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /mobile-auth/token-exchange: post: operationId: exchangeMobileAuthorizationCode tags: [auth] summary: Exchange mobile authorization code for session token requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/ExchangeMobileAuthorizationCodeBody" responses: "200": description: Session token content: application/json: schema: $ref: "#/components/schemas/ExchangeMobileAuthorizationCodeResponse" /mobile-auth/logout: post: operationId: logoutMobileSession tags: [auth] summary: Logout mobile session responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/LogoutMobileSessionResponse" /tabs/reorder: post: operationId: reorderTabs tags: [tabs] summary: Reorder tabs security: - cookieAuth: [] requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/ReorderTabsBody" responses: "200": description: Tabs reordered content: application/json: schema: type: array items: $ref: "#/components/schemas/Tab" "401": description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" components: securitySchemes: cookieAuth: type: apiKey in: cookie name: session schemas: HealthStatus: type: object properties: status: type: string required: - status GetCurrentAuthUserResponse: type: object properties: authenticated: type: boolean user: oneOf: - $ref: "#/components/schemas/AuthUser" - type: "null" required: - authenticated AuthUser: type: object properties: id: type: string username: type: string firstName: type: string lastName: type: string profileImage: type: string required: - id - username Tab: type: object properties: id: type: string userId: type: string title: type: string content: type: string sortOrder: type: integer createdAt: type: string format: date-time updatedAt: type: string format: date-time required: - id - userId - title - content - sortOrder - createdAt - updatedAt CreateTabBody: type: object properties: title: type: string required: - title UpdateTabBody: type: object properties: title: type: string content: type: string ReorderTabsBody: type: object properties: tabIds: type: array items: type: string required: - tabIds ExchangeMobileAuthorizationCodeBody: type: object properties: code: type: string code_verifier: type: string redirect_uri: type: string state: type: string nonce: type: string required: - code - code_verifier - redirect_uri - state ExchangeMobileAuthorizationCodeResponse: type: object properties: token: type: string required: - token LogoutMobileSessionResponse: type: object properties: success: type: boolean required: - success ErrorResponse: type: object properties: error: type: string required: - error