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

# Exchange Impersonation Code

> Scambia il codice monouso dell'hub con la sessione di impersonation.

Errori: 400 `auth.impersonation_code_invalid` / `_used` / `_expired`;
409 `tenant.deleted` e 400 `tenant.not_active` se il negozio è stato
eliminato o sospeso dopo l'emissione; 400 `auth.impersonation_code_invalid`
anche quando l'operatore non è più un super_admin attivo.



## OpenAPI

````yaml https://api.vellaro.io/openapi.json post /api/v1/auth/impersonation/exchange
openapi: 3.1.0
info:
  title: Vellaro API
  description: Vellaro 2026 — E-commerce API
  version: 0.1.0
servers:
  - url: https://api.vellaro.io
    description: Produzione
security: []
tags: []
paths:
  /api/v1/auth/impersonation/exchange:
    post:
      tags:
        - auth
      summary: Exchange Impersonation Code
      description: >-
        Scambia il codice monouso dell'hub con la sessione di impersonation.


        Errori: 400 `auth.impersonation_code_invalid` / `_used` / `_expired`;

        409 `tenant.deleted` e 400 `tenant.not_active` se il negozio è stato

        eliminato o sospeso dopo l'emissione; 400
        `auth.impersonation_code_invalid`

        anche quando l'operatore non è più un super_admin attivo.
      operationId: exchange_impersonation_code_api_v1_auth_impersonation_exchange_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImpersonationExchangeIn'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_ImpersonationSessionOut_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ImpersonationExchangeIn:
      properties:
        code:
          type: string
          maxLength: 128
          minLength: 16
          title: Code
      type: object
      required:
        - code
      title: ImpersonationExchangeIn
    ApiResponse_ImpersonationSessionOut_:
      properties:
        data:
          anyOf:
            - $ref: '#/components/schemas/ImpersonationSessionOut'
            - type: 'null'
        meta:
          anyOf:
            - $ref: '#/components/schemas/PaginationMeta'
            - type: 'null'
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Code
      type: object
      title: ApiResponse[ImpersonationSessionOut]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ImpersonationSessionOut:
      properties:
        access_token:
          type: string
          title: Access Token
        token_type:
          type: string
          title: Token Type
          default: bearer
        expires_in:
          type: integer
          title: Expires In
        tenant_id:
          type: string
          title: Tenant Id
        tenant_slug:
          type: string
          title: Tenant Slug
        tenant_name:
          type: string
          title: Tenant Name
      type: object
      required:
        - access_token
        - expires_in
        - tenant_id
        - tenant_slug
        - tenant_name
      title: ImpersonationSessionOut
    PaginationMeta:
      properties:
        page:
          type: integer
          title: Page
        page_size:
          type: integer
          title: Page Size
        total:
          type: integer
          title: Total
        total_pages:
          type: integer
          title: Total Pages
      type: object
      required:
        - page
        - page_size
        - total
        - total_pages
      title: PaginationMeta
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````

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