> ## Documentation Index
> Fetch the complete documentation index at: https://help.statisfy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update a user

> Changes only the keys sent, as the Team page's edit does: name, role, department, manager and calendar_link, and custom user fields under `fields`. A user with a login has a new name saved to their login profile first; if that fails, nothing is written (a 500 to retry). A role or department also moves the user into that role's or department's group. `manager` must be a user's id. Every key is checked before anything is written, and any problem refuses the whole request with a 422 listing each one in `details`. A 500 whose `details` list fields as `written` means those standard fields were written and the custom values were not.



## OpenAPI

````yaml /api/statisfy-api.openapi.json patch /v1/objects/user/records/{user_id}
openapi: 3.1.0
info:
  description: >-
    The agent-first Statisfy API. Authenticate with an API key (`Authorization:
    Bearer stfy_live_…`), then call `GET /v1/meta/capabilities` to discover
    every operation and its schemas.
  title: Statisfy API
  version: 1.0.0
servers:
  - url: https://api.statisfy.com
    description: Production
security: []
paths:
  /v1/objects/user/records/{user_id}:
    patch:
      tags:
        - users
      summary: Update a user
      description: >-
        Changes only the keys sent, as the Team page's edit does: name, role,
        department, manager and calendar_link, and custom user fields under
        `fields`. A user with a login has a new name saved to their login
        profile first; if that fails, nothing is written (a 500 to retry). A
        role or department also moves the user into that role's or department's
        group. `manager` must be a user's id. Every key is checked before
        anything is written, and any problem refuses the whole request with a
        422 listing each one in `details`. A 500 whose `details` list fields as
        `written` means those standard fields were written and the custom values
        were not.
      operationId: users_update
      parameters:
        - in: path
          name: user_id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              additionalProperties: true
              properties:
                calendar_link:
                  default: null
                  description: >-
                    A link; https:// is added when it has no scheme. Null or
                    blank clears it
                  title: Calendar Link
                  type: string
                department:
                  default: null
                  description: Free text; null or blank clears it
                  title: Department
                  type: string
                fields:
                  anyOf:
                    - additionalProperties: true
                      type: object
                    - type: 'null'
                  default: null
                  description: Custom field keys to values
                  title: Fields
                manager:
                  default: null
                  description: A user's id; null or blank clears it
                  title: Manager
                  type: string
                name:
                  default: null
                  description: >-
                    The full name, split into first and last on the first space;
                    cannot be cleared
                  title: Name
                  type: string
                role:
                  default: null
                  description: Free text; null or blank clears it
                  title: Role
                  type: string
              type: object
        required: false
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
          description: Successful Response
      security:
        - HTTPBearer: []
components:
  schemas:
    User:
      properties:
        calendar_link:
          anyOf:
            - type: string
            - type: 'null'
          title: Calendar Link
        department:
          anyOf:
            - type: string
            - type: 'null'
          title: Department
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
        fields:
          additionalProperties: true
          title: Fields
          type: object
        first_name:
          anyOf:
            - type: string
            - type: 'null'
          title: First Name
        id:
          description: >-
            The user's id: the people id that owner fields and a task's creator
            hold
          title: Id
          type: string
        last_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Name
        manager:
          anyOf:
            - type: string
            - type: 'null'
          description: The id of their manager, a user; null when none
          title: Manager
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        role:
          anyOf:
            - type: string
            - type: 'null'
          title: Role
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
        user_id:
          anyOf:
            - type: string
            - type: 'null'
          description: Their Statisfy login's id; null for a CRM-only user
          title: User Id
      required:
        - id
      title: User
      type: object
  securitySchemes:
    HTTPBearer:
      scheme: bearer
      type: http
      description: >-
        An API key, sent as `Authorization: Bearer stfy_live_…`. See
        [Authentication](/rest-api/authentication) for how to get one and which
        scopes it needs.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.