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

# Update user's details

> This method updates user's details.



## OpenAPI

````yaml /api-reference/services_documented/iam_api.yaml patch /iam/users/{userId}
openapi: 3.1.0
info:
  title: Gcore OpenAPI – IAM API
  description: >-
    This OpenAPI is an aggregated OpenAPI specification that unifies all Gcore
    products into a single file. It covers Cloud, CDN, DNS, WAAP, DDoS
    Protection, Object Storage, Streaming, and FastEdge services.
  version: '2026-05-14T07:00:22.640261+00:00'
servers:
  - url: https://api.gcore.com
security:
  - APIKey: []
tags:
  - name: Account
    description: >-
      Account management operations including authentication, password
      management, and account details.
    x-displayName: Account
  - name: API Tokens
    description: >-
      Use permanent API tokens for regular automated requests to services.

      You can either set its validity period when creating it or issue a token
      for an unlimited time.

      Please address the API documentation of the specific product in order to
      check if it supports API tokens.


      Newer endpoints under `/v2/…` issue tokens using `_` (underscore) as the
      separator

      (for example `42_a1b2c3d4e5f6...`) and are the recommended way to create
      new tokens.

      Legacy endpoints that issue `$`-separated tokens are marked deprecated and
      will be removed

      on **2026-07-17**; tokens that were already issued keep authenticating.


      Provide your APIKey in the Authorization header.


      Example: ```curl -H "Authorization: APIKey 42_a1b2c3d4e5f6..."
      https://api.gcore.com/iam/users/me```


      Please note: When authorizing via SAML SSO, our system does not have any

      information about permissions given to the user by the identity provider.

      Even if the provider revokes the user's access rights, their tokens remain
      active.

      Therefore, if necessary, the token will need to be deleted manually.
    x-displayName: API Tokens
  - name: Users
    x-displayName: Users
paths:
  /iam/users/{userId}:
    patch:
      tags:
        - Users
      summary: Update user's details
      description: This method updates user's details.
      operationId: iamUpdateUser
      parameters:
        - $ref: '#/components/parameters/UserID'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PutUser'
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
        '400':
          description: Update user's details failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateUserError'
        '403':
          description: >-
            The specified user has issued a token with a higher role. Try using
            another role.
        '404':
          description: User not found.
      x-codeSamples:
        - lang: Python
          source: |-
            import os
            from gcore import Gcore

            client = Gcore(
                api_key=os.environ.get("GCORE_API_KEY"),  # This is the default and can be omitted
            )
            user = client.iam.users.update(
                user_id=0,
            )
            print(user.id)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/G-Core/gcore-go\"\n\t\"github.com/G-Core/gcore-go/iam\"\n\t\"github.com/G-Core/gcore-go/option\"\n)\n\nfunc main() {\n\tclient := gcore.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tuser, err := client.Iam.Users.Update(\n\t\tcontext.TODO(),\n\t\t0,\n\t\tiam.UserUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", user.ID)\n}\n"
components:
  parameters:
    UserID:
      name: userId
      in: path
      required: true
      description: User's ID.
      schema:
        type: integer
  schemas:
    PutUser:
      type: object
      properties:
        id:
          type: integer
          description: User's ID.
          readOnly: true
        email:
          $ref: '#/components/schemas/UserEmail'
        name:
          $ref: '#/components/schemas/UserName'
        lang:
          $ref: '#/components/schemas/Language'
        phone:
          $ref: '#/components/schemas/UserPhone'
        reseller:
          type: integer
          description: Services provider ID.
          readOnly: true
        client:
          type: number
          description: User's account ID.
          readOnly: true
        deleted:
          type: boolean
          description: Deletion flag. If `true` then user was deleted.
          readOnly: true
        activated:
          type: boolean
          description: |-
            Email confirmation:
            - `true` – user confirmed the email;
            - `false` – user did not confirm the email.
          readOnly: true
        sso_auth:
          type: boolean
          description: SSO authentication flag. If `true` then user can login via SAML SSO.
          readOnly: true
        two_fa:
          type: boolean
          description: |-
            Two-step verification:
            - `true` – user enabled two-step verification;
            - `false` – user disabled two-step verification.
          readOnly: true
        auth_types:
          $ref: '#/components/schemas/AuthTypes'
        user_type:
          $ref: '#/components/schemas/UserType'
        is_active:
          type: boolean
          description: User activity flag.
          readOnly: true
        client_and_roles:
          $ref: '#/components/schemas/UserClientAndRoles'
    User:
      type: object
      required:
        - id
        - email
        - name
        - lang
        - phone
        - company
        - reseller
        - client
        - deleted
        - groups
        - activated
        - sso_auth
        - two_fa
        - auth_types
        - user_type
        - is_active
        - client_and_roles
      properties:
        id:
          type: integer
          description: User's ID.
          readOnly: true
        email:
          $ref: '#/components/schemas/UserEmail'
        name:
          $ref: '#/components/schemas/UserName'
        lang:
          $ref: '#/components/schemas/Language'
        phone:
          $ref: '#/components/schemas/UserPhone'
        company:
          $ref: '#/components/schemas/UserCompany'
        reseller:
          type: integer
          description: Services provider ID.
          readOnly: true
        client:
          type: number
          description: User's account ID.
          readOnly: true
        deleted:
          type: boolean
          description: Deletion flag. If `true` then user was deleted.
          readOnly: true
        groups:
          $ref: '#/components/schemas/UserGroups'
        activated:
          type: boolean
          description: |-
            Email confirmation:
            - `true` – user confirmed the email;
            - `false` – user did not confirm the email.
          readOnly: true
        sso_auth:
          type: boolean
          description: SSO authentication flag. If `true` then user can login via SAML SSO.
          readOnly: true
        two_fa:
          type: boolean
          description: |-
            Two-step verification:
            - `true` – user enabled two-step verification;
            - `false` – user disabled two-step verification.
          readOnly: true
        auth_types:
          $ref: '#/components/schemas/AuthTypes'
        user_type:
          $ref: '#/components/schemas/UserType'
        is_active:
          type: boolean
          description: User activity flag.
          readOnly: true
        client_and_roles:
          $ref: '#/components/schemas/UserClientAndRoles'
    UpdateUserError:
      oneOf:
        - allOf:
            - $ref: '#/components/schemas/ValidationError'
            - example:
                errors:
                  groups: Group matching query does not exist.
        - $ref: '#/components/schemas/JSONParseError'
    UserEmail:
      type: string
      format: email
      description: User's email address.
    UserName:
      type: string
      description: User's name.
      nullable: true
    Language:
      type: string
      description: |-
        User's language.

        Defines language of the control panel and email messages.
      enum:
        - de
        - en
        - ru
        - zh
        - az
    UserPhone:
      type: string
      description: User's phone.
      nullable: true
    AuthTypes:
      type: array
      items:
        $ref: '#/components/schemas/AuthType'
      description: System field. List of auth types available for the account.
    UserType:
      type: string
      description: User's type.
      enum:
        - common
        - reseller
        - seller
      readOnly: true
    UserClientAndRoles:
      type: array
      description: List of user's clients. User can access to one or more clients.
      readOnly: true
      items:
        required:
          - client_company_name
          - client_id
          - user_id
          - user_roles
        type: object
        properties:
          client_id:
            type: integer
          client_company_name:
            type: string
          user_roles:
            type: array
            description: User role in this client.
            example:
              - '2'
            items:
              type: string
              description: String representation of role id.
          user_id:
            type: integer
            description: User's ID.
    UserCompany:
      type: string
      description: User's company.
    UserGroups:
      type: array
      description: |-
        User's group in the current account.

        IAM supports 5 groups:

         - Users
        - Administrators
        - Engineers
        - Purge and Prefetch only (API)
        - Purge and Prefetch only (API+Web)
      items:
        $ref: '#/components/schemas/Group'
    ValidationError:
      title: Validation error
      type: object
      properties:
        errors:
          type: object
          description: This object contains error descriptions per field from your request.
          additionalProperties:
            type: array
            description: Error list for specific field.
            items:
              type: string
              description: Error description
    JSONParseError:
      title: Invalid request JSON schema
      type: object
      properties:
        message:
          type: string
          description: >-
            This message describes error if json schema from your request is
            invalid.
          example: >
            JSON parse error - Expecting ',' delimiter: line 3 column 33 (char
            77)
    AuthType:
      type: string
      description: Auth types.
      enum:
        - password
        - sso
        - github
        - google-oauth2
    Group:
      type: object
      properties:
        id:
          type: integer
          example: 1
          description: >-
            Group's ID: Possible values are:   


            - 1 - Administrators* 2 - Users* 5 - Engineers* 3009 - Purge and
            Prefetch only (API+Web)* 3022 - Purge and Prefetch only (API)
        name:
          type: string
          example: Administrators
          description: Group's name.
          enum:
            - Users
            - Administrators
            - Engineers
            - Purge and Prefetch only (API)
            - Purge and Prefetch only (API+Web)
  securitySchemes:
    APIKey:
      description: >-
        API key for authentication. Make sure to include the word `apikey`,
        followed by a single space and then your token.

        Example: `apikey 1234$abcdef`
      type: apiKey
      in: header
      name: Authorization

````