---
updatedAt: 2026-04-21T13:55:31.000Z
agentTools:
  projectIndex: https://developer.operations1.com/llms.txt
---

# Update a user

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Operations1 REST API",
    "description": "Operations1 REST API documentation",
    "version": "2025-04-21"
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "paths": {
    "/tenants/{tenantId}/users/{userId}": {
      "patch": {
        "operationId": "updateUser",
        "summary": "Update a user",
        "tags": [
          "User"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "password": {
                    "type": "string",
                    "minLength": 8,
                    "maxLength": 255
                  },
                  "externalId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "firstName": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "lastName": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "email": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[a-zA-Z0-9.!#$%&'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$",
                        "examples": [
                          "john@doe.com"
                        ],
                        "minLength": 1,
                        "maxLength": 320
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "status": {
                    "enum": [
                      "active",
                      "archived",
                      "anonymized"
                    ],
                    "type": "string"
                  },
                  "defaultLocale": {
                    "anyOf": [
                      {
                        "enum": [
                          "ar",
                          "bg",
                          "bs",
                          "cs",
                          "da",
                          "de",
                          "el",
                          "en",
                          "es",
                          "et",
                          "fi",
                          "fo",
                          "fr",
                          "hi",
                          "hr",
                          "hu",
                          "id",
                          "is",
                          "it",
                          "ja",
                          "ka",
                          "lo",
                          "lt",
                          "mn",
                          "ms",
                          "mt",
                          "nl",
                          "nn",
                          "pl",
                          "pt",
                          "ro",
                          "ru",
                          "sk",
                          "sl",
                          "sq",
                          "sr",
                          "sv",
                          "ta",
                          "th",
                          "tr",
                          "uk",
                          "vi",
                          "zh"
                        ],
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "job": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "classFilter": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 9007199254740991
            },
            "in": "path",
            "name": "userId",
            "required": true
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            },
            "in": "path",
            "name": "tenantId",
            "required": true,
            "description": "Consists of the subdomain. The `tenantId` for `https://company.operations1.app/` is `company`."
          },
          {
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "examples": [
                    "2025-04-21",
                    "unstable"
                  ],
                  "format": "date",
                  "description": "Specifies the API version in date format (e.g., \"2024-01-01\"). Allowed values include 2025-04-21"
                },
                {
                  "type": "string",
                  "examples": [
                    "latest"
                  ],
                  "description": "Indicates the most recent stable API version.",
                  "enum": [
                    "latest"
                  ]
                },
                {
                  "type": "string",
                  "examples": [
                    "unstable"
                  ],
                  "description": "Indicates the unstable API version.",
                  "enum": [
                    "unstable"
                  ]
                }
              ]
            },
            "examples": {
              "2025-04-21": {
                "value": "2025-04-21"
              },
              "unstable": {
                "value": "unstable"
              }
            },
            "in": "header",
            "name": "accept-version",
            "required": true,
            "description": "Defines the API version. Using a date is recommended for stability. Avoid using `latest` in production, as it refers to the most up-to-date functionality, which may include breaking changes. For more details, see our article on [versioning](https://developer.operations1.com/reference/versioning)."
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "status",
                    "externalId",
                    "displayName",
                    "firstName",
                    "lastName",
                    "email",
                    "job",
                    "defaultLocale",
                    "role",
                    "updatedAt",
                    "isManageable"
                  ],
                  "properties": {
                    "id": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 9007199254740991
                    },
                    "name": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 255
                    },
                    "status": {
                      "enum": [
                        "active",
                        "archived",
                        "anonymized"
                      ],
                      "type": "string"
                    },
                    "externalId": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "displayName": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "firstName": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "lastName": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "email": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "job": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "defaultLocale": {
                      "anyOf": [
                        {
                          "enum": [
                            "ar",
                            "bg",
                            "bs",
                            "cs",
                            "da",
                            "de",
                            "el",
                            "en",
                            "es",
                            "et",
                            "fi",
                            "fo",
                            "fr",
                            "hi",
                            "hr",
                            "hu",
                            "id",
                            "is",
                            "it",
                            "ja",
                            "ka",
                            "lo",
                            "lt",
                            "mn",
                            "ms",
                            "mt",
                            "nl",
                            "nn",
                            "pl",
                            "pt",
                            "ro",
                            "ru",
                            "sk",
                            "sl",
                            "sq",
                            "sr",
                            "sv",
                            "ta",
                            "th",
                            "tr",
                            "uk",
                            "vi",
                            "zh"
                          ],
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "role": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "name"
                          ],
                          "properties": {
                            "id": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 9007199254740991
                            },
                            "name": {
                              "type": "string"
                            }
                          }
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "updatedAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "isManageable": {
                      "type": "boolean",
                      "description": "Whether the requesting user may edit this user: the user is the requester themself, or the user's role holds no permissions the requester's role does not have."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "This error ist returned if authentication of the request was not successful. For more information read our article about [authentication](https://developer.operations1.com/reference/authentication).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "message",
                    "errorCode"
                  ],
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    },
                    "errorCode": {
                      "type": "string",
                      "enum": [
                        "UNAUTHENTICATED"
                      ]
                    }
                  },
                  "description": "This error ist returned if authentication of the request was not successful. For more information read our article about [authentication](https://developer.operations1.com/reference/authentication)."
                }
              }
            }
          },
          "403": {
            "description": "This error is returned if you do not have the necessary permissions for the endpoint, or if the user holds permissions your own role does not have.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "message",
                    "errorCode"
                  ],
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    },
                    "errorCode": {
                      "enum": [
                        "ACCESS_FORBIDDEN",
                        "USER_NOT_MANAGEABLE"
                      ],
                      "type": "string"
                    }
                  },
                  "description": "This error is returned if you do not have the necessary permissions for the endpoint, or if the user holds permissions your own role does not have."
                }
              }
            }
          },
          "429": {
            "description": "This error is returned if your request was not executed due to rate limit. For more information read our article about [rate limiting](https://developer.operations1.com/reference/rate-limiting).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "message",
                    "errorCode"
                  ],
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    },
                    "errorCode": {
                      "type": "string",
                      "enum": [
                        "TOO_MANY_REQUESTS"
                      ]
                    }
                  },
                  "description": "This error is returned if your request was not executed due to rate limit. For more information read our article about [rate limiting](https://developer.operations1.com/reference/rate-limiting)."
                }
              }
            }
          },
          "default": {
            "description": "General errors",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "message",
                    "errorCode"
                  ],
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    },
                    "errorCode": {
                      "enum": [
                        "SERVER_ERROR",
                        "ROUTE_NOT_FOUND",
                        "NOT_FOUND",
                        "API_VERSION_NOT_SET",
                        "TOO_MANY_REQUESTS",
                        "UNAUTHENTICATED",
                        "ACCESS_FORBIDDEN",
                        "VALIDATION_ERR",
                        "INVALID_TENANT",
                        "MALFORMED_AUTHORIZATION_HEADER",
                        "BAD_REQUEST"
                      ],
                      "type": "string",
                      "description": "Error code"
                    }
                  },
                  "description": "General errors"
                }
              }
            }
          }
        }
      }
    }
  },
  "servers": [
    {
      "url": "https://api.operations1.app"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ]
}
```