{"openapi":"3.1.0","info":{"contact":{"email":"hi@hedia.com","name":"Hedia ApS","url":"https://hedia.com"},"termsOfService":"https://www.hedia.com/terms-and-conditions","title":"Note Service API","version":"1.0.0"},"servers":[{"url":"https://note.hedia.com/api/v1"}],"tags":[{"name":"Notes","description":"Manage notes","externalDocs":{"url":"https://developer.hedia.com/services/note/api/v1/operations#notes","description":"Documentation"}}],"paths":{"/notes":{"get":{"summary":"List notes","description":"List user notes created by the current application.","operationId":"listNotes","parameters":[{"$ref":"#/components/parameters/LimitQueryParameter"},{"$ref":"#/components/parameters/OrderQueryParameter"},{"$ref":"#/components/parameters/SkipQueryParameter"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NoteList"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"default":{"$ref":"#/components/responses/InternalServerError"}},"security":[{"accessToken":[]}],"tags":["Notes"],"externalDocs":{"url":"https://developer.hedia.com/services/note/api/v1/operations/listNotes","description":"Documentation"}},"post":{"summary":"Create note","description":"Creates a note for a user.","operationId":"createNote","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateNoteRequestBody"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Note"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"default":{"$ref":"#/components/responses/InternalServerError"}},"security":[{"accessToken":[]}],"tags":["Notes"],"externalDocs":{"url":"https://developer.hedia.com/services/note/api/v1/operations/createNote","description":"Documentation"}}},"/notes/{noteId}":{"delete":{"summary":"Delete note","description":"Deletes a user note created by the current application.","operationId":"deleteNote","parameters":[{"$ref":"#/components/parameters/NoteIdPathParameter"}],"responses":{"204":{"$ref":"#/components/responses/NoContent"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"default":{"$ref":"#/components/responses/InternalServerError"}},"security":[{"accessToken":[]}],"tags":["Notes"],"externalDocs":{"url":"https://developer.hedia.com/services/note/api/v1/operations/deleteNote","description":"Documentation"}},"get":{"summary":"Get note","description":"Gets a user note created by the current application.","operationId":"getNote","parameters":[{"$ref":"#/components/parameters/NoteIdPathParameter"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Note"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"default":{"$ref":"#/components/responses/InternalServerError"}},"security":[{"accessToken":[]}],"tags":["Notes"],"externalDocs":{"url":"https://developer.hedia.com/services/note/api/v1/operations/getNote","description":"Documentation"}},"patch":{"summary":"Update note","description":"Updates a user note created by the current application.","operationId":"updateNote","parameters":[{"$ref":"#/components/parameters/NoteIdPathParameter"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateNoteRequestBody"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Note"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"default":{"$ref":"#/components/responses/InternalServerError"}},"security":[{"accessToken":[]}],"tags":["Notes"],"externalDocs":{"url":"https://developer.hedia.com/services/note/api/v1/operations/updateNote","description":"Documentation"}}}},"components":{"securitySchemes":{"accessToken":{"description":"An OAuth2 Access Token.","type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"Limit":{"title":"Limit","type":"number","maximum":100,"minimum":1,"default":10,"$id":"./components/schemas/Limit","externalDocs":{"url":"https://developer.hedia.com/services/note/api/v1/components/schemas/Limit","description":"Documentation"}},"Order":{"title":"Order","type":"string","enum":["asc","desc"],"default":"asc","$id":"./components/schemas/Order","externalDocs":{"url":"https://developer.hedia.com/services/note/api/v1/components/schemas/Order","description":"Documentation"}},"Skip":{"title":"Skip","type":"number","minimum":0,"default":0,"$id":"./components/schemas/Skip","externalDocs":{"url":"https://developer.hedia.com/services/note/api/v1/components/schemas/Skip","description":"Documentation"}},"ProblemDetails":{"title":"Problem Details","description":"A problem details object provides additional information about a problem that occurred during an API request.","type":"object","properties":{"type":{"type":"string","description":"A URI reference that identifies the problem type.","examples":["/problems/unauthorized","about:blank"]},"title":{"type":"string","description":"A short, human-readable summary of the problem type.","examples":["Unauthorized"]},"status":{"type":"number","description":"The HTTP status code generated by the origin server for this occurrence of the problem.","examples":[401]},"detail":{"type":"string","description":"A human-readable explanation specific to this occurrence of the problem.","examples":["You must authenticate and provide the necessary permissions to access this resource. Please check your credentials or token."]}},"required":["type"],"$id":"./components/schemas/ProblemDetails","externalDocs":{"url":"https://developer.hedia.com/services/note/api/v1/components/schemas/ProblemDetails","description":"Documentation"}},"NoteId":{"title":"Note ID","type":"string","format":"uuid","examples":["3f483b7c-ae82-44ac-94f1-0820861fef29"],"$id":"./components/schemas/NoteId","externalDocs":{"url":"https://developer.hedia.com/services/note/api/v1/components/schemas/NoteId","description":"Documentation"}},"AppId":{"title":"App ID","type":"string","format":"uuid","examples":["3f483b7c-ae82-44ac-94f1-0820861fef29"],"$id":"./components/schemas/AppId","externalDocs":{"url":"https://developer.hedia.com/services/note/api/v1/components/schemas/AppId","description":"Documentation"}},"UserId":{"title":"User ID","type":"string","format":"uuid","examples":["3f483b7c-ae82-44ac-94f1-0820861fef29"],"$id":"./components/schemas/UserId","externalDocs":{"url":"https://developer.hedia.com/services/note/api/v1/components/schemas/UserId","description":"Documentation"}},"AssetId":{"title":"Asset ID","type":"string","format":"uuid","examples":["cf0102d1-3d48-4467-9887-da4d390267c6"],"$id":"./components/schemas/AssetId","externalDocs":{"url":"https://developer.hedia.com/services/note/api/v1/components/schemas/AssetId","description":"Documentation"}},"AssetIds":{"title":"Asset IDs","description":"Each asset must already exist in the asset service and must have been uploaded by the current application for this user.","type":"array","items":{"$ref":"#/components/schemas/AssetId"},"minItems":0,"maxItems":1,"uniqueItems":true,"$id":"./components/schemas/AssetIds","externalDocs":{"url":"https://developer.hedia.com/services/note/api/v1/components/schemas/AssetIds","description":"Documentation"}},"NoteBody":{"title":"Note Body","type":"string","minLength":0,"maxLength":1024,"examples":["This is a note body example."],"$id":"./components/schemas/NoteBody","externalDocs":{"url":"https://developer.hedia.com/services/note/api/v1/components/schemas/NoteBody","description":"Documentation"}},"Date":{"title":"Date","type":"string","format":"date-time","examples":["2023-10-05T14:48:00.000Z"],"$id":"./components/schemas/Date","externalDocs":{"url":"https://developer.hedia.com/services/note/api/v1/components/schemas/Date","description":"Documentation"}},"SecurityPrincipalId":{"title":"Security Principal Id","anyOf":[{"$ref":"#/components/schemas/AppId"},{"$ref":"#/components/schemas/UserId"}],"$id":"./components/schemas/SecurityPrincipalId","externalDocs":{"url":"https://developer.hedia.com/services/note/api/v1/components/schemas/SecurityPrincipalId","description":"Documentation"}},"SecurityPrincipalType":{"title":"Security Principal Type","type":"string","enum":["app","system","user"],"$id":"./components/schemas/SecurityPrincipalType","externalDocs":{"url":"https://developer.hedia.com/services/note/api/v1/components/schemas/SecurityPrincipalType","description":"Documentation"}},"SecurityPrincipal":{"title":"Security Principal","type":"object","properties":{"id":{"$ref":"#/components/schemas/SecurityPrincipalId"},"type":{"$ref":"#/components/schemas/SecurityPrincipalType"}},"required":["id","type"],"additionalProperties":false,"$id":"./components/schemas/SecurityPrincipal","externalDocs":{"url":"https://developer.hedia.com/services/note/api/v1/components/schemas/SecurityPrincipal","description":"Documentation"}},"Created":{"title":"Created","description":"Information about the creation of an entity.","type":"object","properties":{"at":{"$ref":"#/components/schemas/Date"},"by":{"$ref":"#/components/schemas/SecurityPrincipal"}},"required":["at","by"],"additionalProperties":false,"$id":"./components/schemas/Created","externalDocs":{"url":"https://developer.hedia.com/services/note/api/v1/components/schemas/Created","description":"Documentation"}},"Updated":{"title":"Updated","description":"Information about the update of an entity.","type":"object","properties":{"at":{"$ref":"#/components/schemas/Date"},"by":{"$ref":"#/components/schemas/SecurityPrincipal"}},"required":["at","by"],"additionalProperties":false,"$id":"./components/schemas/Updated","externalDocs":{"url":"https://developer.hedia.com/services/note/api/v1/components/schemas/Updated","description":"Documentation"}},"Note":{"title":"Note","type":"object","properties":{"id":{"$ref":"#/components/schemas/NoteId"},"appId":{"$ref":"#/components/schemas/AppId"},"userId":{"$ref":"#/components/schemas/UserId"},"assetIds":{"$ref":"#/components/schemas/AssetIds"},"body":{"$ref":"#/components/schemas/NoteBody"},"created":{"$ref":"#/components/schemas/Created"},"updated":{"$ref":"#/components/schemas/Updated"}},"required":["id","appId","userId","assetIds","body","created"],"additionalProperties":false,"$id":"./components/schemas/Note","externalDocs":{"url":"https://developer.hedia.com/services/note/api/v1/components/schemas/Note","description":"Documentation"}},"NoteList":{"title":"Note List","description":"List of notes","type":"array","items":{"$ref":"#/components/schemas/Note"},"$id":"./components/schemas/NoteList","externalDocs":{"url":"https://developer.hedia.com/services/note/api/v1/components/schemas/NoteList","description":"Documentation"}},"CreateNoteRequestBody":{"title":"Create Note Request Body","type":"object","properties":{"assetIds":{"$ref":"#/components/schemas/AssetIds"},"body":{"$ref":"#/components/schemas/NoteBody"}},"additionalProperties":false,"$id":"./components/schemas/CreateNoteRequestBody","externalDocs":{"url":"https://developer.hedia.com/services/note/api/v1/components/schemas/CreateNoteRequestBody","description":"Documentation"}},"UpdateNoteRequestBody":{"title":"Update Note Request Body","type":"object","properties":{"assetIds":{"$ref":"#/components/schemas/AssetIds"},"body":{"$ref":"#/components/schemas/NoteBody"}},"additionalProperties":false,"$id":"./components/schemas/UpdateNoteRequestBody","externalDocs":{"url":"https://developer.hedia.com/services/note/api/v1/components/schemas/UpdateNoteRequestBody","description":"Documentation"}}},"parameters":{"LimitQueryParameter":{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit"}},"OrderQueryParameter":{"name":"order","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Order"}},"SkipQueryParameter":{"name":"skip","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Skip"}},"NoteIdPathParameter":{"name":"noteId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/NoteId"}}},"responses":{"InternalServerError":{"description":"Internal Server Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"BadRequest":{"description":"Bad Request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"Unauthorized":{"description":"Unauthorized","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"UnprocessableEntity":{"description":"Unprocessable Entity","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"NotFound":{"description":"Not Found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"NoContent":{"description":"No Content"}}},"externalDocs":{"url":"https://developer.hedia.com/","description":"Documentation"}}