--- title: Team Notes API description: tags: developer portal --- {%hackmd bXqUSiOGTLuFjPgSJ74wxQ %} # Team Notes API [toc] ## Get a list of notes in a Team's workspace - `GET /teams/:teamPath/notes` - URL Params - teamPath: string - Success Response - code: `200` - body: ```json [ { "id": "0jJVr2b3T2eSkBnMib-inA", "title": "Team notes", "tags": [], "createdAt": 1644371283239, "publishType": "view", "publishedAt": 1644371283239, "permalink": null, "shortId": "SysUa9xJc", "lastChangedAt": 1644461300662, "lastChangeUser": null, "userPath": null, "teamPath": "CAT", "readPermission": "guest", "writePermission": "signed_in", "publishLink": "https://hackmd.io/@username/permalink" } ] ``` :::info :bulb: Please use API of "Get a note" `GET /notes/:noteId` to retrieve the note content. ::: ## Create a note in a Team workspace - `POST /teams/:teamPath/notes` - URL Params - teamPath: string - Data Params - body (optional)[application/json] ```script=json { "title": "New note", "content": "", "readPermission": "owner", "writePermission": "owner", "commentPermission": "everyone" } ``` | field | type | values | | ----------------- | ------ |:---------------------------------------------------------------- | | title | string | | | content | string | | | readPermission | string | `owner`, `sign_in`, `guest` | | writePermission | string | `owner`, `sign_in`, `guest` | | contentPermission | string | `disabled`, `forbidden`, `owners`, `signed_in_users`, `everyone` | | permalink | string | | - Success Response - code: 201 - body ```json { "id": "CNf4ZHB-RW-U-ZpR2LRiYA", "title": "New team note", "tags": null, "createdAt": 1644462537700, "publishType": "view", "publishedAt": null, "permalink": null, "shortId": "r1GCZbzy9", "lastChangedAt": 1644462537700, "lastChangeUser": { "name": "Ming-Hsiu Tsai", "photo": "https://avatars.githubusercontent.com/u/26138990?s=96", "biography": null, "userPath": "AMQ36J15QgCZf46ThEFadg" }, "userPath": null, "teamPath": "CAT", "readPermission": "owner", "writePermission": "owner", "publishLink": "https://hackmd.io/@username/permalink" } ``` ## Update a note in a Team's workspace - `Patch /teams/:teamPath/notes/:noteId` - URL Params: - teamPath: string - nodeId: string - Data Params: - body (optional) [application/json] ```script=json { "content": "# Updated a team note", "readPermission": "signed_in", "permalink": "note-permalink" } ``` | field | type | values | | --------------- | ------ |:----------------------------- | | content | string | | | readPermission | string | `owner`, `signed_in`, `guest` | | writePermission | string | `owner`, `signed_in`, `guest` | | permalink | string | | - Success Response - code: `202` - body: Accepted ## Delete a note in a Team's workspace - `DELETE /teams/:teamPath/notes/:noteId` - URL Params: - teamPath: string - nodeId: string - Success Response - code: `204`