{"openapi":"3.1.0","info":{"title":"MemNote API","description":"REST API for MemNote — read and write notes, tags, and devices.","version":"1.0.0"},"components":{"securitySchemes":{"oauth2":{"type":"oauth2","description":"OAuth 2.0 access token for AI agents and programmatic access. Authorize via the authorization_code flow, then use the access token.","flows":{"authorizationCode":{"authorizationUrl":"https://api.memnote.randomfact.com/oauth/authorize","tokenUrl":"https://api.memnote.randomfact.com/oauth/token","scopes":{"notes":"Read and write notes, tags, and devices"}}}}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}},"NoteAddress":{"type":"object","required":["streetNumber","streetName","subLocality","city","subAdminArea","adminArea","country","postalCode","isoCountryCode"],"properties":{"streetNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"streetName":{"anyOf":[{"type":"string"},{"type":"null"}]},"subLocality":{"anyOf":[{"type":"string"},{"type":"null"}]},"city":{"anyOf":[{"type":"string"},{"type":"null"}]},"subAdminArea":{"anyOf":[{"type":"string"},{"type":"null"}]},"adminArea":{"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"anyOf":[{"type":"string"},{"type":"null"}]},"postalCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"isoCountryCode":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"DeviceResponse":{"type":"object","required":["id","name","platform","customName","color"],"properties":{"id":{"format":"uuid","type":"string"},"name":{"description":"System device name","type":"string"},"platform":{"description":"e.g. android, ios, web, windows, macos, linux","type":"string"},"customName":{"anyOf":[{"description":"User-assigned friendly name","type":"string"},{"type":"null"}]},"color":{"anyOf":[{"minimum":0,"maximum":20,"description":"Color palette index (0-based, 0–20)","type":"integer"},{"type":"null"}]}}},"NoteMetadata":{"type":"object","required":["latitude","longitude","address","device"],"properties":{"latitude":{"anyOf":[{"type":"number"},{"type":"null"}]},"longitude":{"anyOf":[{"type":"number"},{"type":"null"}]},"address":{"anyOf":[{"$ref":"#/components/schemas/NoteAddress"},{"type":"null"}]},"device":{"anyOf":[{"$ref":"#/components/schemas/DeviceResponse"},{"type":"null"}]}}},"TagResponse":{"type":"object","required":["id","name","color","parentId","createdAt","updatedAt","deletedAt"],"properties":{"id":{"format":"uuid","type":"string"},"name":{"type":"string"},"color":{"anyOf":[{"minimum":0,"maximum":20,"description":"Color palette index (0-based, 0–20)","type":"integer"},{"type":"null"}]},"parentId":{"anyOf":[{"format":"uuid","description":"Parent tag ID for nested tags","type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"deletedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}},"NoteResponse":{"type":"object","required":["id","title","content","createdAt","updatedAt","changedAt","deletedAt","deletedVia","deletedBy","metadata","tags"],"properties":{"id":{"format":"uuid","type":"string"},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"content":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"changedAt":{"format":"date-time","type":"string"},"deletedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"deletedVia":{"anyOf":[{"description":"How a trashed note was deleted: `app` (a MemNote device), `mcp:<client name>` (an AI integration signed in with OAuth, e.g. `mcp:Claude`), or `api` (any other API caller). Null when the note is not in the trash, or was trashed before this was recorded.","type":"string"},{"type":"null"}]},"deletedBy":{"anyOf":[{"description":"Who deleted it: the device ID for `app`, the OAuth client ID for `mcp:*`. Null when unknown or not deleted.","type":"string"},{"type":"null"}]},"metadata":{"anyOf":[{"$ref":"#/components/schemas/NoteMetadata"},{"type":"null"}]},"tags":{"type":"array","items":{"$ref":"#/components/schemas/TagResponse"}}}},"NoteHistoryResponse":{"type":"object","required":["id","noteId","title","content","tags","archivedAt","deletedAt"],"properties":{"id":{"format":"uuid","type":"string"},"noteId":{"format":"uuid","type":"string"},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"content":{"type":"string"},"tags":{"anyOf":[{"description":"Snapshot of tag names at archive time","type":"array","items":{"type":"string"}},{"type":"null"}]},"archivedAt":{"format":"date-time","type":"string"},"deletedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}},"SearchResult":{"type":"object","required":["note","score"],"properties":{"note":{"$ref":"#/components/schemas/NoteResponse"},"score":{"description":"Cosine similarity score (0–1, higher = more similar)","type":"number"}}},"RestoreNotesResponse":{"type":"object","required":["restored","notDeleted","notFound","purged"],"properties":{"restored":{"description":"Taken out of the trash by this call","type":"array","items":{"format":"uuid","type":"string"}},"notDeleted":{"description":"Were not in the trash; left unchanged","type":"array","items":{"format":"uuid","type":"string"}},"notFound":{"description":"No such note","type":"array","items":{"format":"uuid","type":"string"}},"purged":{"description":"Deleted forever from the MemNote app; cannot be restored","type":"array","items":{"format":"uuid","type":"string"}}}}}},"paths":{"/v1/notes/":{"get":{"operationId":"listNotes","summary":"List notes","tags":["Notes"],"description":"Paginated list of notes with denormalized tags and device info.","parameters":[{"schema":{"minimum":1,"maximum":100,"default":20,"type":"integer"},"in":"query","name":"limit","required":false,"description":"Max results per page (1–100, default 20)"},{"schema":{"type":"string"},"in":"query","name":"pageToken","required":false,"description":"Opaque cursor: pass the previous response's nextPageToken unchanged. Do not parse or construct one; its format can change."},{"schema":{"default":false,"type":"boolean"},"in":"query","name":"includeDeleted","required":false,"description":"Include soft-deleted notes (default false)"}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["notes"],"properties":{"notes":{"type":"array","items":{"$ref":"#/components/schemas/NoteResponse"}},"nextPageToken":{"description":"Pass as pageToken to fetch the next page; absent when no more pages","type":"string"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}}}},"post":{"operationId":"createNote","summary":"Create a note","tags":["Notes"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["content"],"properties":{"content":{"description":"Note body (plain text or Markdown)","type":"string"},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"metadata":{"anyOf":[{"type":"object","properties":{"latitude":{"anyOf":[{"type":"number"},{"type":"null"}]},"longitude":{"anyOf":[{"type":"number"},{"type":"null"}]},"device":{"anyOf":[{"type":"object","properties":{"id":{"format":"uuid","description":"Device ID — if provided, platform/name are ignored","type":"string"},"platform":{"description":"Device platform (used with name to look up device when id is omitted)","type":"string"},"name":{"description":"System device name (used with platform to look up device when id is omitted)","type":"string"}}},{"type":"null"}]}}},{"type":"null"}]},"tags":{"description":"Tags to associate with the note","type":"array","items":{"type":"object","properties":{"id":{"format":"uuid","description":"Tag ID — if provided, name/parentId are ignored","type":"string"},"name":{"description":"Tag name (used to look up tag when id is omitted)","type":"string"},"parentId":{"anyOf":[{"format":"uuid","description":"Parent tag ID to disambiguate tags with the same name","type":"string"},{"type":"null"}]}}}}}}}}},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","title","content","createdAt","updatedAt","changedAt","deletedAt","deletedVia","deletedBy","metadata","tags"],"properties":{"id":{"format":"uuid","type":"string"},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"content":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"changedAt":{"format":"date-time","type":"string"},"deletedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"deletedVia":{"anyOf":[{"description":"How a trashed note was deleted: `app` (a MemNote device), `mcp:<client name>` (an AI integration signed in with OAuth, e.g. `mcp:Claude`), or `api` (any other API caller). Null when the note is not in the trash, or was trashed before this was recorded.","type":"string"},{"type":"null"}]},"deletedBy":{"anyOf":[{"description":"Who deleted it: the device ID for `app`, the OAuth client ID for `mcp:*`. Null when unknown or not deleted.","type":"string"},{"type":"null"}]},"metadata":{"anyOf":[{"$ref":"#/components/schemas/NoteMetadata"},{"type":"null"}]},"tags":{"type":"array","items":{"$ref":"#/components/schemas/TagResponse"}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}}}}},"/v1/notes/{id}":{"get":{"operationId":"getNote","summary":"Get a note","tags":["Notes"],"description":"Returns the note with its associated tags.","parameters":[{"schema":{"format":"uuid","type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","title","content","createdAt","updatedAt","changedAt","deletedAt","deletedVia","deletedBy","metadata","tags"],"properties":{"id":{"format":"uuid","type":"string"},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"content":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"changedAt":{"format":"date-time","type":"string"},"deletedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"deletedVia":{"anyOf":[{"description":"How a trashed note was deleted: `app` (a MemNote device), `mcp:<client name>` (an AI integration signed in with OAuth, e.g. `mcp:Claude`), or `api` (any other API caller). Null when the note is not in the trash, or was trashed before this was recorded.","type":"string"},{"type":"null"}]},"deletedBy":{"anyOf":[{"description":"Who deleted it: the device ID for `app`, the OAuth client ID for `mcp:*`. Null when unknown or not deleted.","type":"string"},{"type":"null"}]},"metadata":{"anyOf":[{"$ref":"#/components/schemas/NoteMetadata"},{"type":"null"}]},"tags":{"type":"array","items":{"$ref":"#/components/schemas/TagResponse"}}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}}}},"put":{"operationId":"updateNote","summary":"Update a note","tags":["Notes"],"description":"Updates a note. The current version is automatically archived to note history before the update is applied.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"content":{"type":"string"},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"metadata":{"anyOf":[{"type":"object","properties":{"latitude":{"anyOf":[{"type":"number"},{"type":"null"}]},"longitude":{"anyOf":[{"type":"number"},{"type":"null"}]},"device":{"anyOf":[{"type":"object","properties":{"id":{"format":"uuid","description":"Device ID — if provided, platform/name are ignored","type":"string"},"platform":{"description":"Device platform (used with name to look up device when id is omitted)","type":"string"},"name":{"description":"System device name (used with platform to look up device when id is omitted)","type":"string"}}},{"type":"null"}]}}},{"type":"null"}]},"tags":{"description":"Replaces all tag associations when provided","type":"array","items":{"type":"object","properties":{"id":{"format":"uuid","description":"Tag ID — if provided, name/parentId are ignored","type":"string"},"name":{"description":"Tag name (used to look up tag when id is omitted)","type":"string"},"parentId":{"anyOf":[{"format":"uuid","description":"Parent tag ID to disambiguate tags with the same name","type":"string"},{"type":"null"}]}}}}}}}}},"parameters":[{"schema":{"format":"uuid","type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","title","content","createdAt","updatedAt","changedAt","deletedAt","deletedVia","deletedBy","metadata","tags"],"properties":{"id":{"format":"uuid","type":"string"},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"content":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"changedAt":{"format":"date-time","type":"string"},"deletedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"deletedVia":{"anyOf":[{"description":"How a trashed note was deleted: `app` (a MemNote device), `mcp:<client name>` (an AI integration signed in with OAuth, e.g. `mcp:Claude`), or `api` (any other API caller). Null when the note is not in the trash, or was trashed before this was recorded.","type":"string"},{"type":"null"}]},"deletedBy":{"anyOf":[{"description":"Who deleted it: the device ID for `app`, the OAuth client ID for `mcp:*`. Null when unknown or not deleted.","type":"string"},{"type":"null"}]},"metadata":{"anyOf":[{"$ref":"#/components/schemas/NoteMetadata"},{"type":"null"}]},"tags":{"type":"array","items":{"$ref":"#/components/schemas/TagResponse"}}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}}}},"delete":{"operationId":"deleteNote","summary":"Delete a note","tags":["Notes"],"description":"Moves the note to the trash (soft delete) by setting deletedAt, and records who deleted it in deletedVia / deletedBy. Syncs as deleted to connected devices. Undo with restoreNote. Idempotent: a note already in the trash is left exactly as it is, including who deleted it.","parameters":[{"schema":{"format":"uuid","type":"string"},"in":"path","name":"id","required":true}],"responses":{"204":{"description":"Note deleted"},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}}}}},"/v1/notes/restore":{"post":{"operationId":"restoreNotes","summary":"Restore notes from the trash","tags":["Notes"],"description":"Takes up to 500 notes out of the trash in one atomic write, and reports what happened to each ID. Same rules as restoreNote: notes that are not in the trash are left unchanged (notDeleted), and notes deleted forever are never brought back (purged). Find the notes to restore with listNotes?includeDeleted=true: trashed notes have a deletedAt, and deletedVia says who deleted them.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["ids"],"properties":{"ids":{"minItems":1,"maxItems":500,"description":"IDs of the notes to take out of the trash (1–500). Duplicates are ignored.","type":"array","items":{"format":"uuid","type":"string"}}}}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["restored","notDeleted","notFound","purged"],"properties":{"restored":{"description":"Taken out of the trash by this call","type":"array","items":{"format":"uuid","type":"string"}},"notDeleted":{"description":"Were not in the trash; left unchanged","type":"array","items":{"format":"uuid","type":"string"}},"notFound":{"description":"No such note","type":"array","items":{"format":"uuid","type":"string"}},"purged":{"description":"Deleted forever from the MemNote app; cannot be restored","type":"array","items":{"format":"uuid","type":"string"}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}}}}},"/v1/notes/{id}/restore":{"post":{"operationId":"restoreNote","summary":"Restore a note from the trash","tags":["Notes"],"description":"Takes a soft-deleted note out of the trash: clears deletedAt, deletedVia and deletedBy, and syncs the restore to connected devices. The note's content and updatedAt are unchanged. Restoring a note that is not in the trash is a no-op that returns it as it is. A note deleted forever (Delete Forever in the MemNote app) cannot be restored: 410.","parameters":[{"schema":{"format":"uuid","type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","title","content","createdAt","updatedAt","changedAt","deletedAt","deletedVia","deletedBy","metadata","tags"],"properties":{"id":{"format":"uuid","type":"string"},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"content":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"changedAt":{"format":"date-time","type":"string"},"deletedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"deletedVia":{"anyOf":[{"description":"How a trashed note was deleted: `app` (a MemNote device), `mcp:<client name>` (an AI integration signed in with OAuth, e.g. `mcp:Claude`), or `api` (any other API caller). Null when the note is not in the trash, or was trashed before this was recorded.","type":"string"},{"type":"null"}]},"deletedBy":{"anyOf":[{"description":"Who deleted it: the device ID for `app`, the OAuth client ID for `mcp:*`. Null when unknown or not deleted.","type":"string"},{"type":"null"}]},"metadata":{"anyOf":[{"$ref":"#/components/schemas/NoteMetadata"},{"type":"null"}]},"tags":{"type":"array","items":{"$ref":"#/components/schemas/TagResponse"}}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"410":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}}}}},"/v1/notes/{id}/history":{"get":{"operationId":"getNoteHistory","summary":"Get note history","tags":["Notes"],"description":"Returns all archived versions of the note, newest first. A version is archived automatically on every PUT.","parameters":[{"schema":{"format":"uuid","type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","required":["id","noteId","title","content","tags","archivedAt","deletedAt"],"properties":{"id":{"format":"uuid","type":"string"},"noteId":{"format":"uuid","type":"string"},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"content":{"type":"string"},"tags":{"anyOf":[{"description":"Snapshot of tag names at archive time","type":"array","items":{"type":"string"}},{"type":"null"}]},"archivedAt":{"format":"date-time","type":"string"},"deletedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}}}}},"/v1/notes/{id}/tags/{tagId}":{"post":{"operationId":"addTagToNote","summary":"Add tag to note","tags":["Notes"],"parameters":[{"schema":{"format":"uuid","type":"string"},"in":"path","name":"id","required":true,"description":"Note ID"},{"schema":{"format":"uuid","type":"string"},"in":"path","name":"tagId","required":true,"description":"Tag ID"}],"responses":{"201":{"description":"Tag added"},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}}}},"delete":{"operationId":"removeTagFromNote","summary":"Remove tag from note","tags":["Notes"],"parameters":[{"schema":{"format":"uuid","type":"string"},"in":"path","name":"id","required":true,"description":"Note ID"},{"schema":{"format":"uuid","type":"string"},"in":"path","name":"tagId","required":true,"description":"Tag ID"}],"responses":{"204":{"description":"Tag removed"},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}}}}},"/v1/notes/search":{"get":{"operationId":"searchNotes","summary":"Search notes","tags":["Notes"],"description":"Semantic vector search across the authenticated user's notes. Returns notes ranked by cosine similarity to the query.","parameters":[{"schema":{"minLength":1,"type":"string"},"in":"query","name":"q","required":true,"description":"Natural language search query"},{"schema":{"minimum":1,"maximum":20,"default":10,"type":"integer"},"in":"query","name":"limit","required":false,"description":"Max results (1–20, default 10)"},{"schema":{"default":false,"type":"boolean"},"in":"query","name":"includeDeleted","required":false,"description":"Include soft-deleted notes (default false)"}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["results"],"properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/SearchResult"}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}}}}},"/v1/tags/":{"get":{"operationId":"listTags","summary":"List tags","tags":["Tags"],"description":"Returns all non-deleted tags for the authenticated user.","responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","required":["id","name","color","parentId","createdAt","updatedAt","deletedAt"],"properties":{"id":{"format":"uuid","type":"string"},"name":{"type":"string"},"color":{"anyOf":[{"minimum":0,"maximum":20,"description":"Color palette index (0-based, 0–20)","type":"integer"},{"type":"null"}]},"parentId":{"anyOf":[{"format":"uuid","description":"Parent tag ID for nested tags","type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"deletedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}}}},"post":{"operationId":"createTag","summary":"Create a tag","tags":["Tags"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"color":{"anyOf":[{"minimum":0,"maximum":20,"description":"Color palette index (0-based, 0–20)","type":"integer"},{"type":"null"}]},"parentId":{"anyOf":[{"format":"uuid","description":"Parent tag ID for nested tags","type":"string"},{"type":"null"}]}}}}}},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","name","color","parentId","createdAt","updatedAt","deletedAt"],"properties":{"id":{"format":"uuid","type":"string"},"name":{"type":"string"},"color":{"anyOf":[{"minimum":0,"maximum":20,"description":"Color palette index (0-based, 0–20)","type":"integer"},{"type":"null"}]},"parentId":{"anyOf":[{"format":"uuid","description":"Parent tag ID for nested tags","type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"deletedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}}}}},"/v1/tags/{id}":{"get":{"operationId":"getTag","summary":"Get a tag","tags":["Tags"],"parameters":[{"schema":{"format":"uuid","type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","name","color","parentId","createdAt","updatedAt","deletedAt"],"properties":{"id":{"format":"uuid","type":"string"},"name":{"type":"string"},"color":{"anyOf":[{"minimum":0,"maximum":20,"description":"Color palette index (0-based, 0–20)","type":"integer"},{"type":"null"}]},"parentId":{"anyOf":[{"format":"uuid","description":"Parent tag ID for nested tags","type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"deletedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}}}},"put":{"operationId":"updateTag","summary":"Update a tag","tags":["Tags"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"color":{"anyOf":[{"minimum":0,"maximum":20,"description":"Color palette index (0-based, 0–20)","type":"integer"},{"type":"null"}]},"parentId":{"anyOf":[{"format":"uuid","description":"Parent tag ID for nested tags","type":"string"},{"type":"null"}]}}}}}},"parameters":[{"schema":{"format":"uuid","type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","name","color","parentId","createdAt","updatedAt","deletedAt"],"properties":{"id":{"format":"uuid","type":"string"},"name":{"type":"string"},"color":{"anyOf":[{"minimum":0,"maximum":20,"description":"Color palette index (0-based, 0–20)","type":"integer"},{"type":"null"}]},"parentId":{"anyOf":[{"format":"uuid","description":"Parent tag ID for nested tags","type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"deletedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}}}},"delete":{"operationId":"deleteTag","summary":"Delete a tag","tags":["Tags"],"description":"Soft-deletes the tag by setting deletedAt. Existing note-tag associations are not removed.","parameters":[{"schema":{"format":"uuid","type":"string"},"in":"path","name":"id","required":true}],"responses":{"204":{"description":"Tag deleted"},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}}}}},"/v1/devices/":{"get":{"operationId":"listDevices","summary":"List devices","tags":["Devices"],"description":"Returns all non-deleted devices for the authenticated user.","responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","required":["id","name","platform","customName","color"],"properties":{"id":{"format":"uuid","type":"string"},"name":{"description":"System device name","type":"string"},"platform":{"description":"e.g. android, ios, web, windows, macos, linux","type":"string"},"customName":{"anyOf":[{"description":"User-assigned friendly name","type":"string"},{"type":"null"}]},"color":{"anyOf":[{"minimum":0,"maximum":20,"description":"Color palette index (0-based, 0–20)","type":"integer"},{"type":"null"}]}}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}}}},"post":{"operationId":"createDevice","summary":"Create a device","tags":["Devices"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","platform"],"properties":{"name":{"description":"System device name","type":"string"},"platform":{"description":"e.g. android, ios, web, windows, macos, linux","type":"string"},"customName":{"anyOf":[{"description":"User-assigned friendly name","type":"string"},{"type":"null"}]},"color":{"anyOf":[{"minimum":0,"maximum":20,"description":"Color palette index (0-based, 0–20)","type":"integer"},{"type":"null"}]}}}}}},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","name","platform","customName","color"],"properties":{"id":{"format":"uuid","type":"string"},"name":{"description":"System device name","type":"string"},"platform":{"description":"e.g. android, ios, web, windows, macos, linux","type":"string"},"customName":{"anyOf":[{"description":"User-assigned friendly name","type":"string"},{"type":"null"}]},"color":{"anyOf":[{"minimum":0,"maximum":20,"description":"Color palette index (0-based, 0–20)","type":"integer"},{"type":"null"}]}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}}}}},"/v1/devices/{id}":{"get":{"operationId":"getDevice","summary":"Get a device","tags":["Devices"],"parameters":[{"schema":{"format":"uuid","type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","name","platform","customName","color"],"properties":{"id":{"format":"uuid","type":"string"},"name":{"description":"System device name","type":"string"},"platform":{"description":"e.g. android, ios, web, windows, macos, linux","type":"string"},"customName":{"anyOf":[{"description":"User-assigned friendly name","type":"string"},{"type":"null"}]},"color":{"anyOf":[{"minimum":0,"maximum":20,"description":"Color palette index (0-based, 0–20)","type":"integer"},{"type":"null"}]}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}}}},"put":{"operationId":"updateDevice","summary":"Update a device","tags":["Devices"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"description":"System device name","type":"string"},"platform":{"description":"e.g. android, ios, web, windows, macos, linux","type":"string"},"customName":{"anyOf":[{"description":"User-assigned friendly name","type":"string"},{"type":"null"}]},"color":{"anyOf":[{"minimum":0,"maximum":20,"description":"Color palette index (0-based, 0–20)","type":"integer"},{"type":"null"}]}}}}}},"parameters":[{"schema":{"format":"uuid","type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","name","platform","customName","color"],"properties":{"id":{"format":"uuid","type":"string"},"name":{"description":"System device name","type":"string"},"platform":{"description":"e.g. android, ios, web, windows, macos, linux","type":"string"},"customName":{"anyOf":[{"description":"User-assigned friendly name","type":"string"},{"type":"null"}]},"color":{"anyOf":[{"minimum":0,"maximum":20,"description":"Color palette index (0-based, 0–20)","type":"integer"},{"type":"null"}]}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}}}}}},"servers":[{"url":"https://api.memnote.randomfact.com"},{"url":"https://memnote.randomfact.com"}],"security":[{"oauth2":["notes"]}]}