docs/versioned_docs/version-v0.31.0/api/admin-update-user.api.mdx
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 user (admin)"}
</Heading>
<MethodEndpoint method={"put"} path={"/admin/users/{userId}"} context={"endpoint"}
</MethodEndpoint>
Update a user's role, bookmark quota, storage quota, or browser crawling setting. Requires admin role. You cannot update your own user account via this endpoint.
<Heading id={"request"} as={"h2"} className={"openapi-tabs__heading"} children={"Request"}
</Heading>
<ParamsDetails parameters={[{"schema":{"type":"string","description":"The ID of the user to update.","example":"user_123"},"required":true,"name":"userId","in":"path"}]}
</ParamsDetails>
<RequestSchema title={"Body"} body={{"description":"The fields to update. All fields are optional — only provided fields will be changed.","content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string","enum":["user","admin"]},"bookmarkQuota":{"type":"integer","nullable":true,"minimum":0},"storageQuota":{"type":"integer","nullable":true,"minimum":0},"browserCrawlingEnabled":{"type":"boolean","nullable":true}},"description":"User update data","example":{"role":"admin","bookmarkQuota":1000,"storageQuota":5000000000}}}}}}
</RequestSchema>
<StatusCodes id={undefined} label={undefined} responses={{"200":{"description":"User updated successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the update was successful."}},"required":["success"]}}}},"400":{"description":"Bad request — invalid input data or attempted to update own user.","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"}}}},"401":{"description":"Unauthorized — the Bearer token is missing, invalid, or expired.","content":{"text/plain":{"schema":{"type":"string","example":"Unauthorized"}}}},"403":{"description":"Forbidden — admin access required.","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"}}}},"404":{"description":"User 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>