---
title: "Replace User by ID"
method: PUT
path: "/users/{id}"
tags: ["Users"]
---

# Replace User by ID

`PUT /users/{id}`

Replace a user by ID (full update)

## Path parameters

- `id` string, objectid, required — The ID of the item to update

## Request body

- ReplaceUserByIdInput
  - `data` ModelsUser, required — The data to update
    - `_id` string, objectid — ID
    - `created_at` string, date-time — Created timestamp
    - `created_by` string, objectid — Created by
    - `email` string — Email
    - `first_name` string — First name
    - `last_name` string — Last name
    - `role` string — Role
    - `role_id` string, objectid — Role ID
    - `root_admin` boolean — Root admin
    - `root_admin_role` boolean
    - `routes` string[]
    - `updated_at` string, date-time — Updated timestamp
    - `updated_by` string, objectid — Updated by
    - `username` string — Username

## Response `200`

OK

- ControllersResponseGithubModelsUser
  - `data` ModelsUser — The data to update
    - `_id` string, objectid — ID
    - `created_at` string, date-time — Created timestamp
    - `created_by` string, objectid — Created by
    - `email` string — Email
    - `first_name` string — First name
    - `last_name` string — Last name
    - `role` string — Role
    - `role_id` string, objectid — Role ID
    - `root_admin` boolean — Root admin
    - `root_admin_role` boolean
    - `routes` string[]
    - `updated_at` string, date-time — Updated timestamp
    - `updated_by` string, objectid — Updated by
    - `username` string — Username
  - `error` string
  - `message` string
  - `status` string

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `500` — Internal Server Error

## Changes

- **2026-07-17** `c7a4715c1f13` — 3 breaking, 11 warning, 12 info
  - added the new required request property `data`
  - for the `path` request parameter `id`, the type/format was changed from `string`/`` to `string`/`objectid`
  - the response's body type/format changed from ``/`` to `object`/`` for status `200`
  - removed the request property `_id`
  - …22 more
- **2025-03-03** `14e4eafea538` — 1 breaking, 3 warning, 1 info
  - the response's body type/format changed from `object`/`` to ``/`` for status `200`
  - removed the optional property `code` from the response with the `200` status
  - removed the optional property `data` from the response with the `200` status
  - removed the optional property `message` from the response with the `200` status
  - …1 more
- **2025-03-02** `526e5bdf6dee` — 2 breaking, 17 warning, 18 info
  - request body became required
  - added the pattern `^[0-9a-fA-F]{24}$` to the `path` request parameter `id`
  - removed the request property `data`
  - removed the optional property `data/_id` from the response with the `200` status
  - …33 more

[Change history](https://skmtc.dev/crawlab-team/apis/crawlab-api/changes/users/:id/put.md)

---

[API](https://skmtc.dev/crawlab-team/apis/crawlab-api.md) · [All operations](https://skmtc.dev/crawlab-team/apis/crawlab-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/crawlab-team/crawlab-api/revisions/c7a4715c1f13/schema)
