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

# Crear solicitud de reporte

> Crea un reporte de medición de techo a partir de la dirección de una propiedad e inicia la medición con RoofKit AI. La respuesta es 202 de inmediato. Un reporte tarda unos 15 minutos. Consulta la solicitud periódicamente, o suscribe un endpoint de webhook del workspace a `report_request.ready`, y luego lee las medidas, el PDF y el modelo 3D. Una creación con el `external_report_id` de una solicitud activa devuelve esa solicitud con 200 y no inicia un reporte nuevo. Si esa solicitud está lista y su modelo 3D falló o no existe, la creación genera el modelo otra vez, como máximo tres veces. El workspace paga el reporte del mismo modo que en la app.

**Scopes requeridos:** `reports.write`


## OpenAPI

````yaml /es/api-reference/openapi.yaml post /api/v1/report-requests
openapi: 3.1.0
info:
  title: RoofKit Partner API
  version: 1.0.0
  summary: API REST JSON para integraciones externas de socios de RoofKit.
  contact:
    name: RoofKit Engineering
  description: >-
    RoofKit Partner API v1 autentica solicitudes con API keys del workspace. Las
    API keys vinculan cada solicitud exactamente a un workspace; las rutas de
    Partner API no aceptan roofer_id, workspace_id ni identificadores de tenant.
    Los endpoints autenticados están limitados a 60 solicitudes por minuto por
    API key, método y plantilla de ruta; los intentos de autenticación inválidos
    se limitan por separado a 20 solicitudes por minuto por cliente y endpoint.
    Los parámetros y campos de fecha/hora aceptan ISO 8601 con Z o un desfase
    ±HH:MM, por ejemplo 2026-09-07T04:00:00Z o 2026-09-07T00:00:00-04:00. Ambos
    indican el mismo instante y devuelven el mismo resultado. Codifica + como
    %2B en una query string. Las respuestas usan UTC.


    Una fecha/hora sin desfase, por ejemplo 2026-09-07T04:00:00, está obsoleta.
    Hasta la fecha de retiro, 2027-01-10T00:00:00Z, se interpreta como UTC, y la
    respuesta incluye un header `Deprecation` (RFC 9745) y un header `Sunset`
    (RFC 8594). A partir de la fecha de retiro, se requiere Z o un desfase
    ±HH:MM. Desde entonces, una fecha/hora sin desfase devuelve 400 con el
    código `VALIDATION_ERROR`, y la respuesta no incluye ningún header
    `Deprecation` ni `Sunset`.


    Cada API key tiene solo los scopes que un propietario o administrador del
    workspace eligió al crear la key, y sus scopes nunca cambian. Cada operación
    indica los scopes que requiere en `x-required-scopes`. Una key nueva en
    Configuración empieza con el nivel predefinido Solo lectura: `leads.read`,
    `analytics.read`, `reports.read` y `data_objects.read`. Una key de Solo
    lectura puede llamar a todas las operaciones de lectura excepto las
    exportaciones, las lecturas de Sales Visualizer y los Data Objects en
    papelera, y no puede llamar a ninguna operación de escritura. Una llamada
    que necesita un scope que la key no tiene devuelve 403 `FORBIDDEN`, y
    `error.details.required_scope` indica un scope faltante.
servers:
  - url: https://api.roofkit.ai
    description: Origen canónico de RoofKit Partner API
security:
  - ApiKeyBearer: []
tags:
  - name: Foundation
    description: Endpoints base de autenticación y contrato.
  - name: Leads
    description: Endpoints de sincronización de leads para CRM de socios.
  - name: Attribution
    description: >-
      Endpoints de atribución de marketing, analíticas de campañas e ingesta de
      eventos para socios.
  - name: Pipeline
    description: Metadatos del pipeline de leads legibles para socios.
  - name: Reports
    description: >-
      Endpoints para importar, listar, obtener, exportar y descargar reportes de
      socios.
  - name: Visualizer
    description: >-
      Endpoints de Partner para crear Sales Visualizer, generar visualizaciones,
      crear enlaces alojados de subida de fotos, leer imágenes, consultar el
      historial de sesión y crear enlaces compartidos.
  - name: Estimates
    description: >-
      Creación y lectura de Budget Estimates de Partner para el workspace
      vinculado a la key.
  - name: Objects
    description: >-
      Endpoints de Partner para descubrimiento, esquema, registros, relaciones,
      vistas y administración de Data Objects.
paths:
  /api/v1/report-requests:
    post:
      tags:
        - Reports
      summary: Crear solicitud de reporte
      description: >-
        Crea un reporte de medición de techo a partir de la dirección de una
        propiedad e inicia la medición con RoofKit AI. La respuesta es 202 de
        inmediato. Un reporte tarda unos 15 minutos. Consulta la solicitud
        periódicamente, o suscribe un endpoint de webhook del workspace a
        `report_request.ready`, y luego lee las medidas, el PDF y el modelo 3D.
        Una creación con el `external_report_id` de una solicitud activa
        devuelve esa solicitud con 200 y no inicia un reporte nuevo. Si esa
        solicitud está lista y su modelo 3D falló o no existe, la creación
        genera el modelo otra vez, como máximo tres veces. El workspace paga el
        reporte del mismo modo que en la app.
      operationId: Create report request
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReportRequestCreateRequest'
            example:
              address: 100 Congress Ave, Austin, TX 78701
              lat: 30.2672
              lng: -97.7431
              external_report_id: inspection-77
              roof_material: shingle
      responses:
        '200':
          description: >-
            Una solicitud activa con el mismo `external_report_id`. Una
            solicitud lista cuyo modelo 3D falló o no existe vuelve a
            `rendering`.
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
            Idempotency-Replayed:
              $ref: '#/components/headers/IdempotencyReplayed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportRequestResponse'
        '202':
          description: >-
            Solicitud de reporte creada. La medición con IA se ejecuta en
            segundo plano.
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
            Idempotency-Replayed:
              $ref: '#/components/headers/IdempotencyReplayed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportRequestResponse'
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/InsufficientCredits'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: true
      description: >-
        Un valor único para cada solicitud nueva, como un UUID. Envíe el mismo
        valor para reintentar una solicitud de forma segura. La misma clave y el
        mismo payload repiten la primera respuesta con `Idempotency-Replayed:
        true`.
      schema:
        type: string
        minLength: 1
        maxLength: 160
  schemas:
    ReportRequestCreateRequest:
      type: object
      additionalProperties: false
      required:
        - address
      properties:
        address:
          type: string
          minLength: 3
          maxLength: 500
          example: 100 Congress Ave, Austin, TX 78701
        place_id:
          type:
            - string
            - 'null'
          maxLength: 500
          description: >-
            Id de Google Places. RoofKit lo usa para ubicar la propiedad cuando
            faltan `lat` y `lng`.
        lat:
          type: number
          minimum: -90
          maximum: 90
          description: >-
            Envíalo con `lng`. Sin ambos, RoofKit ubica la dirección. La IA mide
            el edificio más cercano a este punto.
        lng:
          type: number
          minimum: -180
          maximum: 180
        external_report_id:
          type:
            - string
            - 'null'
          maxLength: 200
          description: >-
            Tu id para este reporte, como el id de la inspección o del trabajo.
            Se devuelve una solicitud activa con el mismo id en lugar de un
            reporte nuevo.
        roof_material:
          description: >-
            El acabado del techo. Sin él, el equipo lo elige más tarde en
            RoofKit.
          oneOf:
            - type: string
              enum:
                - shingle
                - tile
                - metal
            - type: 'null'
    ReportRequestResponse:
      type: object
      additionalProperties: false
      required:
        - report_request
      properties:
        report_request:
          $ref: '#/components/schemas/ReportRequest'
        reused:
          type: boolean
          description: >-
            true cuando una solicitud activa con el mismo `external_report_id`
            respondió a la creación.
    ReportRequest:
      type: object
      additionalProperties: false
      required:
        - id
        - status
        - report_id
        - address
        - render_3d
        - created_at
        - updated_at
      properties:
        id:
          type: string
          example: rrq_00000000-0000-4000-8000-000000000000
        source:
          type: string
          description: >-
            Quién pidió el reporte. `jobnimbus` es una solicitud que inició una
            inspección agendada en JobNimbus.
          enum:
            - partner_api
            - jobnimbus
        status:
          type: string
          enum:
            - preparing
            - needs_attention
            - rendering
            - ready
            - failed
        attention_reason:
          oneOf:
            - type: string
              enum:
                - needs_outline
                - preparation_failed
                - insufficient_credits
            - type: 'null'
        failure_code:
          type:
            - string
            - 'null'
        report_id:
          type: string
        external_report_id:
          type:
            - string
            - 'null'
        address:
          type: string
        revision_id:
          type:
            - string
            - 'null'
        measurements:
          oneOf:
            - $ref: '#/components/schemas/ReportRequestMeasurements'
            - type: 'null'
        report_pdf:
          oneOf:
            - $ref: '#/components/schemas/ReportExportArtifact'
            - type: 'null'
        report_pdf_failure_code:
          type:
            - string
            - 'null'
        render_3d:
          type: object
          additionalProperties: false
          required:
            - status
          properties:
            status:
              type: string
              enum:
                - pending
                - ready
                - failed
            failure_code:
              type:
                - string
                - 'null'
            download_url:
              type:
                - string
                - 'null'
              format: uri
              description: >-
                La ruta que descarga el GLB de la casa con la API key. Aparece
                cuando el estado es `ready`.
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        ready_at:
          type:
            - string
            - 'null'
          format: date-time
    ErrorResponse:
      type: object
      additionalProperties: false
      required:
        - error
      properties:
        error:
          type: object
          additionalProperties: false
          required:
            - code
            - message
            - request_id
          properties:
            code:
              $ref: '#/components/schemas/ErrorCode'
            message:
              type: string
            request_id:
              type: string
            details:
              type: object
              additionalProperties: true
    ReportRequestMeasurements:
      type: object
      additionalProperties: true
      description: >-
        Las medidas de la revisión que entregó la solicitud. Las claves son
        snake_case estables con la unidad en el nombre. `version` cambia solo
        cuando se renombra o se quita una clave. Una clave nueva no la cambia.
        Una solicitud lista antes del 2026-10-28 conserva las medidas de ese
        día, sin las claves más nuevas.
      required:
        - version
        - units
        - roof_area_sqft
        - roof_squares
        - facets
        - suggested_waste_pct
        - waste_table
        - area_by_pitch
        - lengths_ft
      properties:
        version:
          type: integer
          example: 1
        units:
          type: object
          properties:
            area:
              type: string
              example: sq_ft
            length:
              type: string
              example: ft
        roof_material:
          description: >-
            El acabado del techo del reporte, o null antes de que el equipo lo
            elija. Es el techo nuevo, no el techo que hay ahora.
          oneOf:
            - type: string
              enum:
                - shingle
                - tile
                - metal
            - type: 'null'
        roof_area_sqft:
          type: number
          description: >-
            Área de techo medida antes del desperdicio, con las caras planas
            incluidas. Las losas no son techo.
        roof_squares:
          type: number
        sloped_area_sqft:
          type: number
          description: >-
            Área de techo de las caras que no son planas. Inclinada más plana es
            el área de techo.
        sloped_squares:
          type: number
        flat_area_sqft:
          type: number
          description: >-
            Área de techo de las caras planas: una cara marcada como techo
            plano, o una cara por debajo de 2/12 después de redondear la
            elevación a un número entero.
        flat_squares:
          type: number
        steep_slope_area_sqft:
          type: number
          description: >-
            Área de techo con 8/12 o más de pendiente después de redondear la
            elevación a un número entero. La banda `steep` de
            `area_by_pitch_band_sqft` empieza en 10/12.
        steep_slope_squares:
          type: number
        predominant_pitch:
          type:
            - string
            - 'null'
          example: 6/12
        predominant_pitch_rise:
          type:
            - number
            - 'null'
        facets:
          type: integer
        suggested_waste_pct:
          type: number
        waste_table:
          type: array
          items:
            type: object
            properties:
              waste_pct:
                type: number
              area_sqft:
                type: number
              squares:
                type: number
              is_suggested:
                type: boolean
        area_by_pitch:
          type: array
          items:
            type: object
            properties:
              pitch:
                type:
                  - string
                  - 'null'
              pitch_rise:
                type:
                  - number
                  - 'null'
              area_sqft:
                type: number
              share_pct:
                type: number
        area_by_pitch_band_sqft:
          type: object
          properties:
            low:
              type: number
            mid:
              type: number
            steep:
              type: number
        unpitched_area_sqft:
          type: number
        lengths_ft:
          type: object
          description: >-
            Longitudes de líneas en pies. Estas claves son los nombres estables
            de las líneas del techo. Cada clave siempre está presente, con 0
            cuando el techo no tiene esa línea.
          required:
            - eaves
            - eaves_flat
            - eaves_sloped
            - rakes
            - ridges
            - hips
            - valleys
            - step_flashing
            - wall_flashing
            - parapets
            - slope_transitions
            - slope_transitions_pitch_to_pitch
            - slope_transitions_flat_to_pitch
            - drip_edge
            - starter
            - ridge_cap
            - ridge_vent
          properties:
            eaves:
              type: number
              description: Líneas de alero.
            eaves_flat:
              type: number
              description: Líneas de alero cuyas caras son todas planas.
            eaves_sloped:
              type: number
              description: Líneas de alero de caras inclinadas, y líneas de alero sin cara.
            rakes:
              type: number
              description: Líneas de borde inclinado.
            ridges:
              type: number
              description: Líneas de cumbrera.
            hips:
              type: number
              description: Líneas de limatesa.
            valleys:
              type: number
              description: Líneas de limahoya.
            step_flashing:
              type: number
              description: >-
                Líneas de tapajuntas escalonado y de muro lateral, donde un muro
                sube por la pendiente.
            wall_flashing:
              type: number
              description: >-
                Líneas de tapajuntas de faldón y de muro de cabecera, donde un
                muro nivelado se une al techo.
            parapets:
              type: number
              description: Líneas de parapeto, el muro bajo alrededor de un techo plano.
            slope_transitions:
              type: number
              description: Líneas de transición de pendiente.
            slope_transitions_pitch_to_pitch:
              type: number
              description: Líneas de transición de pendiente entre dos caras inclinadas.
            slope_transitions_flat_to_pitch:
              type: number
              description: Líneas de transición de pendiente con una cara plana en un lado.
            drip_edge:
              type: number
              description: Aleros más bordes inclinados.
            starter:
              type: number
              description: Aleros más bordes inclinados.
            ridge_cap:
              type: number
              description: Cumbreras más limatesas.
            ridge_vent:
              type: number
              description: >-
                Cumbreras, como la lista de precios pide la ventilación de
                cumbrera.
        penetrations:
          type:
            - object
            - 'null'
          properties:
            skylights:
              type: integer
            chimneys:
              type: integer
            vents:
              type: integer
            pipe_boots:
              type: integer
        walls:
          type:
            - object
            - 'null'
          properties:
            perimeter_ft:
              type: number
            gable_area_sqft:
              type: number
        metal_panels:
          type:
            - object
            - 'null'
          properties:
            stock_ft:
              type: number
            piece_count:
              type: integer
            is_complete:
              type: boolean
    ReportExportArtifact:
      type: object
      additionalProperties: false
      required:
        - export_id
        - report_id
        - revision_id
        - format
        - file_name
        - mime_type
        - size_bytes
        - checksum
      properties:
        export_id:
          type: string
        report_id:
          type: string
        revision_id:
          type:
            - string
            - 'null'
        format:
          $ref: '#/components/schemas/ReportArtifactFormat'
        role:
          type: string
          enum:
            - export
            - manifest
        file_name:
          type: string
        mime_type:
          type: string
        size_bytes:
          type: integer
          minimum: 0
        checksum:
          type: string
        metadata:
          type: object
          additionalProperties: true
        created_at:
          type: string
          format: date-time
        download_url:
          type: string
          format: uri
    ErrorCode:
      type: string
      enum:
        - UNAUTHORIZED
        - FORBIDDEN
        - RATE_LIMITED
        - VALIDATION_ERROR
        - NOT_FOUND
        - CONFLICT
        - INSUFFICIENT_CREDITS
        - INTERNAL_ERROR
    ReportArtifactFormat:
      type: string
      enum:
        - xml
        - csv
        - xlsx
        - dxf
        - pdf
        - json
        - zip
        - manifest
        - tif
        - png
        - jpg
        - jpeg
        - webp
        - gif
  headers:
    RateLimitLimit:
      description: Cantidad máxima de solicitudes permitidas en la ventana actual.
      schema:
        type: string
    RateLimitRemaining:
      description: Solicitudes restantes en la ventana actual.
      schema:
        type: string
    RateLimitReset:
      description: Timestamp ISO cuando se reinicia la ventana actual de rate limit.
      schema:
        type: string
        format: date-time
    IdempotencyReplayed:
      description: >-
        Presente y true cuando se reprodujo una respuesta de escritura exitosa
        almacenada.
      schema:
        type: string
        enum:
          - 'true'
    RetryAfter:
      description: Segundos hasta que el llamador debería reintentar.
      schema:
        type: string
  responses:
    ValidationError:
      description: El payload, query o header requerido de la solicitud no es válido.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: API key ausente, malformada, revocada, eliminada o desconocida.
      headers:
        WWW-Authenticate:
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InsufficientCredits:
      description: El workspace no puede cubrir el cargo de créditos de esta operación.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Forbidden:
      description: >-
        La API key no tiene un scope requerido, o el workspace no está activo.
        Un fallo de scope indica un scope faltante en `details.required_scope`.
        Cuando la búsqueda de la key rechaza la llamada,
        `details.missing_scopes` lista cada scope requerido que la key no tiene.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            missing_scope:
              summary: Una key de Solo lectura llama a una operación de escritura
              value:
                error:
                  code: FORBIDDEN
                  message: 'API key does not include the required scope: leads.write.'
                  request_id: req_123
                  details:
                    required_scope: leads.write
                    missing_scopes:
                      - leads.write
    Conflict:
      description: >-
        La solicitud entra en conflicto con la idempotencia o la identidad del
        evento externo.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    RateLimited:
      description: >-
        Rate limit excedido para esta key y endpoint o para el bucket de
        autenticación inválida.
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/RateLimitLimit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/RateLimitRemaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/RateLimitReset'
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalError:
      description: Error interno de autenticación o del servidor.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    ApiKeyBearer:
      type: http
      scheme: bearer
      bearerFormat: RoofKit API key
      description: 'Usa `Authorization: Bearer rk_live_...`.'

````

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