{"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","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"}]},"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"}}}}},"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":"Cursor from previous response nextPageToken"},{"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","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"}]},"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","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"}]},"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","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"}]},"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":"Soft-deletes the note by setting deletedAt. Syncs as deleted to connected devices.","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/{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"]}]}