# Update a user

Source: https://www.supervisible.com/developers/users/patch-users-id

PATCH /users/{user_id}



## PATCH /users/{user_id}

Update a user

Base URL: https://app.supervisible.com/api/v1

Required scope: write:users

## Operation contract

The definition below includes parameters, request bodies, response schemas, examples and authentication requirements.

```json
{
  "summary": "Update a user",
  "tags": [
    "users"
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "x-required-scope": "write:users",
  "parameters": [
    {
      "in": "path",
      "name": "user_id",
      "required": true,
      "description": "User ID.",
      "schema": {
        "type": "string",
        "description": "UUID"
      }
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "name": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 255
                },
                {
                  "type": "null"
                }
              ]
            },
            "role": {
              "description": "Profile job title, not the RBAC role",
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 255
                },
                {
                  "type": "null"
                }
              ]
            },
            "email": {
              "description": "Contact email; immutable after login access is granted",
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 254
                },
                {
                  "type": "null"
                }
              ]
            },
            "joined": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "timeOffAllowanceMode": {
              "type": "string",
              "enum": [
                "pro_rated",
                "full_time"
              ]
            },
            "image": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uri"
                },
                {
                  "type": "null"
                }
              ]
            },
            "countryCode": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 2,
                  "maxLength": 2
                },
                {
                  "type": "null"
                }
              ]
            },
            "defaultAvailability": {
              "type": "integer",
              "minimum": 0,
              "maximum": 168
            },
            "reportsToId": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "additionalProperties": false,
          "example": {
            "name": "Updated Name",
            "defaultAvailability": 40
          }
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "Successful response",
      "content": {
        "application/json": {
          "example": {
            "data": {
              "name": "Updated Name",
              "defaultAvailability": 40
            }
          }
        }
      }
    },
    "400": {
      "description": "Invalid request"
    },
    "401": {
      "description": "Unauthorized"
    },
    "403": {
      "description": "Missing required scope or current member permission"
    },
    "404": {
      "description": "Not found"
    },
    "409": {
      "description": "Conflict; refresh current state and preview again"
    },
    "429": {
      "description": "Rate limited; honor Retry-After"
    }
  }
}
```

## Referenced definitions

```json
{
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "API Key"
      }
    }
  }
}
```

[Complete OpenAPI specification](https://www.supervisible.com/openapi/public-api-v1.json)
