> ## 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.

# Actualitzar un arrendatari

> Actualitza el nom d'un tenant existent. L'actualització del nom del tenant també actualitza el nom de l'organització relacionada.



## OpenAPI

````yaml /ca/api-reference/openapi.ca-v1.json put /v1/organizations/{organization_id}/tenants/{tenant_id}
openapi: 3.0.3
info:
  title: API Publica Portal
  version: 1.0.0
  description: API pública REST per al portal
servers:
  - url: https://api.flexxible.net
    description: Portal API (production)
security:
  - bearerAuth: []
tags: []
paths:
  /v1/organizations/{organization_id}/tenants/{tenant_id}:
    put:
      tags:
        - Llogaters
      summary: Actualitzar un arrendatari
      description: >-
        Actualitza el nom d'un tenant existent. L'actualització del nom del
        tenant també actualitza el nom de l'organització relacionada.
      operationId: updateTenant
      parameters:
        - name: organization_id
          in: path
          required: true
          schema:
            type: string
            maxLength: 24
            pattern: ^[0-9a-f]{24}$
          description: L'identificador únic de l'organització propietària del tenant
          example: 507f1f77bcf86cd799439011
        - name: tenant_id
          in: path
          required: true
          schema:
            type: string
            maxLength: 24
            pattern: ^[0-9a-f]{24}$
          description: L'identificador únic del tenant a actualitzar
          example: 507f1f77bcf86cd799439020
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateTenantRequestV1'
            examples:
              update-tenant-name:
                summary: Actualitzar el nom d'un tenant existent
                value:
                  name: Tenant de Produccion Actualizado
      responses:
        '200':
          description: >-
            Nom del tenant actualitzat correctament. El nom de l'organització
            relacionada també s'ha actualitzat. La resposta conté el recurs
            actualitzat.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TenantByIdV1'
        '400':
          $ref: '#/components/responses/BadRequest'
          description: >-
            Sol·licitud incorrecta. Causes comunes: - Cos de la sol·licitud o
            paràmetres de ruta no vàlids - Falta el camp obligatori (nom) -
            Tipus de camp no vàlids
        '401':
          $ref: '#/components/responses/Unauthorized'
          description: >-
            No autoritzat: es requereix autenticació o l'usuari no té permís per
            actualitzar el tenant
        '404':
          $ref: '#/components/responses/NotFound'
          description: Tenant no trobat
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    UpdateTenantRequestV1:
      type: object
      properties:
        name:
          type: string
          maxLength: 512
      required:
        - name
    TenantByIdV1:
      type: object
      properties:
        id:
          type: string
        organization_id:
          type: string
          description: ID de l'organització del tenant
        create_date:
          type: string
          format: date-time
        name:
          type: string
        region:
          type: string
        product_id:
          type: string
          nullable: true
          description: ID del producte (nullable)
        policy_id:
          type: string
          nullable: true
          description: ID de la política (nullable)
      required:
        - id
        - organization_id
        - create_date
        - name
        - region
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            code:
              type: string
            details:
              type: string
          required:
            - message
            - code
      required:
        - error
  responses:
    BadRequest:
      description: Sol·licitud incorrecta
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: No autoritzat
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: No trobat
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    TooManyRequests:
      description: Masses sol·licituds
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalServerError:
      description: Error intern del servidor
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````