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

# Permit Signal Leads

> Fetch permit-scoped lead rows for a geo_id

Use this endpoint to fetch permit-scoped lead rows for a non-property `geo_id`.

It returns the current page of leads, trust fields (`event_date_used`, `signal_basis`, `confidence`, `reason_codes`), freshness metadata, and the cursor for the next page.

Use `include_stale=true` if you need rows older than the default freshness window.

Supported permit-pack keys are documented in [Signals Catalog](/signals).

See also [Permit Signal Stats](/api-reference/endpoint/permit-signals-stats).

### Required input

* `geo_id` (query, required, non-property geo)

### Optional input

* `signal_keys` (CSV list)
* `from_date`, `to_date` (`YYYY-MM-DD`)
* `min_confidence` (`0..1`)
* `max_freshness_days` (`1..3650`)
* `include_stale` (`true|false`)
* `sort` (`event_date_desc` or `confidence_desc`)
* `group_by` (`none`, `city`, `zip`)
* `limit` (`1..100`)
* `cursor` (opaque pagination token)

### Example request

```bash theme={null}
curl -sS "$API_BASE_URL/v1/signals/permit/leads?geo_id=geo_county_6973f63e37a900040c0d&signal_keys=site_prep_issued_nowcast,new_construction_issued_nowcast&sort=event_date_desc&group_by=none&limit=25" \
  -H "x-api-key: $HOMELOGS_API_KEY"
```

### Response shape

* `geo_id`, `geo_type`, `scope=permit`
* `signal_keys[]`
* `max_freshness_days`
* `count`
* `next_cursor`
* `leads[]` (or `groups[]` when grouped)


## OpenAPI

````yaml GET /v1/signals/permit/leads
openapi: 3.1.0
info:
  title: HomeLogs Geo + Permit Intelligence API
  version: 1.0.0
  description: >-
    Geo-first API for location resolution, permit retrieval, and active geo
    signal access.
servers:
  - url: https://api.homelogs.io
    description: Production API
security:
  - ApiKeyAuth: []
tags:
  - name: locations
    description: Location resolution and anchor detail endpoints.
  - name: permits
    description: Raw permit retrieval by geo scope.
  - name: signals
    description: Signal catalog and signal reads.
  - name: permit-signals
    description: Permit-scoped signal leads and aggregates.
  - name: health
    description: Service liveness endpoint.
paths:
  /v1/signals/permit/leads:
    get:
      tags:
        - permit-signals
      summary: Get permit-scoped lead rows for a geo ID
      description: >-
        Returns permit-scoped signal leads for a non-property geo_id. Freshness
        defaults to the last 60 days unless include_stale=true. A 422 is
        returned for unsupported property geo_id anchors, invalid cursors, or
        invalid freshness values.
      operationId: getPermitSignalLeads
      parameters:
        - name: geo_id
          in: query
          required: true
          description: Location identity token for a non-property geo scope.
          schema:
            type: string
            example: geo_county_6973f63e37a900040c0d
        - name: signal_keys
          in: query
          required: false
          description: >-
            Optional CSV list of customer-facing permit signal keys. Allowed
            values: site_prep_issued_nowcast, new_construction_issued_nowcast,
            framing_nowcast_early, framing_window_late, rough_in_nowcast_early,
            rough_in_window_late.
          schema:
            type: string
            example: site_prep_issued_nowcast,new_construction_issued_nowcast
        - name: from_date
          in: query
          required: false
          description: Optional lower bound in YYYY-MM-DD format.
          schema:
            type: string
            format: date
        - name: to_date
          in: query
          required: false
          description: Optional upper bound in YYYY-MM-DD format.
          schema:
            type: string
            format: date
        - name: min_confidence
          in: query
          required: false
          description: Optional minimum confidence between 0 and 1.
          schema:
            type: number
            minimum: 0
            maximum: 1
        - name: max_freshness_days
          in: query
          required: false
          description: >-
            Optional freshness window in days, between 1 and 3650. Defaults to
            60 when include_stale is false.
          schema:
            type: integer
            minimum: 1
            maximum: 3650
            default: 60
        - name: include_stale
          in: query
          required: false
          description: When true, disables the default freshness filter.
          schema:
            type: boolean
            default: false
        - name: sort
          in: query
          required: false
          description: Cursor sort order for the returned page.
          schema:
            type: string
            enum:
              - event_date_desc
              - confidence_desc
            default: event_date_desc
        - name: group_by
          in: query
          required: false
          description: Optional grouping for the returned page.
          schema:
            type: string
            enum:
              - none
              - city
              - zip
            default: none
        - name: limit
          in: query
          required: false
          description: Maximum rows to return.
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 25
        - name: cursor
          in: query
          required: false
          description: Opaque cursor from the previous page.
          schema:
            type: string
      responses:
        '200':
          description: Permit-scoped lead rows and pagination metadata.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PermitSignalLeadsResponse'
        '403':
          $ref: '#/components/responses/GatewayAuth403'
        '404':
          $ref: '#/components/responses/LocationNotFound404'
        '422':
          $ref: '#/components/responses/ValidationError422'
        '429':
          $ref: '#/components/responses/GatewayThrottle429'
        '500':
          $ref: '#/components/responses/InternalError500'
components:
  schemas:
    PermitSignalLeadsResponse:
      type: object
      required:
        - geo_id
        - geo_type
        - scope
        - signal_keys
        - max_freshness_days
        - count
        - next_cursor
      properties:
        geo_id:
          type: string
        geo_type:
          type:
            - string
            - 'null'
          enum:
            - jurisdiction
            - city
            - zip
            - county
            - state
            - null
        scope:
          type: string
          enum:
            - permit
        signal_keys:
          type: array
          items:
            type: string
        max_freshness_days:
          type:
            - integer
            - 'null'
          minimum: 1
          maximum: 3650
        count:
          type: integer
          minimum: 0
        next_cursor:
          type:
            - string
            - 'null'
        group_by:
          type: string
          enum:
            - none
            - city
            - zip
        leads:
          type: array
          items:
            $ref: '#/components/schemas/PermitSignalLead'
        groups:
          type: array
          items:
            $ref: '#/components/schemas/PermitSignalLeadGroup'
      additionalProperties: false
    PermitSignalLead:
      type: object
      required:
        - lead_id
        - signal_key
        - event_date_used
        - signal_basis
        - confidence
        - reason_codes
        - freshness_lag_days
        - permit_number
        - jurisdiction
        - location
        - maps_url
      properties:
        lead_id:
          type: string
        signal_key:
          type: string
          description: Customer-facing permit signal key.
        event_date_used:
          type:
            - string
            - 'null'
          format: date
        signal_basis:
          type: string
          description: >-
            Public basis label for the lead row (observed_event or
            inferred_timing).
        confidence:
          type:
            - number
            - 'null'
        reason_codes:
          type: array
          items:
            type: string
        freshness_lag_days:
          type:
            - integer
            - 'null'
          minimum: 0
        permit_number:
          type:
            - string
            - 'null'
        jurisdiction:
          type:
            - string
            - 'null'
        location:
          $ref: '#/components/schemas/PermitSignalLeadLocation'
        maps_url:
          type:
            - string
            - 'null'
          format: uri
      additionalProperties: false
    PermitSignalLeadGroup:
      type: object
      required:
        - key
        - count
        - leads
      properties:
        key:
          type: string
        count:
          type: integer
          minimum: 0
        leads:
          type: array
          items:
            $ref: '#/components/schemas/PermitSignalLead'
      additionalProperties: false
    GatewayErrorResponse:
      type: object
      properties:
        message:
          type: string
      additionalProperties: true
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              example: VALIDATION_ERROR
            message:
              type: string
              example: state must be a 2-letter code
            request_id:
              type:
                - string
                - 'null'
              example: req-123
    PermitSignalLeadLocation:
      type: object
      properties:
        full_address:
          type:
            - string
            - 'null'
        city:
          type:
            - string
            - 'null'
        state:
          type:
            - string
            - 'null'
        zipcode:
          type:
            - string
            - 'null'
        county:
          type:
            - string
            - 'null'
        city_norm:
          type:
            - string
            - 'null'
        zipcode_norm:
          type:
            - string
            - 'null'
        county_norm:
          type:
            - string
            - 'null'
      additionalProperties: false
  responses:
    GatewayAuth403:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GatewayErrorResponse'
    LocationNotFound404:
      description: No matching location/resource found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ValidationError422:
      description: Validation failure.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    GatewayThrottle429:
      description: Rate limit or quota exceeded.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GatewayErrorResponse'
    InternalError500:
      description: Internal server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````