---
title: "Patch User"
method: PATCH
path: "/api/v1/users/{user_id}"
tags: ["Users"]
---

# Patch User

`PATCH /api/v1/users/{user_id}`

## Request

- Base URL: `https://public-api.linearb.io`
- URL: `https://public-api.linearb.io/api/v1/users/{user_id}`
- Auth: API key in header `x-api-key`
- TypeScript: <https://skmtc.dev/linearb/apis/linearb-api/docs/api/v1/users/:user_id/patch.ts> (a function with typed inputs; its response is checked against the schema)

Users API endpoint performs a LinearB update user. Note: if custom_info is not provided, it will not be overwritten.

## Path parameters

- `user_id` integer, required: User object ID

## Request body

- UserPatchModel
  - `name` string: username must be at least 3 characters long, start with a letter
  - `email` string: User's email address
  - `permission` Permission
    - `role` 'admin' | 'editor' | 'viewer' | 'external' | 'basic': An enumeration.
    - `team_scopes` string[]
    - `view_dev_coaching` boolean
  - `team_membership` TeamMembership[]
    - `name` string, required
    - `joined_at` string: The date when the user joined the team (format: YYYY-MM-DD)
  - `custom_info` CustomInfo
    - `extra_emails` string[]: User extra emails
    - `extra_ids` string[]

## Response `200`

Successful Response

- UserModel: Model representing a user in the system. Attributes: id (int): The unique identifier of the user. organization_id (str): The ID of the organization this user belongs to. name (str): The full name of the user. email (str): The user's email address. avatar_url (Optional[str]): URL to the user's avatar image. extra (Optional[Dict]): Additional custom information about the user. created_at (str): The timestamp when the user was created. updated_at (Optional[str]): The timestamp when the user was last updated. deleted_at (Optional[str]): The timestamp when the user was deleted, if applicable. team_membership (List[Dict]): List of teams the user belongs to. user_type_id (Optional[int]): The type identifier for this user. connected_users (ConnectedUsersModel): Information about connected user accounts. permissions (Dict): User's permission settings.
  - `id` integer, required: The unique identifier of the user
  - `organization_id` string, required: The ID of the organization this user belongs to
  - `name` string, required: The full name of the user
  - `email` string: The user's email address
  - `avatar_url` string: URL to the user's avatar image
  - `extra` object: Additional custom information about the user
  - `created_at` string, required: The timestamp when the user was created
  - `updated_at` string: The timestamp when the user was last updated
  - `deleted_at` string: The timestamp when the user was deleted, if applicable
  - `team_membership` object[]: List of teams the user belongs to
  - `user_type_id` integer: The type identifier for this user
  - `connected_users` ConnectedUsersModel: Model representing connected users in different platforms. Attributes: platform_users (List[Dict]): List of connected platform user accounts contributors (List[Dict]): List of connected contributor accounts
    - `platform_users` object[]: List of connected platform user accounts
    - `contributors` object[]: List of connected contributor accounts
  - `permissions` object: User's permission settings

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `405`: Method Not Allowed
- `409`: Conflict
- `422`: Validation Error
- `500`: Internal Server Error
- `504`: Gateway Timeout

---

[API](https://skmtc.dev/linearb/apis/linearb-api.md) - [All operations](https://skmtc.dev/linearb/apis/linearb-api/llms.txt) - [OpenAPI document](https://skmtc.dev/linearb/apis/linearb-api/revisions/3aea06710db6?raw)
