--- openapi: 3.0.1 info: title: API V1 version: v1 description: | Notes and folders for the current account. Every request is scoped to the signed-in user; identifiers belonging to another account are reported as `404 Not Found` rather than `403` so their existence is not disclosed. Resource `id`s are UUIDv7 strings and may be supplied by the client on creation to support offline-first sync. paths: "/api/v1/changes": get: summary: lists changes since a cursor tags: - Changes security: - bearerAuth: [] description: 'Delta sync feed: notes and folders changed after the cursor, tombstones included. Omit the cursor for a full snapshot. Pass the returned `cursor` back on the next request.' parameters: - name: cursor in: query required: false schema: type: string format: date-time description: Opaque cursor from a previous response. Omit for a full snapshot. responses: '200': description: only rows changed after the cursor content: application/json: schema: "$ref": "#/components/schemas/Changes" '401': description: the access token is missing, expired, or issued for another audience content: application/json: schema: "$ref": "#/components/schemas/Error" "/api/v1/folders": get: summary: lists folders tags: - Folders security: - bearerAuth: [] description: Returns every folder for the current account, ordered by position. responses: '200': description: folders in position order content: application/json: schema: type: array items: "$ref": "#/components/schemas/Folder" '401': description: the access token is missing, expired, or issued for another audience content: application/json: schema: "$ref": "#/components/schemas/Error" post: summary: creates a folder tags: - Folders security: - bearerAuth: [] description: Creates a folder. Supply `id` to reuse a client-generated UUIDv7 for offline sync; omit it to have the server assign one. parameters: [] responses: '201': description: created with client-supplied UUID content: application/json: schema: "$ref": "#/components/schemas/Folder" '422': description: blank name content: application/json: schema: "$ref": "#/components/schemas/Errors" '401': description: the access token is missing, expired, or issued for another audience content: application/json: schema: "$ref": "#/components/schemas/Error" requestBody: content: application/x-www-form-urlencoded: schema: type: object properties: folder: type: object properties: name: type: string description: Display name. Required and must be non-blank. example: Recipes id: type: string format: uuid description: Optional client-supplied UUIDv7. example: '018f1c8e-7d7a-7a8f-b7ef-3dffdcf876d2' required: - name required: - folder "/api/v1/folders/{id}": parameters: - name: id in: path required: true schema: type: string get: summary: shows a folder tags: - Folders security: - bearerAuth: [] description: Returns a single folder owned by the current account. responses: '200': description: found content: application/json: schema: "$ref": "#/components/schemas/Folder" '404': description: unknown or other account content: application/json: schema: "$ref": "#/components/schemas/Error" '401': description: the access token is missing, expired, or issued for another audience content: application/json: schema: "$ref": "#/components/schemas/Error" patch: summary: updates a folder tags: - Folders security: - bearerAuth: [] description: Renames or reorders a folder. Use `before_id` or `after_id` to place it relative to another folder owned by the current account. parameters: [] responses: '200': description: moved before another folder content: application/json: schema: "$ref": "#/components/schemas/Folder" '404': description: other account folder content: application/json: schema: "$ref": "#/components/schemas/Error" '422': description: insert target belongs to another account content: application/json: schema: "$ref": "#/components/schemas/Errors" '401': description: the access token is missing, expired, or issued for another audience content: application/json: schema: "$ref": "#/components/schemas/Error" requestBody: content: application/x-www-form-urlencoded: schema: type: object properties: folder: type: object properties: name: type: string description: New display name. Required and must be non-blank. example: Books renamed before_id: type: string description: Insert before this folder. example: '018f1c8e-7d7a-7a8f-b7ef-3dffdcf876d4' after_id: type: string description: Insert after this folder. example: '018f1c8e-7d7a-7a8f-b7ef-3dffdcf876d5' required: - folder delete: summary: deletes a folder tags: - Folders security: - bearerAuth: [] description: Tombstones a folder (soft delete). Its notes are kept and become unfiled (`folder_id` set to null). responses: '204': description: deleted, its notes unfiled '404': description: other account folder content: application/json: schema: "$ref": "#/components/schemas/Error" '401': description: the access token is missing, expired, or issued for another audience content: application/json: schema: "$ref": "#/components/schemas/Error" "/api/v1/notes": get: summary: lists notes tags: - Notes security: - bearerAuth: [] description: Returns notes for the current account. The default `kept` scope uses board order and excludes archived and trashed notes. The `trashed` scope returns trash in reverse deletion order. parameters: - name: scope in: query required: false schema: type: string enum: - kept - trashed description: Lifecycle scope to list. Defaults to `kept`. responses: '200': description: notes in the requested scope content: application/json: schema: type: array items: "$ref": "#/components/schemas/Note" '422': description: scope is invalid content: application/json: schema: "$ref": "#/components/schemas/Errors" '401': description: the access token is missing, expired, or issued for another audience content: application/json: schema: "$ref": "#/components/schemas/Error" post: summary: creates a note tags: - Notes security: - bearerAuth: [] description: Creates a note. The title is derived from the first line of `body`. Supply `id` to reuse a client-generated UUIDv7 for offline sync. `folder_id` must belong to the current account. parameters: [] responses: '201': description: created with client-supplied UUID content: application/json: schema: "$ref": "#/components/schemas/Note" '422': description: folder belongs to another account content: application/json: schema: "$ref": "#/components/schemas/Errors" '401': description: the access token is missing, expired, or issued for another audience content: application/json: schema: "$ref": "#/components/schemas/Error" requestBody: content: application/x-www-form-urlencoded: schema: type: object properties: note: type: object properties: body: type: string description: Note text. Required; its first line becomes the title. example: |- Groceries Buy milk id: type: string format: uuid description: Optional client-supplied UUIDv7. example: '018f1c8e-7d7a-7a8f-b7ef-3dffdcf876d2' folder_id: type: string format: uuid description: Optional owning folder; must belong to the current account. example: '018f1c8e-7d7a-7a8f-b7ef-3dffdcf876d3' board_position: type: integer description: Optional All Notes masonry order. Omit it to place the note before the current board. example: 0 folder_board_position: type: integer description: Optional masonry order inside the note's folder. Omit it to place the note before that folder board. example: 0 required: - body required: - note "/api/v1/notes/reorder": patch: summary: reorders the masonry board tags: - Notes security: - bearerAuth: [] description: Replaces the current account's board order with the submitted visible note ids. Pass `folder_id` when reordering a folder board. Pinned and unpinned notes remain separate display zones. parameters: [] responses: '200': description: reordered content: application/json: schema: type: array items: "$ref": "#/components/schemas/Note" '422': description: invalid reorder content: application/json: schema: "$ref": "#/components/schemas/Errors" '401': description: the access token is missing, expired, or issued for another audience content: application/json: schema: "$ref": "#/components/schemas/Error" requestBody: content: application/json: schema: type: object properties: note_ids: type: array description: Every visible note id in the board's new order. items: type: string format: uuid folder_id: type: string nullable: true description: Folder being viewed, or null on the all-notes board. required: - note_ids "/api/v1/notes/{id}/restore": parameters: - name: id in: path required: true schema: type: string patch: summary: restores a trashed note tags: - Notes security: - bearerAuth: [] description: Clears `deleted_at` on a trashed note owned by the current account. Notes that are not in trash and notes belonging to another account return 404. responses: '200': description: restored content: application/json: schema: "$ref": "#/components/schemas/Note" '404': description: unknown, not trashed, or other account content: application/json: schema: "$ref": "#/components/schemas/Error" '401': description: the access token is missing, expired, or issued for another audience content: application/json: schema: "$ref": "#/components/schemas/Error" "/api/v1/notes/{id}/purge": parameters: - name: id in: path required: true schema: type: string delete: summary: permanently deletes a trashed note tags: - Notes security: - bearerAuth: [] description: Permanently deletes one trashed note owned by the current account. This cannot be undone. Notes outside trash and notes belonging to another account return 404. responses: '204': description: permanently deleted '404': description: unknown, not trashed, or other account content: application/json: schema: "$ref": "#/components/schemas/Error" '401': description: the access token is missing, expired, or issued for another audience content: application/json: schema: "$ref": "#/components/schemas/Error" "/api/v1/notes/empty_trash": delete: summary: permanently deletes every trashed note tags: - Notes security: - bearerAuth: [] description: Permanently deletes every note in the current account's trash. Kept notes and every note belonging to another account are untouched. This cannot be undone. responses: '204': description: trash emptied '401': description: the access token is missing, expired, or issued for another audience content: application/json: schema: "$ref": "#/components/schemas/Error" "/api/v1/notes/{id}": parameters: - name: id in: path required: true schema: type: string get: summary: shows a note tags: - Notes security: - bearerAuth: [] description: Returns a single kept note owned by the current account. responses: '200': description: found content: application/json: schema: "$ref": "#/components/schemas/Note" '404': description: unknown or other account content: application/json: schema: "$ref": "#/components/schemas/Error" '401': description: the access token is missing, expired, or issued for another audience content: application/json: schema: "$ref": "#/components/schemas/Error" patch: summary: updates a note tags: - Notes security: - bearerAuth: [] description: Updates a note. Send only the fields to change. Pass an empty `folder_id` to unfile the note; a `folder_id` from another account is rejected with 422. When `folder_id` changes, the note moves to the top of that sidebar list unless `before_id` or `after_id` names an exact insert target. parameters: [] responses: '200': description: moved before another note content: application/json: schema: "$ref": "#/components/schemas/Note" '404': description: other account note content: application/json: schema: "$ref": "#/components/schemas/Error" '422': description: insert target belongs to another account content: application/json: schema: "$ref": "#/components/schemas/Errors" '401': description: the access token is missing, expired, or issued for another audience content: application/json: schema: "$ref": "#/components/schemas/Error" requestBody: content: application/x-www-form-urlencoded: schema: type: object properties: note: type: object properties: title: type: string description: Override the derived title. example: Groceries body: type: string description: Replacement note text. example: |- Groceries Buy milk folder_id: type: string description: Move to this folder, or empty string to unfile. Must belong to the current account. example: '018f1c8e-7d7a-7a8f-b7ef-3dffdcf876d3' before_id: type: string description: Insert before this note in the destination sidebar list. example: '018f1c8e-7d7a-7a8f-b7ef-3dffdcf876d4' after_id: type: string description: Insert after this note in the destination sidebar list. example: '018f1c8e-7d7a-7a8f-b7ef-3dffdcf876d5' board_position: type: integer description: All Notes masonry order. Prefer `/api/v1/notes/reorder` when moving more than one note. example: 0 folder_board_position: type: integer description: Folder masonry order inside the current folder. Prefer `/api/v1/notes/reorder` when moving more than one note. example: 0 pinned: type: boolean description: Pin or unpin the note. example: true delete: summary: deletes a note tags: - Notes security: - bearerAuth: [] description: Moves a note to trash by setting `deleted_at`. Pass `discard=true` for an empty composer note to permanently delete it without leaving a tombstone. parameters: - name: discard in: query required: false schema: type: boolean description: Permanently delete the note when it is empty. A note with content is still moved to trash. example: true responses: '204': description: trashed or discarded '404': description: other account note content: application/json: schema: "$ref": "#/components/schemas/Error" '401': description: the access token is missing, expired, or issued for another audience content: application/json: schema: "$ref": "#/components/schemas/Error" "/api/v1/session": post: summary: establishes the account behind a token tags: - Session security: - idTokenAuth: [] description: | Takes an **ID token** — not an access token — and returns the account it identifies, creating it on a first sign-in. Every other endpoint resolves an existing account by the token's subject and never creates one, and an access token carries no email to create from, so a native client calls this once after a sign-in completes and then uses its access token everywhere else. responses: '200': description: the account, found by subject or created from the token's claims content: application/json: schema: "$ref": "#/components/schemas/User" '401': description: the token is missing, expired, or issued for another audience content: application/json: schema: "$ref": "#/components/schemas/Error" security: - bearerAuth: [] components: securitySchemes: bearerAuth: type: http scheme: bearer bearerFormat: JWT description: An access token issued by the fleet auth service, verified against its JWKS. Tokens minted for the web client and for the native client are both accepted. idTokenAuth: type: http scheme: bearer bearerFormat: JWT description: 'An ID token from the same issuer. Only POST /api/v1/session takes one: it carries the email and name an account is created from.' schemas: Error: type: object description: A request that could not be served. properties: errors: type: array description: One message per problem found. items: type: string example: - Not authenticated required: - errors User: type: object description: The account behind the presented token. properties: id: type: string format: uuid description: UUIDv7 identifier. example: '018f1c8e-7d7a-7a8f-b7ef-3dffdcf876d2' email: type: string format: email description: Email as auth holds it. example: you@example.com name: type: string nullable: true description: Display name as auth holds it. example: Prabhanshu Gupta required: - id - email - name Folder: type: object description: A folder groups notes for the current account. properties: id: type: string format: uuid description: UUIDv7 identifier. example: '018f1c8e-7d7a-7a8f-b7ef-3dffdcf876d2' name: type: string description: Display name. example: Recipes position: type: integer description: Sort order within the account, ascending. example: 0 deleted_at: type: string format: date-time nullable: true description: Tombstone time, or null when live. created_at: type: string format: date-time nullable: true description: ISO 8601 UTC creation time. updated_at: type: string format: date-time nullable: true description: ISO 8601 UTC last-update time. required: - id - name - position - deleted_at - created_at - updated_at Note: type: object description: A single note belonging to the current account. properties: id: type: string format: uuid description: UUIDv7 identifier. example: '018f1c8e-7d7a-7a8f-b7ef-3dffdcf876d2' title: type: string nullable: true description: First line of the body, derived server-side. example: Groceries body: type: string nullable: true description: Full note text. example: |- Groceries Buy milk folder_id: type: string format: uuid nullable: true description: Owning folder, or null when unfiled. example: '018f1c8e-7d7a-7a8f-b7ef-3dffdcf876d3' pinned: type: boolean description: Whether the note is pinned to its own board section. example: false position: type: integer nullable: true description: Sidebar order within its folder or root list, ascending. example: 0 board_position: type: integer nullable: true description: All Notes masonry board order, ascending within the pinned or unpinned zone. example: 0 folder_board_position: type: integer nullable: true description: Folder masonry board order inside the current folder, ascending within the pinned or unpinned zone. example: 0 empty: type: boolean description: True when title and body are both blank. example: false archived_at: type: string format: date-time nullable: true description: Archive time, or null when kept. deleted_at: type: string format: date-time nullable: true description: Trash time, or null when kept. created_at: type: string format: date-time nullable: true description: ISO 8601 UTC creation time. updated_at: type: string format: date-time nullable: true description: ISO 8601 UTC last-update time. url: type: string description: API path for this note. example: "/api/v1/notes/018f1c8e-7d7a-7a8f-b7ef-3dffdcf876d2" html_url: type: string description: Web app path for this note. example: "/notes/018f1c8e-7d7a-7a8f-b7ef-3dffdcf876d2" images: type: array description: Attached images. Currently always empty. items: type: object required: - id - title - body - folder_id - pinned - position - board_position - folder_board_position - empty - created_at - updated_at - url - html_url - images Changes: type: object description: 'Delta since a cursor: rows changed after it, tombstones included. Omit the cursor for a full snapshot.' properties: notes: type: array description: Notes changed since the cursor. items: "$ref": "#/components/schemas/Note" folders: type: array description: Folders changed since the cursor. items: "$ref": "#/components/schemas/Folder" cursor: type: string format: date-time description: Opaque cursor to pass as ?cursor= on the next request. required: - notes - folders - cursor Errors: type: object description: Validation failure. Each string is a human-readable message. properties: errors: type: array items: type: string example: - Name can't be blank required: - errors servers: - url: https://{defaultHost} variables: defaultHost: default: www.example.com