{"openapi":"3.0.0","components":{"examples":{},"headers":{},"parameters":{},"requestBodies":{},"responses":{},"schemas":{"SimpleUserProfile":{"properties":{"name":{"type":"string"},"userPath":{"type":"string"},"photo":{"type":"string"},"biography":{"type":"string","nullable":true}},"required":["name","userPath","photo","biography"],"type":"object","additionalProperties":false},"NotePublishType":{"enum":["edit","view","slide","book"],"type":"string"},"NotePermissionRole":{"enum":["owner","signed_in","guest"],"type":"string"},"Pick_FolderAttributes.id-or-name-or-icon-or-color-or-parentId-or-clientId_":{"properties":{"id":{"allOf":[{"type":"string"},{"properties":{"undefined":{"type":"boolean","enum":[true],"nullable":false}},"type":"object"}]},"name":{"type":"string"},"icon":{"allOf":[{"type":"string"},{"properties":{"undefined":{"type":"boolean","enum":[true],"nullable":false}},"type":"object"}]},"color":{"allOf":[{"type":"string"},{"properties":{"undefined":{"type":"boolean","enum":[true],"nullable":false}},"type":"object"}]},"parentId":{"allOf":[{"type":"string"},{"properties":{"undefined":{"type":"boolean","enum":[true],"nullable":false}},"type":"object"}]},"clientId":{"type":"string"}},"required":["id","name","icon","color","parentId","clientId"],"type":"object","description":"From T, pick a set of properties whose keys are in the union K"},"FolderPath":{"$ref":"#/components/schemas/Pick_FolderAttributes.id-or-name-or-icon-or-color-or-parentId-or-clientId_"},"NoteType":{"properties":{"folderPaths":{"items":{"$ref":"#/components/schemas/FolderPath"},"type":"array"},"writePermission":{"$ref":"#/components/schemas/NotePermissionRole"},"readPermission":{"$ref":"#/components/schemas/NotePermissionRole"},"shortId":{"type":"string"},"publishLink":{"type":"string"},"permalink":{"type":"string","nullable":true},"teamPath":{"type":"string","nullable":true},"userPath":{"type":"string","nullable":true},"publishedAt":{"type":"number","format":"double","nullable":true},"publishType":{"$ref":"#/components/schemas/NotePublishType"},"lastChangeUser":{"allOf":[{"$ref":"#/components/schemas/SimpleUserProfile"}],"nullable":true},"tagsUpdatedAt":{"type":"number","format":"double","nullable":true},"titleUpdatedAt":{"type":"number","format":"double","nullable":true},"createdAt":{"type":"number","format":"double"},"lastChangedAt":{"type":"number","format":"double"},"description":{"type":"string"},"tags":{"items":{"type":"string"},"type":"array"},"title":{"type":"string"},"id":{"type":"string"}},"required":["writePermission","readPermission","shortId","publishLink","permalink","teamPath","userPath","publishedAt","publishType","lastChangeUser","tagsUpdatedAt","titleUpdatedAt","createdAt","lastChangedAt","description","tags","title","id"],"type":"object"},"CommentPermissionType":{"enum":["disabled","forbidden","owners","signed_in_users","everyone"],"type":"string"},"SuggestEditPermissionType":{"enum":["disabled","forbidden","owners","signed_in_users"],"type":"string"},"Partial_NoteFeatureValidPermissionRecordType_":{"properties":{},"type":"object","description":"Make all properties in T optional"},"TeamVisibilityType":{"enum":["public","private"],"type":"string"},"Team":{"properties":{"id":{"type":"string"},"ownerId":{"type":"string"},"name":{"type":"string"},"logo":{"type":"string"},"path":{"type":"string"},"description":{"type":"string","nullable":true},"visibility":{"$ref":"#/components/schemas/TeamVisibilityType"},"upgraded":{"type":"boolean"},"createdAt":{"type":"number","format":"double"}},"required":["id","ownerId","name","logo","path","description","visibility","upgraded","createdAt"],"type":"object","additionalProperties":false},"NoteImageUploadResponse":{"properties":{"data":{"properties":{"link":{"type":"string"}},"required":["link"],"type":"object"}},"required":["data"],"type":"object","additionalProperties":false},"User":{"properties":{"id":{"type":"string"},"email":{"type":"string","nullable":true},"name":{"type":"string"},"userPath":{"type":"string"},"photo":{"type":"string"},"teams":{"items":{"$ref":"#/components/schemas/Team"},"type":"array"},"Teams":{"items":{"$ref":"#/components/schemas/Team"},"type":"array"},"upgraded":{"type":"boolean"}},"required":["id","email","name","userPath","photo","teams","upgraded"],"type":"object","additionalProperties":false}},"securitySchemes":{"token":{"type":"apiKey","name":"Authorization","in":"header"}}},"info":{"title":"HackMD OpenAPI","version":"1.0.0","description":"HackMD OpenAPI","license":{"name":"UNLICENSED"},"contact":{"name":"HackMD Team","email":"support@hackmd.io"}},"paths":{"/notes":{"get":{"operationId":"ListNotes","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/NoteType"},"type":"array"}}}}},"description":"List all notes for the current user","tags":["User Notes"],"security":[{"token":[]}],"parameters":[]},"post":{"operationId":"CreateNote","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{}}}}},"description":"Create a new note for the current user","tags":["User Notes"],"security":[{"token":[]}],"parameters":[],"requestBody":{"description":"The note content or a JSON object with note properties.","required":false,"content":{"application/json":{"schema":{"anyOf":[{"properties":{"origin":{"type":"string"},"parentFolderId":{"type":"string"},"permalink":{"type":"string"},"noteFeatures":{"$ref":"#/components/schemas/Partial_NoteFeatureValidPermissionRecordType_"},"suggestEditPermission":{"$ref":"#/components/schemas/SuggestEditPermissionType"},"commentPermission":{"$ref":"#/components/schemas/CommentPermissionType"},"writePermission":{"$ref":"#/components/schemas/NotePermissionRole"},"readPermission":{"$ref":"#/components/schemas/NotePermissionRole"},"content":{"type":"string"},"description":{"type":"string"},"tags":{"items":{"type":"string"},"type":"array"},"title":{"type":"string"}},"type":"object"},{"type":"string"}],"description":"The note content or a JSON object with note properties."}}}}}},"/notes/{noteId}":{"get":{"operationId":"GetNote","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{}}}}},"description":"Get a single note for the current user (or team note if accessible)","tags":["User Notes"],"security":[{"token":[]}],"parameters":[{"description":"The ID of the note to retrieve.","in":"path","name":"noteId","required":true,"schema":{"type":"string"}}]},"delete":{"operationId":"DeleteNote","responses":{"204":{"description":"No content"}},"description":"Delete a note for the current user","tags":["User Notes"],"security":[{"token":[]}],"parameters":[{"description":"The ID of the note to delete.","in":"path","name":"noteId","required":true,"schema":{"type":"string"}}]},"patch":{"operationId":"UpdateNote","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{}}}}},"description":"Update a note's content or permissions for the current user","tags":["User Notes"],"security":[{"token":[]}],"parameters":[],"requestBody":{"description":"The properties to update on the note.","required":true,"content":{"application/json":{"schema":{"properties":{"parentFolderId":{"type":"string"},"permalink":{"type":"string"},"writePermission":{"$ref":"#/components/schemas/NotePermissionRole"},"readPermission":{"$ref":"#/components/schemas/NotePermissionRole"},"content":{"type":"string"},"description":{"type":"string"},"tags":{"items":{"type":"string"},"type":"array"},"title":{"type":"string"}},"type":"object","description":"The properties to update on the note."}}}}}},"/teams":{"get":{"operationId":"ListTeams","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Team"},"type":"array"}}}}},"description":"List the teams for the current user","tags":["Teams"],"security":[{"token":[]}],"parameters":[]}},"/teams/{teampath}/notes":{"get":{"operationId":"ListTeamNotes","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/NoteType"},"type":"array"}}}}},"description":"List all notes for a team","tags":["Team Notes"],"security":[{"token":[]}],"parameters":[{"description":"The path identifier for the team.","in":"path","name":"teampath","required":true,"schema":{"type":"string"}}]},"post":{"operationId":"CreateTeamNote","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{}}}}},"description":"Create a new note for a team","tags":["Team Notes"],"security":[{"token":[]}],"parameters":[{"description":"The path identifier for the team.","in":"path","name":"teampath","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"The note content (string) or a JSON object with note properties (title, content, permissions, etc.).","required":false,"content":{"application/json":{"schema":{"anyOf":[{"properties":{"origin":{"type":"string"},"parentFolderId":{"type":"string"},"permalink":{"type":"string"},"noteFeatures":{"$ref":"#/components/schemas/Partial_NoteFeatureValidPermissionRecordType_"},"suggestEditPermission":{"$ref":"#/components/schemas/SuggestEditPermissionType"},"commentPermission":{"$ref":"#/components/schemas/CommentPermissionType"},"writePermission":{"$ref":"#/components/schemas/NotePermissionRole"},"readPermission":{"$ref":"#/components/schemas/NotePermissionRole"},"content":{"type":"string"},"description":{"type":"string"},"tags":{"items":{"type":"string"},"type":"array"},"title":{"type":"string"}},"type":"object"},{"type":"string"}],"description":"The note content (string) or a JSON object with note properties (title, content, permissions, etc.)."}}}}}},"/teams/{teampath}/notes/{noteId}":{"get":{"operationId":"GetTeamNote","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{}}}}},"description":"Get a single note for a team\nThe `teampath` is implicitly taken from the route.\nThe `noteId` is implicitly taken from the route and processed by `parseNoteIdMiddleware`.","tags":["Team Notes"],"security":[{"token":[]}],"parameters":[]},"patch":{"operationId":"UpdateTeamNote","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{}}}}},"description":"Update a team note","tags":["Team Notes"],"security":[{"token":[]}],"parameters":[],"requestBody":{"description":"The properties to update on the team note (e.g., content, permissions, permalink, parentFolderId).\nThe `teampath` and `noteId` are implicitly taken from the route.","required":true,"content":{"application/json":{"schema":{"description":"The properties to update on the team note (e.g., content, permissions, permalink, parentFolderId).\nThe `teampath` and `noteId` are implicitly taken from the route."}}}}},"delete":{"operationId":"DeleteTeamNote","responses":{"204":{"description":"No content"}},"description":"Delete a team note","tags":["Team Notes"],"security":[{"token":[]}],"parameters":[{"description":"The path identifier for the team.\nThe `noteId` is implicitly taken from the route and processed by `parseNoteIdMiddleware`.","in":"path","name":"teampath","required":true,"schema":{"type":"string"}}]}},"/notes/{noteId}/images":{"post":{"operationId":"UploadNoteImage","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NoteImageUploadResponse"}}}}},"description":"Upload an image for a note.","tags":["User Notes"],"security":[{"token":[]}],"parameters":[{"in":"path","name":"noteId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"image":{"type":"string","format":"binary"}}}}}}}},"/me":{"get":{"operationId":"GetCurrentUser","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}}},"description":"Get the current user's profile","tags":["Profile"],"security":[{"token":[]}],"parameters":[]}},"/history":{"get":{"operationId":"GetHistory","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"items":{},"type":"array"}}}}},"description":"Get note history for the current user","tags":["History"],"security":[{"token":[]}],"parameters":[{"description":"The maximum number of history items to return.","in":"query","name":"limit","required":false,"schema":{"format":"double","type":"number"}}]}}},"servers":[{"url":"/v1","description":"API Server"}],"tags":[{"name":"Profile","description":"Operations to retrieve user profile information."},{"name":"Teams","description":"Operations related to user teams."},{"name":"History","description":"Operations related to user's note history."},{"name":"Team Notes","description":"Operations related to notes within a team."},{"name":"User Notes","description":"Operations related to a user's personal notes."}]}