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

# Update an accountant user

> Updates an accountant user by ID.

<Warning>This endpoint only works with the **Accountant API key**. More information [here](/api-keys)</Warning>


## OpenAPI

````yaml https://api.steuerboard.com/v1/openapi patch /admin/users/{id}
openapi: 3.1.1
info:
  version: 0.1.0
  title: Steuerboard API
servers:
  - url: https://api.steuerboard.com/v1
security:
  - bearerAuth: []
tags:
  - name: auth
    description: Authentication and identity endpoints
    x-displayName: Auth
  - name: collect
    description: Public collect session endpoints
    x-displayName: Collect
  - name: collect.sessions
    description: Collect Sessions endpoints
    x-displayName: Collect Sessions
  - name: health
    description: Service health endpoints
    x-displayName: Health
  - name: admin.clients
    description: Admin endpoints for managing clients
    x-displayName: Clients
  - name: admin.users
    description: Admin user management endpoints
    x-displayName: Admin Users
  - name: files
    description: File management endpoints
    x-displayName: Files
  - name: tasks
    description: Task management endpoints
    x-displayName: Tasks
  - name: workspaces
    description: Workspace management endpoints
    x-displayName: Workspaces
  - name: workspace.members
    description: Workspace member management endpoints
    x-displayName: Workspace Members
  - name: webhooks
    description: Webhook event payloads and contracts
    x-displayName: Webhooks
  - name: users
    description: User management endpoints
    x-displayName: Users
externalDocs:
  description: Find out more about Steuerboard API
  url: https://docs.steuerboard.com
paths:
  /admin/users/{id}:
    patch:
      tags:
        - admin.users
      summary: Update an accountant user
      description: Updates an accountant user by ID.
      operationId: updateAccountantUser
      parameters:
        - schema:
            type: string
            format: cuid
            description: The ID of the item
            example: cmf41ajzv003706un4i99q19z
          required: true
          in: path
          name: id
      requestBody:
        description: Update accountant user
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateAccountantUser'
      responses:
        '200':
          description: Accountant user updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountantUser'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/auth_error'
        '403':
          description: Missing scope
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/auth_error'
                  - properties:
                      status_code:
                        type: integer
                        enum:
                          - 403
                      type:
                        type: string
                        enum:
                          - auth_error
                      code:
                        type: string
                        enum:
                          - missing_scope
                      message:
                        type: string
        '404':
          description: Accountant user or role not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/not_found'
        '422':
          description: The validation error(s)
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    properties:
                      success:
                        type: boolean
                        example: false
                      error:
                        type: object
                        properties:
                          issues:
                            type: array
                            items:
                              type: object
                              properties:
                                code:
                                  type: string
                                path:
                                  type: array
                                  items:
                                    anyOf:
                                      - type: string
                                      - type: number
                                message:
                                  type: string
                              required:
                                - code
                                - path
                          name:
                            type: string
                        required:
                          - issues
                          - name
                        example:
                          name: ZodError
                          issues:
                            - code: invalid_union
                              path:
                                - role
                              message: Invalid input
                    required:
                      - success
                      - error
                  - type: object
                    properties:
                      success:
                        type: boolean
                        example: false
                      error:
                        type: object
                        properties:
                          issues:
                            type: array
                            items:
                              type: object
                              properties:
                                code:
                                  type: string
                                path:
                                  type: array
                                  items:
                                    anyOf:
                                      - type: string
                                      - type: number
                                message:
                                  type: string
                              required:
                                - code
                                - path
                          name:
                            type: string
                        required:
                          - issues
                          - name
                        example:
                          name: ZodError
                          issues:
                            - code: invalid_type
                              path:
                                - id
                              message: Required
                    required:
                      - success
                      - error
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/rate_limit'
        '500':
          description: Internal server error
          content: {}
components:
  schemas:
    UpdateAccountantUser:
      type: object
      properties:
        role:
          anyOf:
            - type: string
              enum:
                - admin
                - user
            - type: string
              format: cuid
          description: >-
            Role to assign to the user. Can be 'admin', 'user', or a custom role
            ID.
          examples:
            - admin
            - user
            - cmf41ajzv003706un4i99q1a0
      required:
        - role
    AccountantUser:
      type: object
      properties:
        id:
          type: string
          format: cuid
          description: Identifier of the accountant user.
          example: cmf41ajzv003706un4i99q1b1
        createdAt:
          type: string
          format: date-time
          description: ISO 8601 timestamp when the accountant user record was created.
          example: '2024-08-20T12:34:56Z'
        email:
          type: string
          format: email
          description: Email address of the accountant user.
          example: alex@example.com
        firstName:
          type:
            - string
            - 'null'
          description: First name of the accountant user, if provided.
          example: Alex
        lastName:
          type:
            - string
            - 'null'
          description: Last name of the accountant user, if provided.
          example: Müller
        roles:
          type: array
          items:
            $ref: '#/components/schemas/AccountantUserRole'
          description: Roles assigned to the accountant user.
      required:
        - id
        - createdAt
        - email
        - firstName
        - lastName
        - roles
    auth_error:
      type: object
      properties:
        status_code:
          type: integer
          enum:
            - 401
        type:
          type: string
          enum:
            - auth_error
        code:
          type: string
          enum:
            - unauthorized
        message:
          type: string
      required:
        - status_code
        - type
        - code
        - message
    not_found:
      type: object
      properties:
        status_code:
          type: integer
          enum:
            - 404
        type:
          type: string
          enum:
            - not_found
        code:
          type: string
          enum:
            - not_found
        message:
          type: string
      required:
        - status_code
        - type
        - code
        - message
    rate_limit:
      type: object
      properties:
        status_code:
          type: integer
          enum:
            - 429
        type:
          type: string
          enum:
            - rate_limit
        code:
          type: string
          enum:
            - too_many_requests
        message:
          type: string
      required:
        - status_code
        - type
        - code
        - message
    AccountantUserRole:
      type: object
      properties:
        id:
          type: string
          format: cuid
          description: Identifier of the role assigned to the accountant user.
          example: cmf41ajzv003706un4i99q1a0
        name:
          type:
            - string
            - 'null'
          description: Internal identifier of the role. Null when the role is custom only.
          example: accountant_admin
        customName:
          type:
            - string
            - 'null'
          description: Custom label for the role, if defined.
          example: Head of Accounting
      required:
        - id
        - name
        - customName
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: Bearer token authentication

````