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

# Atualizar um usuário (PUT)

> Igual a `PATCH /clients/users/{user_id}/`; todos os campos são opcionais, portanto não é uma substituição completa.



## OpenAPI

````yaml /pt/openapi.yaml put /clients/users/{user_id}/
openapi: 3.1.0
info:
  title: API de clientes da hackU
  version: 1.2.0
  description: >
    API pública para os clientes corporativos da hackU. Ela permite que uma
    empresa gerencie seus alunos

    (criar, atualizar, desativar), matriculá-los em cursos (routes) e pensums,

    ler o progresso deles e enviar comunicações por WhatsApp / e-mail.


    **Autenticação.** Toda requisição deve enviar o cabeçalho

    `Authorization: Api-Key <token>`. A chave identifica a empresa; não há

    parâmetro de empresa na URL, exceto onde indicado.


    **Paginação.** Os endpoints de listagem paginados usam limit/offset

    (`limit` padrão 50, máximo 500) e retornam `{count, next, previous,
    results}`.


    **Erros.** Uma chave ausente, inválida, revogada ou expirada retorna `403`
    com

    `{"detail": "..."}`. Os erros de validação retornam `400` com

    `{"<field>": ["<message>", ...]}` (ou `non_field_errors`). Algumas mensagens
    são

    retornadas em espanhol.


    **Identificadores.** `user_id` em todos os paths é o id do usuário na hackU,
    retornado como

    `user_pk` por `POST /clients/users/` e como `id` por `GET /clients/users/`.
servers:
  - url: https://app.reinvented.education/api
    description: Production
  - url: https://qa-admin.hacku.co/api
    description: Test
security:
  - ApiKeyAuth: []
tags:
  - name: Usuários
    description: Criar, ler, atualizar e desativar os alunos da empresa.
  - name: Matrículas
    description: Atribuir cursos (routes), módulos e pensums.
  - name: Progresso
    description: >-
      Ler o progresso dos alunos em cursos, módulos, pensums, avaliações,
      pesquisas e certificados.
  - name: Catálogo
    description: Os cursos (routes) da empresa e seus módulos.
  - name: Campos adicionais
    description: Campos de usuário personalizados definidos pela empresa.
  - name: Comunicações
    description: Enviar mensagens de WhatsApp ou e-mail usando templates aprovados.
paths:
  /clients/users/{user_id}/:
    parameters:
      - $ref: '#/components/parameters/UserId'
    put:
      tags:
        - Usuários
      summary: Atualizar um usuário (PUT)
      description: >-
        Igual a `PATCH /clients/users/{user_id}/`; todos os campos são
        opcionais, portanto não é uma substituição completa.
      operationId: replaceUser
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateUserRequest'
      responses:
        '200':
          description: The updated user.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientUser'
        '400':
          $ref: '#/components/responses/ValidationError'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    UserId:
      name: user_id
      in: path
      required: true
      description: >-
        Id do usuário na hackU, conforme retornado por `POST /clients/users/`
        (`user_pk`) ou `GET /clients/users/` (`id`).
      schema:
        type: integer
      example: 48213
  schemas:
    UpdateUserRequest:
      type: object
      properties:
        first_name:
          type: string
        last_name:
          type: string
        email:
          type: string
          format: email
        offline_mode:
          type: boolean
        is_client:
          type: boolean
        is_verified:
          type: boolean
        profile:
          type: object
          description: Campos do perfil a definir. Valores null são ignorados.
          properties:
            friendly_name:
              type: string
            document_type:
              $ref: '#/components/schemas/DocumentType'
            document_number:
              type: string
            hour:
              type: string
              description: HH:MM or HH:MM:SS.
          additionalProperties: true
        extra_fields:
          type: array
          items:
            $ref: '#/components/schemas/UpdateUserExtraField'
      example:
        last_name: Pérez Gómez
        profile:
          hour: '07:00'
          document_type: PASS
          document_number: AB123456
        extra_fields:
          - name: cargo
            value: Analista
    ClientUser:
      type: object
      properties:
        id:
          type: integer
        username:
          type: string
        is_client:
          type: boolean
          description: Tem uma assinatura (membership) ativa.
        is_verified:
          type: boolean
        first_name:
          type: string
        last_name:
          type: string
        email:
          type: string
          format: email
        phone_number:
          type:
            - string
            - 'null'
        user_company:
          type:
            - string
            - 'null'
          description: Slug da empresa da API key, se a assinatura estiver ativa.
        profile:
          $ref: '#/components/schemas/UserProfileSummary'
        active_module:
          type: array
          description: Módulos ativos nos cursos da empresa.
          items:
            $ref: '#/components/schemas/ActiveModule'
        user_extra_field:
          type: array
          items:
            $ref: '#/components/schemas/UserExtraFieldValue'
        last_activity:
          type:
            - string
            - 'null'
          format: date-time
        created:
          type: string
          format: date-time
        last_login:
          type:
            - string
            - 'null'
          format: date-time
        offline_mode:
          type: boolean
        membership_start_date:
          type:
            - string
            - 'null'
          format: date
          description: Da assinatura mais recente do usuário.
        membership_expiration:
          type:
            - string
            - 'null'
          format: date
          description: Da assinatura mais recente do usuário.
      example:
        id: 48213
        username: ana.perez@example.com
        is_client: true
        is_verified: true
        first_name: Ana
        last_name: Pérez
        email: ana.perez@example.com
        phone_number: '+573001112233'
        user_company: acme
        profile:
          document_type: CEDULA
          document_number: '1000000001'
          hour: '08:30:00'
          points: 120
        active_module: []
        user_extra_field:
          - extra_field_company: area
            extra_field_choice: ventas
            value: null
            json_data: null
        last_activity: '2026-11-24T09:12:40-05:00'
        created: '2026-10-01T14:00:00-05:00'
        last_login: null
        offline_mode: false
        membership_start_date: '2026-10-01'
        membership_expiration: '2027-10-01'
    DocumentType:
      type: string
      enum:
        - CEDULA
        - INE
        - TI
        - DNI
        - CEDULA_EX
        - PASS
        - PERMISO
        - SALVOC
        - EXPEDIENTE
        - CPF
        - RUT
      description: >-
        CEDULA: national id; INE; TI: identity card (minors); DNI; CEDULA_EX:
        foreigner id; PASS: passport; PERMISO: special permit; SALVOC:
        safe-conduct; EXPEDIENTE; CPF; RUT.
    UpdateUserExtraField:
      type: object
      required:
        - name
        - value
      properties:
        name:
          type: string
          description: >-
            O `name` do campo adicional. É criado como campo de texto se não
            existir.
        value:
          type:
            - string
            - 'null'
        extra_field_choice:
          type: string
          description: Para campos SELECT, o valor da opção; é criado se não existir.
    UserProfileSummary:
      type: object
      properties:
        document_type:
          oneOf:
            - $ref: '#/components/schemas/DocumentType'
            - type: 'null'
        document_number:
          type:
            - string
            - 'null'
        hour:
          type: string
          description: Horário de entrega, HH:MM:SS.
          example: '08:30:00'
        points:
          type: integer
    ActiveModule:
      type: object
      properties:
        route:
          $ref: '#/components/schemas/Route'
        content_module:
          $ref: '#/components/schemas/Module'
        is_active:
          type: boolean
        progress_percentage:
          type: integer
        extra_data:
          type:
            - object
            - 'null'
    UserExtraFieldValue:
      type: object
      properties:
        extra_field_company:
          type: string
          description: O `name` do campo adicional.
        extra_field_choice:
          type:
            - string
            - 'null'
          description: O `name` da opção selecionada, para campos SELECT.
        value:
          type:
            - string
            - 'null'
        json_data:
          type:
            - object
            - 'null'
    ValidationErrors:
      type: object
      description: >-
        Field name (or `non_field_errors`) mapped to a list of messages. Nested
        serializers return nested objects.
      additionalProperties: true
      example:
        email:
          - Enter a valid email address.
        selected_days:
          - Day funday is not valid.
    Error:
      type: object
      required:
        - detail
      properties:
        detail:
          type: string
    Route:
      type: object
      description: A course.
      properties:
        id:
          type: integer
        external_id:
          type:
            - string
            - 'null'
          description: Seu próprio identificador para o curso.
        name:
          type: string
        slug_name:
          type: string
        total_contents:
          type: integer
        minutes_duration:
          type: integer
        starting_date:
          type:
            - string
            - 'null'
          format: date
        rating:
          type: number
        language:
          $ref: '#/components/schemas/Language'
        finished:
          type: boolean
          description: O conteúdo do curso está completo.
        published:
          type: boolean
        automatic_advance:
          type: boolean
        alias:
          type:
            - string
            - 'null'
        test_trials_available:
          type:
            - integer
            - 'null'
          description: >-
            Tentativas de avaliação permitidas; null ou 0 significa que se
            aplica o valor geral da empresa.
    Module:
      type: object
      properties:
        pk:
          type: integer
        slug_name:
          type: string
        name:
          type: string
        description:
          type:
            - string
            - 'null'
        minutes_duration:
          type: integer
        total_contents:
          type: integer
        alias:
          type:
            - string
            - 'null'
          description: Identificador alternativo para integrações.
    Language:
      type: string
      enum:
        - es
        - en
        - pt
  responses:
    ValidationError:
      description: Invalid input.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationErrors'
    Forbidden:
      description: Missing, invalid, revoked or expired API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            detail: Authentication credentials were not provided.
    NotFound:
      description: Not found (or not visible to this API key).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            detail: Not found.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Company API key. The header value must be `Api-Key <token>`, e.g.
        `Authorization: Api-Key AbCd1234.xxxxxxxx`.

````

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