Back to Karakeep

Update a list

docs/versioned_docs/version-v0.31.0/api/update-list.api.mdx

0.31.02.6 KB
Original Source

import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; import ParamsDetails from "@theme/ParamsDetails"; import RequestSchema from "@theme/RequestSchema"; import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; import Heading from "@theme/Heading";

<Heading as={"h1"} className={"openapi__heading"} children={"Update a list"}

</Heading>

<MethodEndpoint method={"patch"} path={"/lists/{listId}"} context={"endpoint"}

</MethodEndpoint>

Partially update a list. Only the fields provided in the request body will be updated.

<Heading id={"request"} as={"h2"} className={"openapi-tabs__heading"} children={"Request"}

</Heading>

<ParamsDetails parameters={[{"schema":{"type":"string","description":"The unique identifier of the list.","example":"ieidlxygmwj87oxz5hxttoc8","title":"ListId"},"required":true,"name":"listId","in":"path"}]}

</ParamsDetails>

<RequestSchema title={"Body"} body={{"description":"The fields to update. Only the fields you want to change need to be provided.","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"type":"string","nullable":true,"minLength":0,"maxLength":500},"icon":{"type":"string"},"parentId":{"type":"string","nullable":true},"query":{"type":"string","minLength":1},"public":{"type":"boolean"}}}}}}}

</RequestSchema>

<StatusCodes id={undefined} label={undefined} responses={{"200":{"description":"The updated list.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"icon":{"type":"string"},"parentId":{"type":"string","nullable":true},"type":{"type":"string","enum":["manual","smart"],"default":"manual"},"query":{"type":"string","nullable":true},"public":{"type":"boolean"},"hasCollaborators":{"type":"boolean"},"userRole":{"type":"string","enum":["owner","editor","viewer","public"]}},"required":["id","name","icon","parentId","public","hasCollaborators","userRole"],"title":"List"}}}},"401":{"description":"Unauthorized — the Bearer token is missing, invalid, or expired.","content":{"text/plain":{"schema":{"type":"string","example":"Unauthorized"}}}},"404":{"description":"List not found.","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","description":"A machine-readable error code."},"message":{"type":"string","description":"A human-readable error message."}},"required":["code","message"],"title":"Error"}}}}}}

</StatusCodes>