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

# Crear un enllaç màgic de descàrrega de l'agent

> Crea un enllaç màgic per descarregar l'instal·lador de l'agent en un grup de reportatge. Aquesta funcionalitat només està disponible per al producte FXXOne. Posa't en contacte amb l'equip de Flexxible per a més informació.



## OpenAPI

````yaml /ca/api-reference/openapi.ca-v1.json post /v1/organizations/{organization_id}/reporting-groups/{reporting_group_id}/magic-links
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}/reporting-groups/{reporting_group_id}/magic-links:
    post:
      tags:
        - Grups de report
      summary: Crear un enllaç màgic de descàrrega de l'agent
      description: >-
        Crea un enllaç màgic per descarregar l'instal·lador de l'agent en un
        grup de reportatge. Aquesta funcionalitat només està disponible per al
        producte FXXOne. Posa't en contacte amb l'equip de Flexxible per a més
        informació.
      operationId: createReportingGroupMagicLink
      parameters:
        - name: organization_id
          in: path
          required: true
          schema:
            type: string
            maxLength: 24
            pattern: ^[0-9a-f]{24}$
          description: El identificador únic de l'organització
          example: 507f1f77bcf86cd799439011
        - name: reporting_group_id
          in: path
          required: true
          schema:
            type: string
            maxLength: 24
            pattern: ^[0-9a-f]{24}$
          description: L'identificador únic del Grup de report
          example: 507f1f77bcf86cd799439020
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateReportingGroupMagicLinkRequestV1'
            examples:
              default-installer:
                summary: >-
                  Crear enllaç màgic utilitzant valors estrictes de
                  l'instal·lador
                value:
                  expires_at: '2026-03-15T12:00:00.000Z'
                  installer:
                    version: latest
                    platform: windows
                    arch: x64
                    type: fxxone
      responses:
        '201':
          description: Enllaç màgic creat correctament.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateReportingGroupMagicLinkResponseV1'
              examples:
                created-magic-link:
                  summary: Resposta d'enllaç màgic creat
                  value:
                    id: 507f1f77bcf86cd799439099
                    token: 2ab46558-3c40-4b72-8fce-08b7b596f624
                    link: >-
                      https://portal.example.com/magic-link?key=2ab46558-3c40-4b72-8fce-08b7b596f624
        '400':
          $ref: '#/components/responses/BadRequest'
          description: >-
            Sol·licitud incorrecta: paràmetres de ruta, cos de sol·licitud o
            format de data-hora no vàlids.
        '401':
          $ref: '#/components/responses/Unauthorized'
          description: 'No autoritzat: es requereix autenticació'
        '404':
          $ref: '#/components/responses/NotFound'
          description: Grup de report no trobat
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
          description: >-
            Entitat no processable: la validació de negoci ha fallat (per
            exemple, una expiració fora del rang permès).
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    CreateReportingGroupMagicLinkRequestV1:
      type: object
      additionalProperties: false
      properties:
        expires_at:
          type: string
          format: date-time
          description: >-
            Data i hora d'expiració en UTC (ISO 8601, per exemple, amb sufix Z).
            Ha de ser en el futur i no més de 91 dies per davant.
          example: '2026-03-15T12:00:00.000Z'
        installer:
          $ref: '#/components/schemas/ReportingGroupMagicLinkInstallerV1'
      required:
        - expires_at
        - installer
      description: Cos de sol·licitud per crear un enllaç màgic de Grup de reporte.
    CreateReportingGroupMagicLinkResponseV1:
      type: object
      additionalProperties: false
      properties:
        id:
          type: string
          description: Identificador de l'enllaç màgic
          example: 507f1f77bcf86cd799439099
        token:
          type: string
          description: Token associat amb l'enllaç màgic.
          example: 2ab46558-3c40-4b72-8fce-08b7b596f624
        link:
          type: string
          description: URL de l'enllaç màgic.
          example: >-
            https://portal.example.com/magic-link?key=2ab46558-3c40-4b72-8fce-08b7b596f624
      required:
        - id
        - token
        - link
    ReportingGroupMagicLinkInstallerV1:
      type: object
      additionalProperties: false
      properties:
        version:
          type: string
          enum:
            - latest
          description: Versió de l'instal·lador.
          example: latest
        platform:
          type: string
          enum:
            - windows
          description: Plataforma de l'instal·lador.
          example: windows
        arch:
          type: string
          enum:
            - x64
          description: Arquitectura de l'instal·lador.
          example: x64
        type:
          type: string
          enum:
            - fxxone
          description: Tipus d'instal·lador.
          example: fxxone
      required:
        - version
        - platform
        - arch
        - type
      description: Selecció d'installador per a l'enllaç màgic.
    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'
    UnprocessableEntity:
      description: Entitat no processable
      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

````