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

# Validar token y obtener contexto actual

> Valida el token y devuelve el contexto autenticado.



## OpenAPI

````yaml /api-reference/openapi-v1.json get /v1/me
openapi: 3.0.3
info:
  title: API Publica Portal
  version: 1.0.0
  description: Api publica REST para portal
servers:
  - url: https://api.staging.flxwvdexternal.com
    description: Staging API server
security:
  - bearerAuth: []
tags: []
paths:
  /v1/me:
    get:
      tags:
        - Autenticación
      summary: Validar token y obtener contexto actual
      description: Valida el token y devuelve el contexto autenticado.
      operationId: get_me
      parameters: []
      responses:
        '200':
          description: Contexto autenticado recuperado correctamente.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetMeResponseV1'
              examples:
                authenticated_context:
                  summary: Contexto de organización y token
                  value:
                    organization_id: 507f1f77bcf86cd799439011
                    token_id: 507f1f77bcf86cd799439022
                    token_name: api-key-admin
                    token_created_at: '2026-03-01T10:15:00Z'
                    token_expires_at: '2027-03-01T10:15:00Z'
        '401':
          description: Token inválido, expirado o ausente.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                invalid_token:
                  summary: Error de autenticación
                  value:
                    error:
                      message: No autorizado
                      code: unauthorized
        '500':
          description: Error interno del servidor.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                unexpected_error:
                  summary: Fallo no controlado
                  value:
                    error:
                      message: Error interno del servidor
                      code: internal_error
components:
  schemas:
    GetMeResponseV1:
      type: object
      properties:
        organization_id:
          type: string
          pattern: ^[0-9a-f]{24}$
          minLength: 24
          maxLength: 24
          description: Identificador de la organización autenticada.
        token_id:
          type: string
          pattern: ^[0-9a-f]{24}$
          minLength: 24
          maxLength: 24
          description: Identificador de la API key autenticada.
        token_name:
          type: string
          nullable: true
          description: Nombre del token autenticado.
        token_created_at:
          type: string
          format: date-time
          description: Fecha de creación del token.
        token_expires_at:
          type: string
          format: date-time
          description: Fecha de expiración del token.
      required:
        - organization_id
        - token_id
        - token_name
        - token_created_at
        - token_expires_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

````