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

# Retrieve a user

> Returns details of the requested user within the scope of an organization.



## OpenAPI

````yaml /en/api-reference/openapi.en-v1.json get /v1/organizations/{organization_id}/users/{user_id}
openapi: 3.0.3
info:
  title: API Publica Portal
  version: 1.0.0
  description: Public REST API for portal
servers:
  - url: https://api.flexxible.net/
    description: Portal API
security:
  - bearerAuth: []
tags: []
paths:
  /v1/organizations/{organization_id}/users/{user_id}:
    get:
      tags:
        - Users
      summary: Retrieve a user
      description: >-
        Returns details of the requested user within the scope of an
        organization.
      operationId: get_user_by_id
      parameters:
        - name: organization_id
          in: path
          required: true
          schema:
            type: string
            pattern: ^[0-9a-f]{24}$
            minLength: 24
            maxLength: 24
          description: Organization identifier.
          example: 507f1f77bcf86cd799439011
        - name: user_id
          in: path
          required: true
          schema:
            type: string
            pattern: ^[0-9a-f]{24}$
            minLength: 24
            maxLength: 24
          description: User identifier.
          example: 64f0c2a1b2d3e4f506070801
      responses:
        '200':
          description: User details retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserByIdV1'
              examples:
                user_details:
                  summary: User detail response
                  value:
                    id: 64f0c2a1b2d3e4f506070801
                    organization_id: 507f1f77bcf86cd799439011
                    name: Ana
                    surname: Lopez
                    email: ana.lopez@example.com
                    language: en-EN
                    created_at: '2025-12-01T10:30:00.000Z'
                    department: Soporte
                    role_id: 64f0c2a1b2d3e4f5060708aa
                    created_by: 64f0c2a1b2d3e4f5060708bb
                    email_login_enabled: true
        '400':
          description: Invalid request parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                invalid_user_id:
                  summary: 'Invalid user ID format '
                  value:
                    error:
                      message: Formato de user_id no valido
                      code: bad_request
                      details: >-
                        user_id debe ser una cadena hexadecimal en minusculas de
                        24 caracteres
        '401':
          description: Not authorized or organization not accessible.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                organization_not_authorized:
                  summary: Organization access failure
                  value:
                    error:
                      message: No autorizado
                      code: unauthorized
        '404':
          description: User not found within the authorized scope of the organization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                user_not_found:
                  summary: The requested user was not found
                  value:
                    error:
                      message: Usuario no encontrado
                      code: not_found
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                unexpected_error:
                  summary: Unhandled failure
                  value:
                    error:
                      message: Error interno del servidor
                      code: internal_error
components:
  schemas:
    UserByIdV1:
      type: object
      properties:
        id:
          type: string
          pattern: ^[0-9a-f]{24}$
          minLength: 24
          maxLength: 24
          description: User identifier.
        organization_id:
          type: string
          nullable: true
          pattern: ^[0-9a-f]{24}$
          minLength: 24
          maxLength: 24
          description: Organization identifier associated with the user.
        name:
          type: string
          description: User's name.
        surname:
          type: string
          description: User's surname.
        email:
          type: string
          format: email
          description: User's email address.
        language:
          type: string
          enum:
            - en-EN
            - es-ES
            - pt-BR
            - ca-ES
            - eu-ES
          description: User's preferred language code.
        created_at:
          type: string
          description: Creation date in ISO 8601 format.
        department:
          type: string
          nullable: true
          description: User's department.
        role_id:
          type: string
          nullable: true
          pattern: ^[0-9a-f]{24}$
          minLength: 24
          maxLength: 24
          description: Identifier of the role assigned to the user.
        created_by:
          type: string
          nullable: true
          pattern: ^[0-9a-f]{24}$
          minLength: 24
          maxLength: 24
          description: Identifier of the user who created the user record.
        email_login_enabled:
          type: boolean
          nullable: true
          description: Indicates if email login is enabled for the user.
      required:
        - id
        - name
        - surname
        - email
        - language
        - created_at
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            code:
              type: string
            details:
              type: string
          required:
            - message
            - code
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````