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

# Start a lead extraction

> Starts an asynchronous lead extraction on a real-estate portal. Returns immediately with `extractionId` and `status: QUEUED`.

**Polling pattern:** call `GET /extractions/{id}` every 5–10 s until `status` is `COMPLETED` or `FAILED`. Alternatively, subscribe to the `extraction.completed` webhook event.

Use `GET /platforms` to list supported portals and `GET /platforms/{platform}/filters` to discover filter keys.



## OpenAPI

````yaml /openapi.json post /public/v1/extractions
openapi: 3.0.0
info:
  title: Hostreach API
  description: >-
    Public REST API for Hostreach.


    Authenticate with an API key via the `X-Api-Key` header or `Authorization:
    Bearer <key>` header.


    Generate API keys from **Settings › Workspace › Acceso API** in the
    dashboard.
  version: '1.0'
  contact: {}
servers:
  - url: https://api.hostreach.io/v1
    description: Production
  - url: http://localhost:3001/v1
    description: Local
security:
  - apiKey: []
tags:
  - name: Identity
    description: Current workspace and usage
  - name: Platforms
    description: Supported real-estate portals and filter schemas
  - name: Extractions
    description: Lead extraction jobs
  - name: Leads
    description: Lead management
  - name: Campaigns
    description: Campaign management
  - name: Messaging
    description: Inbox and WhatsApp conversations
  - name: Templates
    description: WhatsApp message templates
  - name: Accounts
    description: WhatsApp accounts
  - name: Valuations
    description: Property valuations
  - name: Fichas
    description: Property listing sheets
  - name: Scheduling
    description: Calendar and appointments
  - name: Webhooks
    description: Event subscriptions
paths:
  /public/v1/extractions:
    post:
      tags:
        - Extractions
      summary: Start a lead extraction
      description: >-
        Starts an asynchronous lead extraction on a real-estate portal. Returns
        immediately with `extractionId` and `status: QUEUED`.


        **Polling pattern:** call `GET /extractions/{id}` every 5–10 s until
        `status` is `COMPLETED` or `FAILED`. Alternatively, subscribe to the
        `extraction.completed` webhook event.


        Use `GET /platforms` to list supported portals and `GET
        /platforms/{platform}/filters` to discover filter keys.
      operationId: ExtractionsController_createExtraction
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateExtractionDto'
      responses:
        '202':
          description: ''
      security:
        - bearerApiKey: []
        - apiKey: []
components:
  schemas:
    CreateExtractionDto:
      type: object
      properties:
        platform:
          type: string
          description: >-
            Real-estate portal to extract leads from. Use `GET /platforms` to
            list supported portals and `GET /platforms/{platform}/filters` to
            discover the filter schema.
          enum:
            - idealista
            - fotocasa
            - metrocuadrado
            - inmuebles24
            - zonaprop
          example: idealista
        filters:
          type: object
          description: >-
            Platform-specific filter object. Required keys vary by portal — use
            `GET /platforms/{platform}/filters` to discover them. Typical
            fields: `operation` (rent|sale), `location` (object from
            `/platforms/{platform}/locations`), `propertyType`, `minPrice`,
            `maxPrice`, `minRooms`.
          example:
            operation: rent
            location:
              id: 0-EU-ES-VC-46-46250-999-2-009
              label: Valencia
        maxResults:
          type: number
          description: 'Maximum number of leads to extract. Default: 50.'
          minimum: 1
          default: 50
          example: 100
        options:
          description: Advanced extraction options.
          allOf:
            - cf4ce450-92c7-4d96-80e1-ba0d5ca8adc7
      required:
        - platform
        - filters
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-Api-Key
      description: >-
        API key (hr_live_... or hr_test_...). Generate from Settings › Workspace
        › Acceso API.

````