openapi: 3.1.0
info:
  title: PlatYield API
  version: 0.1.0-draft
  summary: Subdivision layout, grading and site-work cost estimates for land development, as an API.
  description: |
    > **Early access — API under development.** This specification is published ahead of the
    > implementation (spec-first). Paths and schemas may still change before general availability.
    > Request early access at https://platyield.com.

    PlatYield turns a site boundary into buildable lots, a grading plan and a site-work cost estimate.
    It is built for **proptech companies** that want feasibility numbers inside their own products and for
    **civil engineering firms** that want a fast first pass before detailed design. The engine is
    proven on real projects in Japan; regional rules are supplied by *condition packs*.

    ## The pipeline

    | Step | Endpoint | What you get |
    |---|---|---|
    | 1. Subdivide | `POST /subdivisions` | Up to N layout patterns: lots, internal roads, parking spaces |
    | 2. Grade | `POST /grading-plans` | Finished heights per lot, retaining walls, road profiles, cut/fill volumes, surface meshes |
    | 3. Estimate | `POST /cost-estimates` | Cost line items by work type, total and cost per lot |
    | All in one | `POST /feasibility` | Steps 1–3 for every pattern, compared side by side (lot count vs. site-work cost) |

    ## Conventions

    - **Asynchronous jobs.** Every `POST` that computes something returns `202 Accepted` with a
      [Job](#tag/Jobs). Poll `GET /jobs/{job_id}` (honour `Retry-After`) or pass `webhook_url` to be
      notified (see the `jobCompleted` webhook). Typical run time is seconds to a few minutes.
    - **Geometry is GeoJSON in WGS 84** (EPSG:4326, `[longitude, latitude]`, RFC 7946). Internally the
      site is projected to its local UTM zone; results are returned in WGS 84 again. Polygon rings are
      closed (first position = last position) and the outer ring is counter-clockwise.
    - **Inputs are metric.** All request fields carry their unit in the name (`_m`, `_m2`, `_m3`).
      Set `units: imperial` to receive results in ft, ft² and yd³. Every result states its units in a
      `units` object. Unit prices are always given per metric unit.
    - **Condition packs.** Every request names a `condition_pack` such as `us-generic@2027.1`, a versioned
      bundle of regional defaults (road widths, turnaround shape, lot rules, grading limits, reference
      unit prices). Published versions never change. Explicit request fields (`lot_rules`, `road_rules`,
      `unit_prices`, …) take precedence over `overrides`, which take precedence over the pack.
    - **Reproducibility.** Every result carries `engine_version` and the resolved condition pack version.
      The same input with the same versions returns the same result.
    - **Errors** use RFC 9457 `application/problem+json`. Non-fatal issues are returned as `warnings`
      with stable machine-readable `code`s. New warning codes may be added at any time; treat unknown
      codes as informational.
    - **Idempotency.** Send an `Idempotency-Key` header on every `POST`. Retrying with the same key and
      the same body within 24 hours returns the original job instead of starting a new one.
    - **Rate limits** are reported on every response with `RateLimit-Limit`, `RateLimit-Remaining` and
      `RateLimit-Reset`.

    ## Environments and keys

    | Environment | Base URL | Key prefix | Notes |
    |---|---|---|---|
    | Live | `https://api.platyield.com/v1` | `pk_live_` | Any site within the limits below |
    | Sandbox | `https://sandbox.api.platyield.com/v1` | `pk_test_` | Only the published sample sites are computed; free |

    ## Current limits (early access)

    - Site area up to 10,000 m² (about 2.5 acres) per request. Larger sites should be split into parcels.
    - `parking_spaces_per_lot` of 0–2.
    - Elevation sources `points` and `geotiff_url`. The `provider` source is added per region.
    - Condition pack values other than `jp-standard` are **reference defaults that are still being reviewed
      by local engineers**. Always supply your own municipality's values for real decisions.
  contact:
    name: PlatYield developer support
    url: https://platyield.com
  license:
    name: Proprietary
    url: https://platyield.com/terms
servers:
  - url: https://api.platyield.com/v1
    description: Live
  - url: https://sandbox.api.platyield.com/v1
    description: Sandbox (sample sites only, `pk_test_` keys)
security:
  - apiKey: []
tags:
  - name: Subdivisions
    description: Lay out lots, internal roads and parking spaces on a site.
  - name: Grading plans
    description: Plan finished heights, retaining walls, road profiles and earthwork for a subdivision pattern.
  - name: Cost estimates
    description: Price a grading plan by work type, in total and per lot.
  - name: Feasibility
    description: Run subdivision, grading and cost estimation in one call and compare the patterns.
  - name: Jobs
    description: Every computation runs as a job. Poll a job or receive it by webhook.
  - name: Condition packs
    description: Versioned regional defaults and rules, with the source of every value.
  - name: Account
    description: Usage of the API key's account.

paths:
  /subdivisions:
    post:
      tags: [Subdivisions]
      operationId: createSubdivision
      summary: Create a subdivision layout
      description: |
        Lays out lots, internal roads and parking spaces on `site` and returns up to `max_patterns`
        alternative patterns, best first. Lot size and frontage minimums come from zoning, so pass them in
        `lot_rules`; the condition pack only supplies defaults for fields you omit.

        The job result is a [SubdivisionResult](#schema/SubdivisionResult). Use a `pattern_id` from it in
        `POST /grading-plans`.
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubdivisionRequest'
            examples:
              hillsideSite:
                $ref: '#/components/examples/SubdivisionRequestHillside'
      responses:
        '202':
          $ref: '#/components/responses/SubdivisionJobAccepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/IdempotencyConflict'
        '422':
          $ref: '#/components/responses/UnprocessableContent'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'

  /grading-plans:
    post:
      tags: [Grading plans]
      operationId: createGradingPlan
      summary: Create a grading plan for a subdivision pattern
      description: |
        Plans finished heights (pad elevations) for every lot of a subdivision pattern, together with the
        retaining walls, road profiles and drainage pipes they require, and the resulting cut and fill volumes.

        Existing ground comes from `elevation`: survey `points`, a georeferenced `geotiff_url`, or (where the
        condition pack defines one) a public DEM `provider`.

        The job result is a [GradingResult](#schema/GradingResult). Use its `grading_plan_id` in
        `POST /cost-estimates`.
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GradingPlanRequest'
            examples:
              surveyPoints:
                $ref: '#/components/examples/GradingPlanRequestPoints'
              geotiff:
                $ref: '#/components/examples/GradingPlanRequestGeotiff'
      responses:
        '202':
          $ref: '#/components/responses/GradingPlanJobAccepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/IdempotencyConflict'
        '422':
          $ref: '#/components/responses/UnprocessableContent'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'

  /cost-estimates:
    post:
      tags: [Cost estimates]
      operationId: createCostEstimate
      summary: Create a cost estimate for a grading plan
      description: |
        Prices the quantities of a grading plan by work type (earthwork, soil export, retaining walls,
        wall foundations, roads, drainage) and returns the total and the cost per usable lot.

        **Pass your own `unit_prices`.** Any price you omit falls back to the condition pack's reference
        price, and that line item is marked `price_source: pack_default` so a reference figure is never
        mistaken for a quote.

        The job result is a [CostEstimate](#schema/CostEstimate).
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CostEstimateRequest'
            examples:
              callerPrices:
                $ref: '#/components/examples/CostEstimateRequestUsd'
      responses:
        '202':
          $ref: '#/components/responses/CostEstimateJobAccepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/IdempotencyConflict'
        '422':
          $ref: '#/components/responses/UnprocessableContent'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'

  /feasibility:
    post:
      tags: [Feasibility]
      operationId: createFeasibilityStudy
      summary: Run subdivision, grading and cost estimate in one call
      description: |
        Answers the acquisition question "how many lots, and what will the site work cost?" before you buy.
        Runs `POST /subdivisions`, then `POST /grading-plans` and `POST /cost-estimates` for every pattern,
        and returns the patterns side by side with lot count, earthwork, retaining walls, total cost and
        cost per lot.

        The job result is a [FeasibilityResult](#schema/FeasibilityResult). Each option carries the
        `pattern_id`, `grading_plan_id` and `cost_estimate_id` it was built from.
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FeasibilityRequest'
            examples:
              hillsideSite:
                $ref: '#/components/examples/FeasibilityRequestHillside'
      responses:
        '202':
          $ref: '#/components/responses/FeasibilityJobAccepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/IdempotencyConflict'
        '422':
          $ref: '#/components/responses/UnprocessableContent'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'

  /jobs/{job_id}:
    get:
      tags: [Jobs]
      operationId: getJob
      summary: Get a job and its result
      description: |
        Returns the job's status and, once `status` is `succeeded`, its `result`. While the job is
        `queued` or `running`, the response carries `Retry-After` with a suggested polling interval in
        seconds. Jobs and their results are kept for 30 days.
      parameters:
        - name: job_id
          in: path
          required: true
          description: Job ID returned by a `POST` endpoint.
          schema:
            type: string
            pattern: '^job_[A-Za-z0-9]{20,}$'
          example: job_7Hq2mT9xKpL4vB8nZ3rD
      responses:
        '200':
          description: The job.
          headers:
            Retry-After:
              description: Seconds to wait before polling again. Present only while the job is `queued` or `running`.
              schema:
                type: integer
                minimum: 1
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Job'
              examples:
                running:
                  $ref: '#/components/examples/JobRunning'
                subdivisionSucceeded:
                  $ref: '#/components/examples/JobSubdivisionSucceeded'
                gradingSucceeded:
                  $ref: '#/components/examples/JobGradingSucceeded'
                costEstimateSucceeded:
                  $ref: '#/components/examples/JobCostEstimateSucceeded'
                feasibilitySucceeded:
                  $ref: '#/components/examples/JobFeasibilitySucceeded'
                failed:
                  $ref: '#/components/examples/JobFailed'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'

  /condition-packs:
    get:
      tags: [Condition packs]
      operationId: listConditionPacks
      summary: List condition packs
      description: |
        Lists the condition packs available to your key, newest version first. Use the `id`
        (for example `us-generic@2027.1`) as `condition_pack` in requests.
      parameters:
        - name: region
          in: query
          required: false
          description: Filter by ISO 3166-1 alpha-2 country code.
          schema:
            type: string
            pattern: '^[A-Z]{2}$'
          example: US
        - name: include_superseded
          in: query
          required: false
          description: Include older versions of each pack. By default only the latest version of each pack is listed.
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: The condition packs.
          headers:
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConditionPackList'
              examples:
                all:
                  $ref: '#/components/examples/ConditionPackListAll'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'

  /condition-packs/{pack_id}:
    get:
      tags: [Condition packs]
      operationId: getConditionPack
      summary: Get a condition pack and its values
      description: |
        Returns every value of a condition pack with its unit, source and review status. Pass a versioned
        ID (`us-generic@2027.1`) or a bare name (`us-generic`) for the latest version.
      parameters:
        - name: pack_id
          in: path
          required: true
          description: Condition pack ID, with or without `@version`.
          schema:
            $ref: '#/components/schemas/ConditionPackRef'
          example: us-generic@2027.1
      responses:
        '200':
          description: The condition pack.
          headers:
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConditionPack'
              examples:
                usGeneric:
                  $ref: '#/components/examples/ConditionPackUsGeneric'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'

  /usage:
    get:
      tags: [Account]
      operationId: getUsage
      summary: Get usage for the current billing period
      description: |
        Returns how many jobs your account has run in the current calendar month (UTC) and the site area
        they covered, for the environment of the key you call with (`live` or `test`).
      parameters:
        - name: period
          in: query
          required: false
          description: Month to report, as `YYYY-MM`. Defaults to the current month.
          schema:
            type: string
            pattern: '^\d{4}-(0[1-9]|1[0-2])$'
          example: '2027-02'
      responses:
        '200':
          description: Usage for the period.
          headers:
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Usage'
              examples:
                february:
                  $ref: '#/components/examples/UsageFebruary'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'

webhooks:
  jobCompleted:
    post:
      tags: [Jobs]
      operationId: jobCompletedWebhook
      summary: Job finished (succeeded or failed)
      description: |
        Sent to the `webhook_url` of the request when a job reaches `succeeded` or `failed`. The body
        contains the full job, including its `result`.

        - Verify `PlatYield-Signature` before trusting the body: compute HMAC-SHA256 over
          `"{t}.{raw request body}"` with your webhook signing secret and compare it with `v1`.
          Reject events whose `t` is more than 5 minutes old.
        - Respond with any `2xx` within 10 seconds. Other responses and timeouts are retried with
          exponential backoff for up to 24 hours.
        - Deliveries may arrive more than once or out of order; de-duplicate by the event `id`.
      security: []
      parameters:
        - name: PlatYield-Signature
          in: header
          required: true
          description: '`t=<unix seconds>,v1=<hex HMAC-SHA256>`'
          schema:
            type: string
          example: t=1772269425,v1=5f1c0a9e3b7d4c2a8e6f1b0d9c3a7e5f2b4d6c8a0e1f3b5d7c9a2e4f6b8d0c1a
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookEvent'
            examples:
              subdivisionSucceeded:
                $ref: '#/components/examples/WebhookSubdivisionSucceeded'
      responses:
        '200':
          description: Acknowledged. Any `2xx` status is accepted.

components:
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: |
        `Authorization: Bearer <key>`. Live keys start with `pk_live_`, sandbox keys with `pk_test_`.
        A `pk_test_` key is rejected by the live server and vice versa. Keep keys server-side.

  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      description: |
        Unique key (for example a UUID) for this request. Retrying with the same key and the same body
        within 24 hours returns the original job with `202`. Reusing a key with a different body returns
        `409`. Strongly recommended on every `POST`.
      schema:
        type: string
        minLength: 8
        maxLength: 255
      example: 3f9b6c1e-8a2d-4e57-b0c4-71d2a9e6f845

  headers:
    RateLimit-Limit:
      description: Requests allowed in the current window.
      schema:
        type: integer
      example: 60
    RateLimit-Remaining:
      description: Requests left in the current window.
      schema:
        type: integer
      example: 57
    RateLimit-Reset:
      description: Seconds until the current window resets.
      schema:
        type: integer
      example: 42
    X-Request-Id:
      description: Unique ID of this request. Include it when contacting support.
      schema:
        type: string
      example: req_9KfT2wQ8mZ1xY4bN
    Location:
      description: URL of the created job.
      schema:
        type: string
        format: uri
      example: https://api.platyield.com/v1/jobs/job_7Hq2mT9xKpL4vB8nZ3rD
    Retry-After:
      description: Seconds to wait before polling the job (or, on `429`, before retrying).
      schema:
        type: integer
        minimum: 1
      example: 5

  responses:
    SubdivisionJobAccepted:
      description: The subdivision job was accepted. Poll `Location` or wait for the webhook.
      headers:
        Location:
          $ref: '#/components/headers/Location'
        Retry-After:
          $ref: '#/components/headers/Retry-After'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
        X-Request-Id:
          $ref: '#/components/headers/X-Request-Id'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Job'
          examples:
            queued:
              $ref: '#/components/examples/JobSubdivisionQueued'
    GradingPlanJobAccepted:
      description: The grading plan job was accepted. Poll `Location` or wait for the webhook.
      headers:
        Location:
          $ref: '#/components/headers/Location'
        Retry-After:
          $ref: '#/components/headers/Retry-After'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
        X-Request-Id:
          $ref: '#/components/headers/X-Request-Id'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Job'
          examples:
            queued:
              $ref: '#/components/examples/JobGradingQueued'
    CostEstimateJobAccepted:
      description: The cost estimate job was accepted. Poll `Location` or wait for the webhook.
      headers:
        Location:
          $ref: '#/components/headers/Location'
        Retry-After:
          $ref: '#/components/headers/Retry-After'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
        X-Request-Id:
          $ref: '#/components/headers/X-Request-Id'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Job'
          examples:
            queued:
              $ref: '#/components/examples/JobCostEstimateQueued'
    FeasibilityJobAccepted:
      description: The feasibility job was accepted. Poll `Location` or wait for the webhook.
      headers:
        Location:
          $ref: '#/components/headers/Location'
        Retry-After:
          $ref: '#/components/headers/Retry-After'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
        X-Request-Id:
          $ref: '#/components/headers/X-Request-Id'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Job'
          examples:
            queued:
              $ref: '#/components/examples/JobFeasibilityQueued'
    BadRequest:
      description: The request is malformed (invalid JSON, wrong types, missing required fields).
      headers:
        X-Request-Id:
          $ref: '#/components/headers/X-Request-Id'
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          examples:
            invalidRequest:
              $ref: '#/components/examples/ProblemInvalidRequest'
    Unauthorized:
      description: The API key is missing, malformed or revoked.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/X-Request-Id'
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          examples:
            unauthorized:
              $ref: '#/components/examples/ProblemUnauthorized'
    Forbidden:
      description: The key may not perform this request (for example a `pk_test_` key with a site that is not a sample site).
      headers:
        X-Request-Id:
          $ref: '#/components/headers/X-Request-Id'
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          examples:
            sandboxSiteOnly:
              $ref: '#/components/examples/ProblemSandboxSiteOnly'
    NotFound:
      description: The referenced job, pattern, grading plan or condition pack does not exist or belongs to another account.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/X-Request-Id'
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          examples:
            notFound:
              $ref: '#/components/examples/ProblemNotFound'
    IdempotencyConflict:
      description: The `Idempotency-Key` was already used with a different request body.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/X-Request-Id'
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          examples:
            conflict:
              $ref: '#/components/examples/ProblemIdempotencyConflict'
    UnprocessableContent:
      description: The request is well-formed but cannot be computed (site too large, invalid polygon, unknown condition pack, …).
      headers:
        X-Request-Id:
          $ref: '#/components/headers/X-Request-Id'
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          examples:
            siteTooLarge:
              $ref: '#/components/examples/ProblemSiteTooLarge'
            invalidGeometry:
              $ref: '#/components/examples/ProblemInvalidGeometry'
            elevationProviderUnavailable:
              $ref: '#/components/examples/ProblemProviderUnavailable'
    TooManyRequests:
      description: Rate limit exceeded. Retry after `Retry-After` seconds.
      headers:
        Retry-After:
          $ref: '#/components/headers/Retry-After'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
        X-Request-Id:
          $ref: '#/components/headers/X-Request-Id'
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          examples:
            rateLimited:
              $ref: '#/components/examples/ProblemRateLimited'
    InternalError:
      description: Unexpected server error. Safe to retry with the same `Idempotency-Key`.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/X-Request-Id'
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          examples:
            internal:
              $ref: '#/components/examples/ProblemInternal'

  schemas:
    # ------------------------------------------------------------------ GeoJSON (RFC 7946, WGS 84)
    Position:
      type: array
      description: '`[longitude, latitude]` in WGS 84 degrees, optionally followed by elevation in metres.'
      minItems: 2
      maxItems: 3
      items:
        type: number
      examples:
        - [-117.0412, 32.7768]
    Position3D:
      type: array
      description: '`[longitude, latitude, elevation]`. Elevation is in metres in requests and in the result `units` in responses.'
      minItems: 3
      maxItems: 3
      items:
        type: number
      examples:
        - [-117.0412, 32.7768, 151.2]
    LinearRing:
      type: array
      description: Closed ring of at least four positions; the first and last positions are identical.
      minItems: 4
      items:
        $ref: '#/components/schemas/Position'
    Polygon:
      type: object
      description: GeoJSON Polygon in WGS 84. The first ring is the outer boundary (counter-clockwise); further rings are holes.
      required: [type, coordinates]
      properties:
        type:
          type: string
          const: Polygon
        coordinates:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/LinearRing'
    Point:
      type: object
      description: GeoJSON Point in WGS 84.
      required: [type, coordinates]
      properties:
        type:
          type: string
          const: Point
        coordinates:
          $ref: '#/components/schemas/Position'
    LineString:
      type: object
      description: GeoJSON LineString in WGS 84.
      required: [type, coordinates]
      properties:
        type:
          type: string
          const: LineString
        coordinates:
          type: array
          minItems: 2
          items:
            $ref: '#/components/schemas/Position'
    FeatureCollection:
      type: object
      description: GeoJSON FeatureCollection. The typed collections below narrow `features` to one kind of feature.
      required: [type, features]
      properties:
        type:
          type: string
          const: FeatureCollection
        features:
          type: array
          items:
            type: object
            required: [type, geometry, properties]
            properties:
              type:
                type: string
                const: Feature
              id:
                type: [string, integer]
              geometry:
                type: object
              properties:
                type: [object, 'null']

    LotFeatureCollection:
      allOf:
        - $ref: '#/components/schemas/FeatureCollection'
        - type: object
          properties:
            features:
              type: array
              items:
                $ref: '#/components/schemas/LotFeature'
    LotFeature:
      type: object
      required: [type, geometry, properties]
      properties:
        type:
          type: string
          const: Feature
        id:
          type: string
          description: Same as `properties.lot_id`.
        geometry:
          $ref: '#/components/schemas/Polygon'
        properties:
          $ref: '#/components/schemas/LotProperties'
    LotProperties:
      type: object
      required: [lot_id, lot_no, area, frontage, is_flag_lot, is_usable]
      properties:
        lot_id:
          type: string
          description: Stable ID of the lot within its pattern.
          examples: [lot_01]
        lot_no:
          type: integer
          minimum: 1
          description: Lot number shown on plans, numbered from the main frontage.
        area:
          type: number
          description: Lot area in the result's area unit (m² or ft²).
        frontage:
          type: number
          description: Length of the lot's boundary on a road, in the result's length unit. For a flag lot, the width of the access strip (pole).
        depth:
          type: number
          description: Average depth measured perpendicular to the frontage, in the result's length unit.
        is_flag_lot:
          type: boolean
          description: True when the lot reaches the road only through a narrow access strip (flag or battle-axe lot).
        is_usable:
          type: boolean
          description: False when the lot does not satisfy `lot_rules` (for example the building footprint does not fit). Unusable lots are returned so you can see the remainder land, but are not counted in `usable_lot_count`.
        unusable_reason:
          type: [string, 'null']
          description: Warning code explaining why the lot is not usable, or `null`.
          examples: [BUILDING_FOOTPRINT_DOES_NOT_FIT]
        parking_spaces:
          type: integer
          minimum: 0
          description: Number of parking spaces placed on the lot.

    RoadFeatureCollection:
      allOf:
        - $ref: '#/components/schemas/FeatureCollection'
        - type: object
          properties:
            features:
              type: array
              items:
                $ref: '#/components/schemas/RoadFeature'
    RoadFeature:
      type: object
      required: [type, geometry, properties]
      properties:
        type:
          type: string
          const: Feature
        id:
          type: string
          description: Same as `properties.road_id`.
        geometry:
          $ref: '#/components/schemas/Polygon'
        properties:
          $ref: '#/components/schemas/RoadProperties'
    RoadProperties:
      type: object
      required: [road_id, kind, width, length, area]
      properties:
        road_id:
          type: string
          examples: [road_01]
        kind:
          type: string
          enum: [through, dead_end, turnaround]
          description: |
            - `through`: connects two points on existing roads.
            - `dead_end`: ends inside the site.
            - `turnaround`: the turning area at the end of a dead-end road (cul-de-sac bulb, hammerhead or turnaround bay, per the condition pack).
        width:
          type: number
          description: Right-of-way width in the result's length unit.
        length:
          type: number
          description: Centreline length in the result's length unit.
        area:
          type: number
          description: Area in the result's area unit.
        connects_to_frontage:
          type: array
          description: '`edge_index` values of the frontage roads this road connects to.'
          items:
            type: integer
            minimum: 0

    ParkingFeatureCollection:
      allOf:
        - $ref: '#/components/schemas/FeatureCollection'
        - type: object
          properties:
            features:
              type: array
              items:
                $ref: '#/components/schemas/ParkingFeature'
    ParkingFeature:
      type: object
      required: [type, geometry, properties]
      properties:
        type:
          type: string
          const: Feature
        id:
          type: string
        geometry:
          $ref: '#/components/schemas/Polygon'
        properties:
          $ref: '#/components/schemas/ParkingProperties'
    ParkingProperties:
      type: object
      required: [lot_id, space_no, width, length]
      properties:
        lot_id:
          type: string
          description: Lot the space belongs to.
        space_no:
          type: integer
          minimum: 1
        width:
          type: number
          description: Stall width in the result's length unit.
        length:
          type: number
          description: Stall length in the result's length unit.

    # ------------------------------------------------------------------ Common
    Units:
      type: string
      enum: [metric, imperial]
      default: metric
      description: |
        Unit system of the **result**. `metric`: m, m², m³. `imperial`: ft, ft², yd³ (US survey conversions
        are not used; 1 ft = 0.3048 m). Requests are always metric.
    UnitLabels:
      type: object
      description: Units used by every number in this result.
      required: [system, length, area, volume, elevation]
      properties:
        system:
          $ref: '#/components/schemas/Units'
        length:
          type: string
          enum: [m, ft]
        area:
          type: string
          enum: [m2, ft2]
        volume:
          type: string
          enum: [m3, yd3]
        elevation:
          type: string
          enum: [m, ft]
    ConditionPackRef:
      type: string
      description: |
        Condition pack ID: `<region>-<name>@<version>`, for example `us-generic@2027.1`. Without `@<version>`
        the latest published version is used, and the resolved version is echoed in the result. Pin the
        version in production to keep results reproducible.
      pattern: '^[a-z]{2}-[a-z0-9-]+(@\d{4}\.\d+)?$'
      examples: [us-generic@2027.1]
    ResolvedConditionPack:
      type: string
      description: Fully versioned condition pack ID that was actually used.
      pattern: '^[a-z]{2}-[a-z0-9-]+@\d{4}\.\d+$'
      examples: [us-generic@2027.1]
    ConditionPackOverrides:
      type: object
      description: |
        Override individual condition pack values for this request only. Keys are the parameter keys listed
        by `GET /condition-packs/{pack_id}` (for example `grading.max_road_grade_percent`); values must use the
        parameter's metric unit. Unknown keys are rejected with `422`. Fields of `lot_rules`, `road_rules` and
        `unit_prices` take precedence over overrides of the same value.
      propertyNames:
        pattern: '^[a-z_]+\.[a-z0-9_]+$'
      additionalProperties:
        type: [number, string, boolean]
      examples:
        - grading.max_road_grade_percent: 10
          road.max_dead_end_length_m: 150
    Frontage:
      type: object
      description: An existing road along one edge of the site.
      required: [edge_index, road_width_m]
      properties:
        edge_index:
          type: integer
          minimum: 0
          description: Index of the site edge that faces the road. Edge `i` runs from position `i` to position `i+1` of the outer ring.
        road_width_m:
          type: number
          exclusiveMinimum: 0
          description: Right-of-way width of the existing road, in metres.
    LotRules:
      type: object
      description: |
        Rules every usable lot must satisfy. Minimum area and frontage are set by zoning, so pass the values of
        the site's zoning district. Omitted fields take the condition pack's default.
      properties:
        min_lot_area_m2:
          type: number
          exclusiveMinimum: 0
          description: Minimum lot area in m².
        max_lot_area_m2:
          type: number
          exclusiveMinimum: 0
          description: Maximum lot area in m². Larger remainders are split or reported as unusable.
        min_frontage_m:
          type: number
          exclusiveMinimum: 0
          description: Minimum road frontage in metres (for flag lots, see `flag_pole_width_m`).
        min_building_width_m:
          type: number
          exclusiveMinimum: 0
          description: Width of the building footprint that must fit on the lot, in metres.
        min_building_depth_m:
          type: number
          exclusiveMinimum: 0
          description: Depth of the building footprint that must fit on the lot, in metres.
        setbacks_m:
          type: object
          description: |
            Front, side and rear setbacks in metres, used to check the building footprint.
            **Planned** — accepted but not yet evaluated by the early-access engine; a `SETBACKS_NOT_EVALUATED`
            warning is returned when supplied.
          properties:
            front:
              type: number
              minimum: 0
            side:
              type: number
              minimum: 0
            rear:
              type: number
              minimum: 0
        allow_flag_lots:
          type: boolean
          description: Allow lots that reach the road through a narrow access strip.
        flag_pole_width_m:
          type: number
          exclusiveMinimum: 0
          description: Width of the access strip of a flag lot, in metres.
        parking_spaces_per_lot:
          type: integer
          minimum: 0
          maximum: 2
          description: Off-street parking spaces to place on every lot.
        parking_space_size_m:
          type: object
          description: Stall size in metres.
          required: [width, length]
          properties:
            width:
              type: number
              exclusiveMinimum: 0
            length:
              type: number
              exclusiveMinimum: 0
      examples:
        - min_lot_area_m2: 465
          min_frontage_m: 12
          min_building_width_m: 9
          allow_flag_lots: true
          parking_spaces_per_lot: 2
    RoadRules:
      type: object
      description: Rules for new internal roads. Omitted fields take the condition pack's default.
      properties:
        internal_road_width_m:
          type: number
          exclusiveMinimum: 0
          description: Right-of-way width of new internal roads, in metres.
        allow_dead_end:
          type: boolean
          description: Allow dead-end roads. When `false`, only through roads are proposed.
        max_dead_end_length_m:
          type: number
          exclusiveMinimum: 0
          description: Longest dead-end road allowed, measured along the centreline, in metres.
        turnaround:
          type: string
          enum: [cul_de_sac, hammerhead, turnaround_bay]
          description: Shape of the turning area at the end of a dead-end road.
        cul_de_sac_radius_m:
          type: number
          exclusiveMinimum: 0
          description: Outer (right-of-way) radius of a cul-de-sac bulb, in metres.
        corner_cutoff_m:
          type: number
          minimum: 0
          description: Leg length of the corner cut-off (corner splay) where roads meet, in metres.
      examples:
        - internal_road_width_m: 15.2
          allow_dead_end: true
    ElevationInput:
      description: Existing ground. Choose one `source`.
      oneOf:
        - $ref: '#/components/schemas/ElevationFromPoints'
        - $ref: '#/components/schemas/ElevationFromGeotiff'
        - $ref: '#/components/schemas/ElevationFromProvider'
      discriminator:
        propertyName: source
        mapping:
          points: '#/components/schemas/ElevationFromPoints'
          geotiff_url: '#/components/schemas/ElevationFromGeotiff'
          provider: '#/components/schemas/ElevationFromProvider'
    ElevationFromPoints:
      type: object
      description: Survey spot heights. Points should cover the whole site and about 10 m beyond it; ground between points is interpolated.
      required: [source, points]
      properties:
        source:
          type: string
          const: points
        points:
          type: array
          minItems: 10
          maxItems: 100000
          description: Spot heights as `[longitude, latitude, elevation_m]`.
          items:
            $ref: '#/components/schemas/Position3D'
        vertical_datum:
          type: string
          description: Vertical datum of the elevations (for example `NAVD88`, `AHD`). Informational; echoed in the result.
    ElevationFromGeotiff:
      type: object
      description: A georeferenced single-band GeoTIFF DEM in metres, reachable by HTTPS GET (a pre-signed URL is fine). Up to 200 MB; resolution of 1 m or finer recommended.
      required: [source, geotiff_url]
      properties:
        source:
          type: string
          const: geotiff_url
        geotiff_url:
          type: string
          format: uri
          pattern: '^https://'
        vertical_datum:
          type: string
          description: Vertical datum of the elevations. Informational; echoed in the result.
    ElevationFromProvider:
      type: object
      description: |
        Use the public DEM defined by the condition pack (`elevation.provider`). Returns `422`
        `ELEVATION_PROVIDER_UNAVAILABLE` when the pack has no provider yet.
      required: [source]
      properties:
        source:
          type: string
          const: provider
    Warning:
      type: object
      description: |
        A non-fatal issue with the result. `code` is stable and machine-readable; `message` is for humans and
        may change. Codes currently defined:

        | Code | Meaning |
        |---|---|
        | `TURNAROUND_UNAVAILABLE` | A dead-end road was needed but no turnaround of the required shape fits. |
        | `DEAD_END_TOO_LONG` | The only feasible road layout exceeds `max_dead_end_length_m`. |
        | `LOT_BELOW_MIN_AREA` | A lot is smaller than `min_lot_area_m2` and was marked unusable. |
        | `BUILDING_FOOTPRINT_DOES_NOT_FIT` | The building footprint does not fit on a lot; the lot was marked unusable. |
        | `PARKING_NOT_PLACED` | Fewer parking spaces than `parking_spaces_per_lot` fit on a lot. |
        | `TARGET_LOT_COUNT_NOT_REACHED` | No layout reaches `target_lot_count`; the closest patterns are returned. |
        | `SETBACKS_NOT_EVALUATED` | `setbacks_m` was supplied but is not evaluated yet. |
        | `ROAD_GRADE_EXCEEDED` | A road segment is steeper than `grading.max_road_grade_percent`. |
        | `WALL_HEIGHT_EXCEEDED` | A retaining wall is taller than `max_wall_height_m`. |
        | `WALL_REQUIRES_ENGINEERING` | A retaining wall is taller than the pack's height that requires engineered design. |
        | `DRAINAGE_OUTFALL_UNREACHABLE` | Storm drainage cannot reach an outfall by gravity at the minimum slope. |
        | `ELEVATION_COVERAGE_LOW` | Elevation input covers the site sparsely; heights were extrapolated. |
        | `PACK_VALUES_UNREVIEWED` | The condition pack contains values not yet reviewed by local engineers. |
        | `PACK_DEFAULT_PRICE_USED` | At least one line item uses the pack's reference unit price. |
        | `OPEN_SPACE_BELOW_MINIMUM` | Open space is below the pack's required share of the site. |
      required: [code, message]
      properties:
        code:
          type: string
          pattern: '^[A-Z][A-Z0-9_]*$'
          examples: [TURNAROUND_UNAVAILABLE]
        message:
          type: string
        target:
          type: [string, 'null']
          description: ID of the feature the warning is about (`lot_id`, `road_id`, `wall_id`), or `null` for the whole result.
    Metadata:
      type: object
      description: Up to 20 string key/value pairs of your own (for example your parcel ID). Echoed on the job and in webhooks.
      maxProperties: 20
      additionalProperties:
        type: string
        maxLength: 500
      examples:
        - parcel_id: APN-490-221-17
    WebhookUrl:
      type: string
      format: uri
      pattern: '^https://'
      description: HTTPS URL that receives the `jobCompleted` webhook for this job.

    # ------------------------------------------------------------------ Requests
    SubdivisionRequest:
      type: object
      required: [condition_pack, site, frontage]
      properties:
        condition_pack:
          $ref: '#/components/schemas/ConditionPackRef'
        overrides:
          $ref: '#/components/schemas/ConditionPackOverrides'
        site:
          $ref: '#/components/schemas/Polygon'
        frontage:
          type: array
          minItems: 1
          description: Existing roads the site faces. At least one is required.
          items:
            $ref: '#/components/schemas/Frontage'
        lot_rules:
          $ref: '#/components/schemas/LotRules'
        road_rules:
          $ref: '#/components/schemas/RoadRules'
        target_lot_count:
          type: [integer, 'null']
          minimum: 1
          description: Ask for exactly this many usable lots (frontage may be reduced toward its minimum to reach it). `null` maximises the lot count.
        max_patterns:
          type: integer
          minimum: 1
          maximum: 10
          default: 5
          description: Maximum number of alternative patterns to return.
        units:
          $ref: '#/components/schemas/Units'
        webhook_url:
          $ref: '#/components/schemas/WebhookUrl'
        metadata:
          $ref: '#/components/schemas/Metadata'
    GradingOptions:
      type: object
      properties:
        max_wall_height_m:
          type: number
          exclusiveMinimum: 0
          description: Tallest retaining wall the plan may use, in metres. Taller walls produce `WALL_HEIGHT_EXCEEDED`.
        allow_soil_stabilization:
          type: boolean
          default: false
          description: Allow soil stabilisation in fill areas instead of importing select fill.
        balance_earthwork:
          type: boolean
          default: true
          description: Prefer pad heights that balance cut and fill on site over minimising wall height.
    GradingPlanRequest:
      type: object
      required: [condition_pack, subdivision_pattern_id, elevation]
      properties:
        condition_pack:
          $ref: '#/components/schemas/ConditionPackRef'
        overrides:
          $ref: '#/components/schemas/ConditionPackOverrides'
        subdivision_pattern_id:
          type: string
          pattern: '^pat_[A-Za-z0-9]+$'
          description: '`pattern_id` from a succeeded subdivision job of your account.'
        elevation:
          $ref: '#/components/schemas/ElevationInput'
        drainage_outfalls:
          type: array
          description: Points where storm drainage may discharge (existing inlets, culverts, channels). When empty, the lowest frontage point is used.
          items:
            $ref: '#/components/schemas/Point'
        options:
          $ref: '#/components/schemas/GradingOptions'
        units:
          $ref: '#/components/schemas/Units'
        webhook_url:
          $ref: '#/components/schemas/WebhookUrl'
        metadata:
          $ref: '#/components/schemas/Metadata'
    UnitPrices:
      type: object
      description: |
        Your unit prices in `currency`, always per **metric** unit. Omitted prices fall back to the condition
        pack's reference prices and are flagged `price_source: pack_default`.
      additionalProperties: false
      properties:
        earthwork_cut_per_m3:
          type: number
          minimum: 0
          description: Excavation, per m³ in place.
        earthwork_fill_per_m3:
          type: number
          minimum: 0
          description: Placing and compacting fill, per m³ compacted.
        soil_export_per_m3:
          type: number
          minimum: 0
          description: Hauling and disposal of surplus soil, per m³.
        soil_import_per_m3:
          type: number
          minimum: 0
          description: Imported fill material delivered, per m³.
        retaining_wall_per_m2:
          type: object
          description: |
            Retaining wall price per m² of exposed face, by height band. Keys are `"<from>-<to>"` in metres
            (`to` may be empty for the top band, e.g. `"2.4-"`). Bands must not overlap.
          propertyNames:
            pattern: '^\d+(\.\d+)?-(\d+(\.\d+)?)?$'
          additionalProperties:
            type: number
            minimum: 0
        wall_foundation_per_m:
          type: number
          minimum: 0
          description: Retaining wall footing, per metre of wall.
        road_pavement_per_m2:
          type: number
          minimum: 0
          description: Road pavement including base course, per m².
        curb_and_gutter_per_m:
          type: number
          minimum: 0
          description: Curb and gutter, per metre.
        storm_drain_pipe_per_m:
          type: number
          minimum: 0
          description: Storm drain pipe including trenching, per metre.
        storm_drain_inlet_each:
          type: number
          minimum: 0
          description: Storm drain inlet or catch basin, each.
    CostEstimateRequest:
      type: object
      required: [condition_pack, grading_plan_id, currency]
      properties:
        condition_pack:
          $ref: '#/components/schemas/ConditionPackRef'
        overrides:
          $ref: '#/components/schemas/ConditionPackOverrides'
        grading_plan_id:
          type: string
          pattern: '^grd_[A-Za-z0-9]+$'
          description: '`grading_plan_id` from a succeeded grading plan job of your account.'
        currency:
          type: string
          pattern: '^[A-Z]{3}$'
          description: ISO 4217 currency of `unit_prices` and of the result. Must match the condition pack's currency when any pack reference price is used.
          examples: [USD]
        unit_prices:
          $ref: '#/components/schemas/UnitPrices'
        units:
          $ref: '#/components/schemas/Units'
        webhook_url:
          $ref: '#/components/schemas/WebhookUrl'
        metadata:
          $ref: '#/components/schemas/Metadata'
    FeasibilityRequest:
      type: object
      description: The fields of `POST /subdivisions`, `POST /grading-plans` and `POST /cost-estimates` in one body.
      required: [condition_pack, site, frontage, elevation, currency]
      properties:
        condition_pack:
          $ref: '#/components/schemas/ConditionPackRef'
        overrides:
          $ref: '#/components/schemas/ConditionPackOverrides'
        site:
          $ref: '#/components/schemas/Polygon'
        frontage:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/Frontage'
        lot_rules:
          $ref: '#/components/schemas/LotRules'
        road_rules:
          $ref: '#/components/schemas/RoadRules'
        target_lot_count:
          type: [integer, 'null']
          minimum: 1
        max_patterns:
          type: integer
          minimum: 1
          maximum: 10
          default: 5
        elevation:
          $ref: '#/components/schemas/ElevationInput'
        drainage_outfalls:
          type: array
          items:
            $ref: '#/components/schemas/Point'
        grading_options:
          $ref: '#/components/schemas/GradingOptions'
        currency:
          type: string
          pattern: '^[A-Z]{3}$'
        unit_prices:
          $ref: '#/components/schemas/UnitPrices'
        units:
          $ref: '#/components/schemas/Units'
        webhook_url:
          $ref: '#/components/schemas/WebhookUrl'
        metadata:
          $ref: '#/components/schemas/Metadata'

    # ------------------------------------------------------------------ Results
    SubdivisionPattern:
      type: object
      required: [pattern_id, label, lot_count, usable_lot_count, lots, roads, parking, warnings]
      properties:
        pattern_id:
          type: string
          pattern: '^pat_[A-Za-z0-9]+$'
        rank:
          type: integer
          minimum: 1
          description: 1 = best pattern (most usable lots, then fewer flag lots and shorter roads).
        label:
          type: string
          description: Short description of the road layout, for example `through-road`, `dead-end`, `frontage-only` (no internal road).
        lot_count:
          type: integer
          minimum: 0
        usable_lot_count:
          type: integer
          minimum: 0
          description: Lots that satisfy `lot_rules`.
        flag_lot_count:
          type: integer
          minimum: 0
        total_lot_area:
          type: number
        road_area:
          type: number
        lots:
          $ref: '#/components/schemas/LotFeatureCollection'
        roads:
          $ref: '#/components/schemas/RoadFeatureCollection'
        parking:
          $ref: '#/components/schemas/ParkingFeatureCollection'
        warnings:
          type: array
          items:
            $ref: '#/components/schemas/Warning'
    SubdivisionResult:
      type: object
      required: [subdivision_id, engine_version, condition_pack, units, site_area, patterns, warnings]
      properties:
        subdivision_id:
          type: string
          pattern: '^sub_[A-Za-z0-9]+$'
        engine_version:
          $ref: '#/components/schemas/EngineVersion'
        condition_pack:
          $ref: '#/components/schemas/ResolvedConditionPack'
        units:
          $ref: '#/components/schemas/UnitLabels'
        site_area:
          type: number
          description: Site area in the result's area unit.
        patterns:
          type: array
          description: Alternative patterns, best first.
          items:
            $ref: '#/components/schemas/SubdivisionPattern'
        warnings:
          type: array
          description: Warnings that apply to the whole request.
          items:
            $ref: '#/components/schemas/Warning'

    GradedLotFeature:
      type: object
      required: [type, geometry, properties]
      properties:
        type:
          type: string
          const: Feature
        id:
          type: string
        geometry:
          $ref: '#/components/schemas/Polygon'
        properties:
          type: object
          required: [lot_id, lot_no, finished_height, existing_height_mean, cut_volume, fill_volume]
          properties:
            lot_id:
              type: string
            lot_no:
              type: integer
            finished_height:
              type: number
              description: Finished pad elevation of the lot, in the result's elevation unit and in the vertical datum of the elevation input.
            existing_height_mean:
              type: number
              description: Mean existing ground elevation over the lot.
            cut_volume:
              type: number
            fill_volume:
              type: number
    RetainingWallFeature:
      type: object
      required: [type, geometry, properties]
      properties:
        type:
          type: string
          const: Feature
        id:
          type: string
        geometry:
          $ref: '#/components/schemas/LineString'
        properties:
          type: object
          required: [wall_id, max_height, length, face_area, requires_engineering]
          properties:
            wall_id:
              type: string
            max_height:
              type: number
              description: Tallest exposed height along the wall.
            mean_height:
              type: number
            length:
              type: number
            face_area:
              type: number
              description: Exposed face area, used for pricing.
            height_band:
              type: string
              description: Height band of the condition pack the wall is priced in, in metres (`"1.2-2.4"`).
            requires_engineering:
              type: boolean
              description: True when `max_height` exceeds the pack's height that requires an engineered design.
            retains_side:
              type: string
              enum: [left, right]
              description: Side of the line (in its drawing direction) that is the higher ground.
    DrainagePipeFeature:
      type: object
      required: [type, geometry, properties]
      properties:
        type:
          type: string
          const: Feature
        id:
          type: string
        geometry:
          $ref: '#/components/schemas/LineString'
        properties:
          type: object
          required: [pipe_id, length, slope_percent]
          properties:
            pipe_id:
              type: string
            length:
              type: number
            slope_percent:
              type: number
            invert_start:
              type: number
              description: Invert elevation at the upstream end.
            invert_end:
              type: number
              description: Invert elevation at the downstream end.
            outfall_index:
              type: [integer, 'null']
              description: Index in `drainage_outfalls` the pipe discharges to, or `null` for the frontage.
    RoadProfile:
      type: object
      description: Longitudinal profile of a road centreline.
      required: [road_id, max_grade_percent, stations]
      properties:
        road_id:
          type: string
        max_grade_percent:
          type: number
        stations:
          type: array
          minItems: 2
          items:
            type: object
            required: [distance, existing_elevation, finished_elevation]
            properties:
              distance:
                type: number
                description: Distance along the centreline from the road's start.
              existing_elevation:
                type: number
              finished_elevation:
                type: number
              grade_percent:
                type: number
                description: Grade from this station to the next (positive = uphill in drawing direction).
    Earthwork:
      type: object
      required: [cut_volume, fill_volume, net_volume, export_volume, import_volume]
      properties:
        cut_volume:
          type: number
          description: Excavation volume in place.
        fill_volume:
          type: number
          description: Fill volume compacted.
        net_volume:
          type: number
          description: '`cut_volume - fill_volume` after the pack''s shrink/swell factors. Positive = surplus.'
        export_volume:
          type: number
          description: Surplus soil to haul off site.
        import_volume:
          type: number
          description: Fill to bring to site.
    SurfaceMesh:
      type: object
      required: [geotiff_url, gltf_url]
      properties:
        geotiff_url:
          type: string
          format: uri
          description: Elevation raster (GeoTIFF, EPSG:4326, metres).
        gltf_url:
          type: string
          format: uri
          description: 3D mesh (binary glTF) for viewers, in a local metric frame centred on the site.
    GradingResult:
      type: object
      required: [grading_plan_id, subdivision_pattern_id, engine_version, condition_pack, units, lots, retaining_walls, road_profiles, earthwork, meshes, warnings]
      properties:
        grading_plan_id:
          type: string
          pattern: '^grd_[A-Za-z0-9]+$'
        subdivision_pattern_id:
          type: string
        engine_version:
          $ref: '#/components/schemas/EngineVersion'
        condition_pack:
          $ref: '#/components/schemas/ResolvedConditionPack'
        units:
          $ref: '#/components/schemas/UnitLabels'
        vertical_datum:
          type: [string, 'null']
          description: Echo of the elevation input's `vertical_datum`.
        lots:
          type: object
          required: [type, features]
          properties:
            type:
              type: string
              const: FeatureCollection
            features:
              type: array
              items:
                $ref: '#/components/schemas/GradedLotFeature'
        retaining_walls:
          type: object
          required: [type, features]
          properties:
            type:
              type: string
              const: FeatureCollection
            features:
              type: array
              items:
                $ref: '#/components/schemas/RetainingWallFeature'
        drainage_pipes:
          type: object
          required: [type, features]
          properties:
            type:
              type: string
              const: FeatureCollection
            features:
              type: array
              items:
                $ref: '#/components/schemas/DrainagePipeFeature'
        road_profiles:
          type: array
          items:
            $ref: '#/components/schemas/RoadProfile'
        earthwork:
          $ref: '#/components/schemas/Earthwork'
        meshes:
          type: object
          description: Download links for the existing and finished surfaces. Links expire after `expires_at`; fetch the job again for fresh links.
          required: [existing, finished, expires_at]
          properties:
            existing:
              $ref: '#/components/schemas/SurfaceMesh'
            finished:
              $ref: '#/components/schemas/SurfaceMesh'
            expires_at:
              type: string
              format: date-time
        warnings:
          type: array
          items:
            $ref: '#/components/schemas/Warning'

    PriceSource:
      type: string
      enum: [caller, pack_default]
      description: '`caller`: from your `unit_prices`. `pack_default`: the condition pack''s reference price — an indication, not a quote.'
    WorkType:
      type: string
      enum: [earthwork, soil_export, soil_import, retaining_walls, wall_foundations, roads, drainage]
    CostLineItem:
      type: object
      required: [work_type, item, quantity, unit, unit_price, amount, price_source]
      properties:
        work_type:
          $ref: '#/components/schemas/WorkType'
        item:
          type: string
          description: Line item key (matches the `unit_prices` field it is priced with, or a wall height band).
          examples: [earthwork_cut]
        description:
          type: string
        quantity:
          type: number
        unit:
          type: string
          description: Unit of `quantity` (`m3`, `yd3`, `m2`, `ft2`, `m`, `ft`, `each`).
        unit_price:
          type: number
          description: Price per `unit`, converted from the metric unit price when `units` is `imperial`.
        amount:
          type: number
        price_source:
          $ref: '#/components/schemas/PriceSource'
    CostEstimate:
      type: object
      required: [cost_estimate_id, grading_plan_id, engine_version, condition_pack, units, currency, line_items, totals_by_work_type, total, per_lot, price_source, warnings]
      properties:
        cost_estimate_id:
          type: string
          pattern: '^est_[A-Za-z0-9]+$'
        grading_plan_id:
          type: string
        engine_version:
          $ref: '#/components/schemas/EngineVersion'
        condition_pack:
          $ref: '#/components/schemas/ResolvedConditionPack'
        units:
          $ref: '#/components/schemas/UnitLabels'
        currency:
          type: string
          pattern: '^[A-Z]{3}$'
        line_items:
          type: array
          items:
            $ref: '#/components/schemas/CostLineItem'
        totals_by_work_type:
          type: array
          items:
            type: object
            required: [work_type, amount]
            properties:
              work_type:
                $ref: '#/components/schemas/WorkType'
              amount:
                type: number
        total:
          type: number
          description: Total site-work cost (sum of `line_items`), excluding tax, fees and contingency.
        per_lot:
          type: object
          required: [usable_lot_count, cost_per_lot]
          properties:
            usable_lot_count:
              type: integer
            cost_per_lot:
              type: [number, 'null']
              description: '`total / usable_lot_count`, or `null` when there are no usable lots.'
            lots:
              type: array
              description: Cost allocated to each lot (earthwork and walls on the lot, plus a share of roads and drainage by area).
              items:
                type: object
                required: [lot_id, amount]
                properties:
                  lot_id:
                    type: string
                  amount:
                    type: number
        price_source:
          type: string
          enum: [caller, pack_default, mixed]
          description: Summary of the line items' `price_source`. `mixed` when both are present.
        documents:
          type: object
          description: Downloadable estimate documents. Links expire after `expires_at`.
          properties:
            xlsx_url:
              type: string
              format: uri
            pdf_url:
              type: string
              format: uri
            dxf_url:
              type: string
              format: uri
              description: Plan drawing of lots, roads and retaining walls.
            expires_at:
              type: string
              format: date-time
        warnings:
          type: array
          items:
            $ref: '#/components/schemas/Warning'

    FeasibilityOption:
      type: object
      required: [pattern_id, label, lot_count, usable_lot_count, grading_plan_id, cost_estimate_id, earthwork, retaining_wall_length, total_cost, cost_per_lot, warning_codes]
      properties:
        pattern_id:
          type: string
        label:
          type: string
        lot_count:
          type: integer
        usable_lot_count:
          type: integer
        grading_plan_id:
          type: string
        cost_estimate_id:
          type: string
        earthwork:
          $ref: '#/components/schemas/Earthwork'
        retaining_wall_length:
          type: number
        retaining_wall_max_height:
          type: number
        total_cost:
          type: number
        cost_per_lot:
          type: [number, 'null']
        warning_codes:
          type: array
          description: Codes of all warnings raised for this option in subdivision, grading and estimation.
          items:
            type: string
    FeasibilityResult:
      type: object
      required: [feasibility_id, engine_version, condition_pack, units, currency, price_source, options, subdivision, grading_plans, cost_estimates]
      properties:
        feasibility_id:
          type: string
          pattern: '^fea_[A-Za-z0-9]+$'
        engine_version:
          $ref: '#/components/schemas/EngineVersion'
        condition_pack:
          $ref: '#/components/schemas/ResolvedConditionPack'
        units:
          $ref: '#/components/schemas/UnitLabels'
        currency:
          type: string
        price_source:
          type: string
          enum: [caller, pack_default, mixed]
        options:
          type: array
          description: One option per subdivision pattern, ordered by `usable_lot_count` (descending), then `cost_per_lot` (ascending).
          items:
            $ref: '#/components/schemas/FeasibilityOption'
        subdivision:
          $ref: '#/components/schemas/SubdivisionResult'
        grading_plans:
          type: array
          description: Full grading result of every option.
          items:
            $ref: '#/components/schemas/GradingResult'
        cost_estimates:
          type: array
          description: Full cost estimate of every option.
          items:
            $ref: '#/components/schemas/CostEstimate'

    EngineVersion:
      type: string
      description: Version of the computation engine that produced the result.
      examples: [2027.02.1]

    # ------------------------------------------------------------------ Jobs
    JobStatus:
      type: string
      enum: [queued, running, succeeded, failed]
    JobBase:
      type: object
      required: [id, object, type, status, environment, created_at]
      properties:
        id:
          type: string
          pattern: '^job_[A-Za-z0-9]{20,}$'
        object:
          type: string
          const: job
        type:
          type: string
          enum: [subdivision, grading_plan, cost_estimate, feasibility]
        status:
          $ref: '#/components/schemas/JobStatus'
        environment:
          type: string
          enum: [live, test]
        condition_pack:
          $ref: '#/components/schemas/ResolvedConditionPack'
        engine_version:
          oneOf:
            - $ref: '#/components/schemas/EngineVersion'
            - type: 'null'
        created_at:
          type: string
          format: date-time
        started_at:
          type: [string, 'null']
          format: date-time
        completed_at:
          type: [string, 'null']
          format: date-time
        metadata:
          $ref: '#/components/schemas/Metadata'
        error:
          description: Why the job failed. Present only when `status` is `failed`.
          oneOf:
            - $ref: '#/components/schemas/Problem'
            - type: 'null'
    Job:
      description: |
        A computation. `result` is `null` until `status` is `succeeded`; its shape depends on `type`.
      oneOf:
        - $ref: '#/components/schemas/SubdivisionJob'
        - $ref: '#/components/schemas/GradingPlanJob'
        - $ref: '#/components/schemas/CostEstimateJob'
        - $ref: '#/components/schemas/FeasibilityJob'
      discriminator:
        propertyName: type
        mapping:
          subdivision: '#/components/schemas/SubdivisionJob'
          grading_plan: '#/components/schemas/GradingPlanJob'
          cost_estimate: '#/components/schemas/CostEstimateJob'
          feasibility: '#/components/schemas/FeasibilityJob'
    SubdivisionJob:
      allOf:
        - $ref: '#/components/schemas/JobBase'
        - type: object
          required: [result]
          properties:
            type:
              const: subdivision
            result:
              oneOf:
                - $ref: '#/components/schemas/SubdivisionResult'
                - type: 'null'
    GradingPlanJob:
      allOf:
        - $ref: '#/components/schemas/JobBase'
        - type: object
          required: [result]
          properties:
            type:
              const: grading_plan
            result:
              oneOf:
                - $ref: '#/components/schemas/GradingResult'
                - type: 'null'
    CostEstimateJob:
      allOf:
        - $ref: '#/components/schemas/JobBase'
        - type: object
          required: [result]
          properties:
            type:
              const: cost_estimate
            result:
              oneOf:
                - $ref: '#/components/schemas/CostEstimate'
                - type: 'null'
    FeasibilityJob:
      allOf:
        - $ref: '#/components/schemas/JobBase'
        - type: object
          required: [result]
          properties:
            type:
              const: feasibility
            result:
              oneOf:
                - $ref: '#/components/schemas/FeasibilityResult'
                - type: 'null'

    WebhookEvent:
      type: object
      required: [id, object, type, created_at, data]
      properties:
        id:
          type: string
          pattern: '^evt_[A-Za-z0-9]+$'
          description: Unique event ID; use it to de-duplicate deliveries.
        object:
          type: string
          const: event
        type:
          type: string
          enum: [job.succeeded, job.failed]
        created_at:
          type: string
          format: date-time
        data:
          type: object
          required: [job]
          properties:
            job:
              $ref: '#/components/schemas/Job'

    # ------------------------------------------------------------------ Condition packs
    ConditionPackParameter:
      type: object
      required: [key, value, unit, review_status]
      properties:
        key:
          type: string
          description: Key to use in `overrides`.
          pattern: '^[a-z_]+\.[a-z0-9_]+$'
        value:
          description: The default value. Height bands and price tables are objects.
          type: [number, string, boolean, object]
        unit:
          type: [string, 'null']
          description: Metric unit of `value` (`m`, `m2`, `percent`, `USD/m3`, …), or `null` when unitless.
        description:
          type: string
        source:
          type: [string, 'null']
          description: Where the value comes from (standard, guideline or survey), or `null` when it is an engineering assumption.
        review_status:
          type: string
          enum: [reviewed, unreviewed]
          description: '`reviewed` once checked by a licensed local engineer. Results that rely on `unreviewed` values carry `PACK_VALUES_UNREVIEWED`.'
    ConditionPackSummary:
      type: object
      required: [id, name, version, region, status, currency, description]
      properties:
        id:
          $ref: '#/components/schemas/ResolvedConditionPack'
        name:
          type: string
          examples: [us-generic]
        version:
          type: string
          pattern: '^\d{4}\.\d+$'
        region:
          type: string
          description: ISO 3166-1 alpha-2 country code, optionally with a subdivision code (`AU-NSW`).
          pattern: '^[A-Z]{2}(-[A-Z0-9]{1,3})?$'
        status:
          type: string
          enum: [preview, stable, superseded]
          description: '`preview`: values are reference defaults still under review. `stable`: reviewed. `superseded`: a newer version exists.'
        currency:
          type: string
          pattern: '^[A-Z]{3}$'
        description:
          type: string
        published_at:
          type: string
          format: date
    ConditionPack:
      allOf:
        - $ref: '#/components/schemas/ConditionPackSummary'
        - type: object
          required: [parameters]
          properties:
            parameters:
              type: array
              description: Every value of the pack, grouped by key prefix (`coordinates`, `elevation`, `road`, `lot`, `grading`, `cost`, `checks`).
              items:
                $ref: '#/components/schemas/ConditionPackParameter'
    ConditionPackList:
      type: object
      required: [data]
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/ConditionPackSummary'

    # ------------------------------------------------------------------ Usage
    Usage:
      type: object
      required: [period, environment, jobs, site_area_m2, limits]
      properties:
        period:
          type: object
          required: [start, end]
          properties:
            start:
              type: string
              format: date
            end:
              type: string
              format: date
        environment:
          type: string
          enum: [live, test]
        jobs:
          type: object
          description: Succeeded jobs by type. Failed jobs are not counted.
          required: [subdivision, grading_plan, cost_estimate, feasibility]
          properties:
            subdivision:
              type: integer
            grading_plan:
              type: integer
            cost_estimate:
              type: integer
            feasibility:
              type: integer
        site_area_m2:
          type: number
          description: Total site area of succeeded subdivision and feasibility jobs, in m².
        limits:
          type: object
          required: [monthly_jobs, remaining_jobs]
          properties:
            monthly_jobs:
              type: [integer, 'null']
              description: Jobs included per month, or `null` when unlimited.
            remaining_jobs:
              type: [integer, 'null']
            rate_limit_per_minute:
              type: integer

    # ------------------------------------------------------------------ Errors
    Problem:
      type: object
      description: RFC 9457 problem details.
      required: [type, title, status, code]
      properties:
        type:
          type: string
          format: uri
          description: URI identifying the problem type; opens the documentation of the error.
        title:
          type: string
          description: Short summary of the problem type.
        status:
          type: integer
          description: HTTP status code.
        detail:
          type: string
          description: Explanation specific to this occurrence.
        instance:
          type: string
          description: Path of the request or job that failed.
        code:
          type: string
          pattern: '^[A-Z][A-Z0-9_]*$'
          description: |
            Stable machine-readable error code: `INVALID_REQUEST`, `UNAUTHORIZED`, `SANDBOX_SITE_ONLY`,
            `ENVIRONMENT_MISMATCH`, `NOT_FOUND`, `IDEMPOTENCY_CONFLICT`, `SITE_TOO_LARGE`, `INVALID_GEOMETRY`,
            `UNKNOWN_CONDITION_PACK`, `UNKNOWN_OVERRIDE`, `ELEVATION_PROVIDER_UNAVAILABLE`, `ELEVATION_FETCH_FAILED`,
            `NO_FEASIBLE_LAYOUT`, `RATE_LIMITED`, `QUOTA_EXCEEDED`, `INTERNAL_ERROR`.
        request_id:
          type: string
        errors:
          type: array
          description: Field-level validation errors.
          items:
            type: object
            required: [pointer, message]
            properties:
              pointer:
                type: string
                description: JSON Pointer (RFC 6901) to the offending field in the request body.
              message:
                type: string

  examples:
    # ------------------------------------------------------------------ Requests
    SubdivisionRequestHillside:
      summary: 0.96 ha hillside site, one frontage road, US defaults with zoning values
      value:
        condition_pack: us-generic@2027.1
        site:
          type: Polygon
          coordinates:
            - - [-117.04120, 32.77680]
              - [-117.04010, 32.77678]
              - [-117.04005, 32.77765]
              - [-117.04070, 32.77790]
              - [-117.04125, 32.77760]
              - [-117.04120, 32.77680]
        frontage:
          - edge_index: 0
            road_width_m: 15.2
        lot_rules:
          min_lot_area_m2: 465
          min_frontage_m: 12
          min_building_width_m: 9
          allow_flag_lots: true
          parking_spaces_per_lot: 2
        road_rules:
          internal_road_width_m: 15.2
          allow_dead_end: true
        target_lot_count: null
        max_patterns: 5
        units: imperial
        webhook_url: https://example.com/hooks/platyield
        metadata:
          parcel_id: APN-490-221-17
    GradingPlanRequestPoints:
      summary: Grade the best pattern using survey spot heights
      value:
        condition_pack: us-generic@2027.1
        subdivision_pattern_id: pat_4Rk8wN2qXe
        elevation:
          source: points
          vertical_datum: NAVD88
          points:
            - [-117.04130, 32.77672, 148.6]
            - [-117.04065, 32.77671, 149.9]
            - [-117.04000, 32.77670, 151.3]
            - [-117.04132, 32.77725, 153.8]
            - [-117.04062, 32.77722, 155.0]
            - [-117.03998, 32.77720, 156.2]
            - [-117.04134, 32.77770, 159.4]
            - [-117.04070, 32.77768, 160.1]
            - [-117.03997, 32.77772, 161.0]
            - [-117.04072, 32.77798, 163.7]
            - [-117.04020, 32.77790, 162.5]
            - [-117.04118, 32.77790, 162.9]
        drainage_outfalls:
          - type: Point
            coordinates: [-117.04018, 32.77679]
        options:
          max_wall_height_m: 3.0
          allow_soil_stabilization: false
        units: imperial
    GradingPlanRequestGeotiff:
      summary: Grade a pattern using a DEM file
      value:
        condition_pack: us-generic@2027.1
        subdivision_pattern_id: pat_4Rk8wN2qXe
        elevation:
          source: geotiff_url
          geotiff_url: https://example.com/dem/site-0412-1m.tif
          vertical_datum: NAVD88
        options:
          max_wall_height_m: 2.4
        units: metric
    CostEstimateRequestUsd:
      summary: Price a grading plan with the caller's own unit prices (USD)
      value:
        condition_pack: us-generic@2027.1
        grading_plan_id: grd_9Tm3cV7yLb
        currency: USD
        unit_prices:
          earthwork_cut_per_m3: 18.0
          earthwork_fill_per_m3: 14.5
          soil_export_per_m3: 32.0
          retaining_wall_per_m2:
            0-1.2: 350
            1.2-2.4: 520
            2.4-: 780
          road_pavement_per_m2: 62.0
          storm_drain_pipe_per_m: 210.0
        units: imperial
    FeasibilityRequestHillside:
      summary: How many lots, and what does the site work cost? (0.96 ha hillside site)
      value:
        condition_pack: us-generic@2027.1
        site:
          type: Polygon
          coordinates:
            - - [-117.04120, 32.77680]
              - [-117.04010, 32.77678]
              - [-117.04005, 32.77765]
              - [-117.04070, 32.77790]
              - [-117.04125, 32.77760]
              - [-117.04120, 32.77680]
        frontage:
          - edge_index: 0
            road_width_m: 15.2
        lot_rules:
          min_lot_area_m2: 465
          min_frontage_m: 12
          allow_flag_lots: true
          parking_spaces_per_lot: 2
        road_rules:
          internal_road_width_m: 15.2
        max_patterns: 3
        elevation:
          source: geotiff_url
          geotiff_url: https://example.com/dem/site-0412-1m.tif
          vertical_datum: NAVD88
        currency: USD
        unit_prices:
          earthwork_cut_per_m3: 18.0
          earthwork_fill_per_m3: 14.5
          soil_export_per_m3: 32.0
          retaining_wall_per_m2:
            0-1.2: 350
            1.2-2.4: 520
            2.4-: 780
        units: imperial
        webhook_url: https://example.com/hooks/platyield

    # ------------------------------------------------------------------ Jobs
    JobSubdivisionQueued:
      summary: Subdivision job accepted
      value:
        id: job_7Hq2mT9xKpL4vB8nZ3rD
        object: job
        type: subdivision
        status: queued
        environment: live
        condition_pack: us-generic@2027.1
        engine_version: null
        created_at: '2027-02-28T09:03:12Z'
        started_at: null
        completed_at: null
        metadata:
          parcel_id: APN-490-221-17
        result: null
        error: null
    JobGradingQueued:
      summary: Grading plan job accepted
      value:
        id: job_2Pw6nX4cVr9sQ1kF7tYm
        object: job
        type: grading_plan
        status: queued
        environment: live
        condition_pack: us-generic@2027.1
        engine_version: null
        created_at: '2027-02-28T09:05:40Z'
        started_at: null
        completed_at: null
        result: null
        error: null
    JobCostEstimateQueued:
      summary: Cost estimate job accepted
      value:
        id: job_5Lz8bR3mWq7tH2xC9vNk
        object: job
        type: cost_estimate
        status: queued
        environment: live
        condition_pack: us-generic@2027.1
        engine_version: null
        created_at: '2027-02-28T09:07:02Z'
        started_at: null
        completed_at: null
        result: null
        error: null
    JobFeasibilityQueued:
      summary: Feasibility job accepted
      value:
        id: job_8Fd4kS1pYw6nM3rT0bGh
        object: job
        type: feasibility
        status: queued
        environment: live
        condition_pack: us-generic@2027.1
        engine_version: null
        created_at: '2027-02-28T09:10:00Z'
        started_at: null
        completed_at: null
        result: null
        error: null
    JobRunning:
      summary: Job still running (poll again after Retry-After)
      value:
        id: job_7Hq2mT9xKpL4vB8nZ3rD
        object: job
        type: subdivision
        status: running
        environment: live
        condition_pack: us-generic@2027.1
        engine_version: 2027.02.1
        created_at: '2027-02-28T09:03:12Z'
        started_at: '2027-02-28T09:03:13Z'
        completed_at: null
        result: null
        error: null
    JobSubdivisionSucceeded:
      summary: Subdivision succeeded (feature collections shortened to one feature each)
      value:
        id: job_7Hq2mT9xKpL4vB8nZ3rD
        object: job
        type: subdivision
        status: succeeded
        environment: live
        condition_pack: us-generic@2027.1
        engine_version: 2027.02.1
        created_at: '2027-02-28T09:03:12Z'
        started_at: '2027-02-28T09:03:13Z'
        completed_at: '2027-02-28T09:03:58Z'
        metadata:
          parcel_id: APN-490-221-17
        error: null
        result:
          subdivision_id: sub_6Gx1aQ8rTn
          engine_version: 2027.02.1
          condition_pack: us-generic@2027.1
          units:
            system: imperial
            length: ft
            area: ft2
            volume: yd3
            elevation: ft
          site_area: 103760
          warnings:
            - code: PACK_VALUES_UNREVIEWED
              message: us-generic@2027.1 contains default values that have not been reviewed by a local engineer. Supply your municipality's values for real decisions.
              target: null
          patterns:
            - pattern_id: pat_4Rk8wN2qXe
              rank: 1
              label: through-road
              lot_count: 14
              usable_lot_count: 14
              flag_lot_count: 2
              total_lot_area: 74120
              road_area: 21980
              lots:
                type: FeatureCollection
                features:
                  - type: Feature
                    id: lot_01
                    geometry:
                      type: Polygon
                      coordinates:
                        - - [-117.04120, 32.77680]
                          - [-117.04107, 32.77680]
                          - [-117.04107, 32.77714]
                          - [-117.04121, 32.77714]
                          - [-117.04120, 32.77680]
                    properties:
                      lot_id: lot_01
                      lot_no: 1
                      area: 5210
                      frontage: 41.0
                      depth: 124.0
                      is_flag_lot: false
                      is_usable: true
                      unusable_reason: null
                      parking_spaces: 2
              roads:
                type: FeatureCollection
                features:
                  - type: Feature
                    id: road_01
                    geometry:
                      type: Polygon
                      coordinates:
                        - - [-117.04078, 32.77679]
                          - [-117.04062, 32.77679]
                          - [-117.04058, 32.77782]
                          - [-117.04074, 32.77786]
                          - [-117.04078, 32.77679]
                    properties:
                      road_id: road_01
                      kind: through
                      width: 50.0
                      length: 372.0
                      area: 18600
                      connects_to_frontage: [0]
              parking:
                type: FeatureCollection
                features:
                  - type: Feature
                    id: lot_01-p1
                    geometry:
                      type: Polygon
                      coordinates:
                        - - [-117.04118, 32.77682]
                          - [-117.04115, 32.77682]
                          - [-117.04115, 32.77688]
                          - [-117.04118, 32.77688]
                          - [-117.04118, 32.77682]
                    properties:
                      lot_id: lot_01
                      space_no: 1
                      width: 9.0
                      length: 18.0
              warnings: []
            - pattern_id: pat_7Js2mC5vHd
              rank: 2
              label: dead-end
              lot_count: 15
              usable_lot_count: 13
              flag_lot_count: 3
              total_lot_area: 78900
              road_area: 17150
              lots:
                type: FeatureCollection
                features: []
              roads:
                type: FeatureCollection
                features: []
              parking:
                type: FeatureCollection
                features: []
              warnings:
                - code: TURNAROUND_UNAVAILABLE
                  message: No cul-de-sac with a 15.2 m radius fits at the end of road_02; a hammerhead was used instead.
                  target: road_02
                - code: BUILDING_FOOTPRINT_DOES_NOT_FIT
                  message: A 9.0 m wide building footprint does not fit on lot_14.
                  target: lot_14
    JobGradingSucceeded:
      summary: Grading plan succeeded (feature collections shortened)
      value:
        id: job_2Pw6nX4cVr9sQ1kF7tYm
        object: job
        type: grading_plan
        status: succeeded
        environment: live
        condition_pack: us-generic@2027.1
        engine_version: 2027.02.1
        created_at: '2027-02-28T09:05:40Z'
        started_at: '2027-02-28T09:05:41Z'
        completed_at: '2027-02-28T09:06:27Z'
        error: null
        result:
          grading_plan_id: grd_9Tm3cV7yLb
          subdivision_pattern_id: pat_4Rk8wN2qXe
          engine_version: 2027.02.1
          condition_pack: us-generic@2027.1
          units:
            system: imperial
            length: ft
            area: ft2
            volume: yd3
            elevation: ft
          vertical_datum: NAVD88
          lots:
            type: FeatureCollection
            features:
              - type: Feature
                id: lot_01
                geometry:
                  type: Polygon
                  coordinates:
                    - - [-117.04120, 32.77680]
                      - [-117.04107, 32.77680]
                      - [-117.04107, 32.77714]
                      - [-117.04121, 32.77714]
                      - [-117.04120, 32.77680]
                properties:
                  lot_id: lot_01
                  lot_no: 1
                  finished_height: 492.1
                  existing_height_mean: 494.6
                  cut_volume: 412
                  fill_volume: 38
          retaining_walls:
            type: FeatureCollection
            features:
              - type: Feature
                id: wall_03
                geometry:
                  type: LineString
                  coordinates:
                    - [-117.04121, 32.77714]
                    - [-117.04107, 32.77714]
                properties:
                  wall_id: wall_03
                  max_height: 5.6
                  mean_height: 4.1
                  length: 41.0
                  face_area: 168
                  height_band: 1.2-2.4
                  requires_engineering: true
                  retains_side: left
          drainage_pipes:
            type: FeatureCollection
            features:
              - type: Feature
                id: pipe_01
                geometry:
                  type: LineString
                  coordinates:
                    - [-117.04066, 32.77760]
                    - [-117.04070, 32.77681]
                properties:
                  pipe_id: pipe_01
                  length: 287.0
                  slope_percent: 1.2
                  invert_start: 520.8
                  invert_end: 487.4
                  outfall_index: 0
          road_profiles:
            - road_id: road_01
              max_grade_percent: 9.6
              stations:
                - distance: 0
                  existing_elevation: 491.5
                  finished_elevation: 491.5
                  grade_percent: 8.8
                - distance: 186.0
                  existing_elevation: 510.2
                  finished_elevation: 507.9
                  grade_percent: 9.6
                - distance: 372.0
                  existing_elevation: 532.0
                  finished_elevation: 525.6
          earthwork:
            cut_volume: 6840
            fill_volume: 4210
            net_volume: 1980
            export_volume: 1980
            import_volume: 0
          meshes:
            existing:
              geotiff_url: https://files.platyield.com/grd_9Tm3cV7yLb/existing.tif
              gltf_url: https://files.platyield.com/grd_9Tm3cV7yLb/existing.glb
            finished:
              geotiff_url: https://files.platyield.com/grd_9Tm3cV7yLb/finished.tif
              gltf_url: https://files.platyield.com/grd_9Tm3cV7yLb/finished.glb
            expires_at: '2027-02-28T10:06:27Z'
          warnings:
            - code: WALL_REQUIRES_ENGINEERING
              message: wall_03 is 5.6 ft tall; walls over 4.0 ft require an engineered design in us-generic@2027.1.
              target: wall_03
    JobCostEstimateSucceeded:
      summary: Cost estimate succeeded
      value:
        id: job_5Lz8bR3mWq7tH2xC9vNk
        object: job
        type: cost_estimate
        status: succeeded
        environment: live
        condition_pack: us-generic@2027.1
        engine_version: 2027.02.1
        created_at: '2027-02-28T09:07:02Z'
        started_at: '2027-02-28T09:07:02Z'
        completed_at: '2027-02-28T09:07:09Z'
        error: null
        result:
          cost_estimate_id: est_1Qw5eR8tYu
          grading_plan_id: grd_9Tm3cV7yLb
          engine_version: 2027.02.1
          condition_pack: us-generic@2027.1
          units:
            system: imperial
            length: ft
            area: ft2
            volume: yd3
            elevation: ft
          currency: USD
          line_items:
            - work_type: earthwork
              item: earthwork_cut
              description: Excavation
              quantity: 6840
              unit: yd3
              unit_price: 13.76
              amount: 94118
              price_source: caller
            - work_type: earthwork
              item: earthwork_fill
              description: Fill, placed and compacted
              quantity: 4210
              unit: yd3
              unit_price: 11.09
              amount: 46689
              price_source: caller
            - work_type: soil_export
              item: soil_export
              description: Haul off and dispose of surplus soil
              quantity: 1980
              unit: yd3
              unit_price: 24.47
              amount: 48451
              price_source: caller
            - work_type: retaining_walls
              item: retaining_wall_1.2-2.4
              description: Retaining wall, 1.2–2.4 m exposed height
              quantity: 2510
              unit: ft2
              unit_price: 48.31
              amount: 121258
              price_source: caller
            - work_type: wall_foundations
              item: wall_foundation
              description: Retaining wall footing
              quantity: 612
              unit: ft
              unit_price: 85.34
              amount: 52228
              price_source: pack_default
            - work_type: roads
              item: road_pavement
              description: Asphalt pavement with aggregate base
              quantity: 21980
              unit: ft2
              unit_price: 5.76
              amount: 126605
              price_source: caller
            - work_type: roads
              item: curb_and_gutter
              description: Curb and gutter, both sides
              quantity: 744
              unit: ft
              unit_price: 30.48
              amount: 22677
              price_source: pack_default
            - work_type: drainage
              item: storm_drain_pipe
              description: Storm drain pipe including trenching
              quantity: 287
              unit: ft
              unit_price: 64.01
              amount: 18371
              price_source: caller
          totals_by_work_type:
            - work_type: earthwork
              amount: 140807
            - work_type: soil_export
              amount: 48451
            - work_type: retaining_walls
              amount: 121258
            - work_type: wall_foundations
              amount: 52228
            - work_type: roads
              amount: 149282
            - work_type: drainage
              amount: 18371
          total: 530397
          per_lot:
            usable_lot_count: 14
            cost_per_lot: 37885
            lots:
              - lot_id: lot_01
                amount: 44120
          price_source: mixed
          documents:
            xlsx_url: https://files.platyield.com/est_1Qw5eR8tYu/estimate.xlsx
            pdf_url: https://files.platyield.com/est_1Qw5eR8tYu/estimate.pdf
            dxf_url: https://files.platyield.com/est_1Qw5eR8tYu/plan.dxf
            expires_at: '2027-02-28T10:07:09Z'
          warnings:
            - code: PACK_DEFAULT_PRICE_USED
              message: wall_foundation and curb_and_gutter use us-generic@2027.1 reference prices. Supply unit_prices for a quote-grade estimate.
              target: null
    JobFeasibilitySucceeded:
      summary: Feasibility succeeded (two options; full sub-results omitted for brevity)
      value:
        id: job_8Fd4kS1pYw6nM3rT0bGh
        object: job
        type: feasibility
        status: succeeded
        environment: live
        condition_pack: us-generic@2027.1
        engine_version: 2027.02.1
        created_at: '2027-02-28T09:10:00Z'
        started_at: '2027-02-28T09:10:01Z'
        completed_at: '2027-02-28T09:12:44Z'
        error: null
        result:
          feasibility_id: fea_3Vn7pK2wQs
          engine_version: 2027.02.1
          condition_pack: us-generic@2027.1
          units:
            system: imperial
            length: ft
            area: ft2
            volume: yd3
            elevation: ft
          currency: USD
          price_source: mixed
          options:
            - pattern_id: pat_4Rk8wN2qXe
              label: through-road
              lot_count: 14
              usable_lot_count: 14
              grading_plan_id: grd_9Tm3cV7yLb
              cost_estimate_id: est_1Qw5eR8tYu
              earthwork:
                cut_volume: 6840
                fill_volume: 4210
                net_volume: 1980
                export_volume: 1980
                import_volume: 0
              retaining_wall_length: 612.0
              retaining_wall_max_height: 5.6
              total_cost: 530397
              cost_per_lot: 37885
              warning_codes: [PACK_VALUES_UNREVIEWED, WALL_REQUIRES_ENGINEERING, PACK_DEFAULT_PRICE_USED]
            - pattern_id: pat_7Js2mC5vHd
              label: dead-end
              lot_count: 15
              usable_lot_count: 13
              grading_plan_id: grd_2Hk6dF9gJl
              cost_estimate_id: est_4Zx7cV1bNm
              earthwork:
                cut_volume: 7920
                fill_volume: 3880
                net_volume: 3450
                export_volume: 3450
                import_volume: 0
              retaining_wall_length: 540.0
              retaining_wall_max_height: 6.2
              total_cost: 561200
              cost_per_lot: 43169
              warning_codes: [PACK_VALUES_UNREVIEWED, TURNAROUND_UNAVAILABLE, BUILDING_FOOTPRINT_DOES_NOT_FIT, WALL_REQUIRES_ENGINEERING, PACK_DEFAULT_PRICE_USED]
          subdivision:
            subdivision_id: sub_8Mb4nV6cXz
            engine_version: 2027.02.1
            condition_pack: us-generic@2027.1
            units:
              system: imperial
              length: ft
              area: ft2
              volume: yd3
              elevation: ft
            site_area: 103760
            patterns: []
            warnings: []
          grading_plans: []
          cost_estimates: []
    JobFailed:
      summary: Job failed
      value:
        id: job_0Cv9xZ2aSd5fG8hJ1kLq
        object: job
        type: subdivision
        status: failed
        environment: live
        condition_pack: us-generic@2027.1
        engine_version: 2027.02.1
        created_at: '2027-02-28T11:20:31Z'
        started_at: '2027-02-28T11:20:32Z'
        completed_at: '2027-02-28T11:21:05Z'
        result: null
        error:
          type: https://docs.platyield.com/errors/no-feasible-layout
          title: No feasible layout
          status: 422
          code: NO_FEASIBLE_LAYOUT
          detail: No lot of at least 465 m² with 12 m of frontage can be laid out on this site. Try relaxing lot_rules.min_frontage_m or allowing flag lots.
          instance: /v1/jobs/job_0Cv9xZ2aSd5fG8hJ1kLq
          request_id: req_4TgH8jK2lP0oI9uY

    WebhookSubdivisionSucceeded:
      summary: job.succeeded event for a subdivision (result shortened)
      value:
        id: evt_5Ny2bT8kQa
        object: event
        type: job.succeeded
        created_at: '2027-02-28T09:03:59Z'
        data:
          job:
            id: job_7Hq2mT9xKpL4vB8nZ3rD
            object: job
            type: subdivision
            status: succeeded
            environment: live
            condition_pack: us-generic@2027.1
            engine_version: 2027.02.1
            created_at: '2027-02-28T09:03:12Z'
            started_at: '2027-02-28T09:03:13Z'
            completed_at: '2027-02-28T09:03:58Z'
            metadata:
              parcel_id: APN-490-221-17
            error: null
            result:
              subdivision_id: sub_6Gx1aQ8rTn
              engine_version: 2027.02.1
              condition_pack: us-generic@2027.1
              units:
                system: imperial
                length: ft
                area: ft2
                volume: yd3
                elevation: ft
              site_area: 103760
              patterns: []
              warnings: []

    # ------------------------------------------------------------------ Condition packs and usage
    ConditionPackListAll:
      summary: Available condition packs
      value:
        data:
          - id: us-generic@2027.1
            name: us-generic
            version: '2027.1'
            region: US
            status: preview
            currency: USD
            description: Typical US suburban subdivision defaults. Reference values pending review; zoning-dependent values must be supplied by the caller.
            published_at: '2027-01-15'
          - id: au-generic@2027.1
            name: au-generic
            version: '2027.1'
            region: AU-NSW
            status: preview
            currency: AUD
            description: New South Wales residential subdivision defaults. Reference values pending review.
            published_at: '2027-01-15'
          - id: my-generic@2027.1
            name: my-generic
            version: '2027.1'
            region: MY
            status: preview
            currency: MYR
            description: Peninsular Malaysia residential development defaults. Reference values pending review.
            published_at: '2027-01-15'
          - id: jp-standard@2027.1
            name: jp-standard
            version: '2027.1'
            region: JP
            status: stable
            currency: JPY
            description: Rules and prices used on real projects in Japan. Use it to reproduce reference results.
            published_at: '2027-01-15'
    ConditionPackUsGeneric:
      summary: us-generic@2027.1 (selected parameters)
      value:
        id: us-generic@2027.1
        name: us-generic
        version: '2027.1'
        region: US
        status: preview
        currency: USD
        description: Typical US suburban subdivision defaults. Reference values pending review; zoning-dependent values must be supplied by the caller.
        published_at: '2027-01-15'
        parameters:
          - key: coordinates.projection
            value: utm
            unit: null
            description: Sites are projected to their local UTM zone for computation.
            source: null
            review_status: reviewed
          - key: elevation.provider
            value: none
            unit: null
            description: Public DEM used when elevation.source is provider. Not available yet for this pack.
            source: null
            review_status: unreviewed
          - key: road.internal_road_width_m
            value: 15.2
            unit: m
            description: Right-of-way width of a local residential street (50 ft).
            source: Common local street standard; varies by municipality.
            review_status: unreviewed
          - key: road.turnaround
            value: cul_de_sac
            unit: null
            description: Turnaround shape at the end of dead-end roads.
            source: null
            review_status: unreviewed
          - key: road.cul_de_sac_radius_m
            value: 15.2
            unit: m
            description: Right-of-way radius of a cul-de-sac bulb (50 ft).
            source: Common fire-access turnaround guidance; varies by jurisdiction.
            review_status: unreviewed
          - key: road.max_dead_end_length_m
            value: 152
            unit: m
            description: Longest dead-end road without a secondary access (500 ft).
            source: Common fire code practice; varies by jurisdiction.
            review_status: unreviewed
          - key: lot.min_lot_area_m2
            value: 465
            unit: m2
            description: Default minimum lot area (5,000 ft²) when lot_rules.min_lot_area_m2 is omitted. Set by zoning.
            source: null
            review_status: unreviewed
          - key: lot.parking_space_size_m
            value:
              width: 2.7
              length: 5.5
            unit: m
            description: Off-street parking stall size (9 × 18 ft).
            source: null
            review_status: unreviewed
          - key: grading.max_road_grade_percent
            value: 12
            unit: percent
            description: Steepest allowed road grade.
            source: null
            review_status: unreviewed
          - key: grading.min_drain_slope_percent
            value: 0.5
            unit: percent
            description: Minimum slope of storm drain pipes.
            source: null
            review_status: unreviewed
          - key: grading.wall_engineering_height_m
            value: 1.22
            unit: m
            description: Retaining walls taller than this (4 ft) require an engineered design.
            source: Common building code threshold; varies by jurisdiction.
            review_status: unreviewed
          - key: cost.earthwork_cut_per_m3
            value: 20.0
            unit: USD/m3
            description: Reference excavation price. An indication only.
            source: null
            review_status: unreviewed
          - key: cost.truck_capacity_m3
            value: 10
            unit: m3
            description: Haul truck capacity used to count truck loads.
            source: null
            review_status: unreviewed
          - key: checks.min_open_space_percent
            value: 0
            unit: percent
            description: Share of the site to reserve as open space. Not required by default.
            source: null
            review_status: unreviewed
    UsageFebruary:
      summary: Usage for February 2027
      value:
        period:
          start: '2027-02-01'
          end: '2027-02-28'
        environment: live
        jobs:
          subdivision: 128
          grading_plan: 41
          cost_estimate: 39
          feasibility: 22
        site_area_m2: 1186400
        limits:
          monthly_jobs: 500
          remaining_jobs: 270
          rate_limit_per_minute: 60

    # ------------------------------------------------------------------ Problems
    ProblemInvalidRequest:
      summary: Validation error
      value:
        type: https://docs.platyield.com/errors/invalid-request
        title: Invalid request
        status: 400
        code: INVALID_REQUEST
        detail: 1 field is invalid.
        instance: /v1/subdivisions
        request_id: req_9KfT2wQ8mZ1xY4bN
        errors:
          - pointer: /frontage/0/road_width_m
            message: must be greater than 0
    ProblemUnauthorized:
      summary: Missing or invalid API key
      value:
        type: https://docs.platyield.com/errors/unauthorized
        title: Unauthorized
        status: 401
        code: UNAUTHORIZED
        detail: "The API key is missing or invalid. Send it as 'Authorization: Bearer pk_live_...'."
        request_id: req_1AbC2dE3fG4hI5jK
    ProblemSandboxSiteOnly:
      summary: Sandbox key used with a non-sample site
      value:
        type: https://docs.platyield.com/errors/sandbox-site-only
        title: Sandbox keys compute sample sites only
        status: 403
        code: SANDBOX_SITE_ONLY
        detail: pk_test_ keys only compute the published sample sites. Use a sample site from the documentation or a pk_live_ key.
        instance: /v1/subdivisions
        request_id: req_6LmN7oP8qR9sT0uV
    ProblemNotFound:
      summary: Unknown pattern
      value:
        type: https://docs.platyield.com/errors/not-found
        title: Not found
        status: 404
        code: NOT_FOUND
        detail: subdivision_pattern_id pat_4Rk8wN2qXe was not found in your account.
        instance: /v1/grading-plans
        request_id: req_2WxY3zA4bC5dE6fG
    ProblemIdempotencyConflict:
      summary: Idempotency key reused with a different body
      value:
        type: https://docs.platyield.com/errors/idempotency-conflict
        title: Idempotency key conflict
        status: 409
        code: IDEMPOTENCY_CONFLICT
        detail: Idempotency-Key 3f9b6c1e-8a2d-4e57-b0c4-71d2a9e6f845 was used with a different request body.
        instance: /v1/subdivisions
        request_id: req_7HiJ8kL9mN0oP1qR
    ProblemSiteTooLarge:
      summary: Site exceeds the area limit
      value:
        type: https://docs.platyield.com/errors/site-too-large
        title: Site too large
        status: 422
        code: SITE_TOO_LARGE
        detail: The site is 18,240 m²; the current limit is 10,000 m². Split the site into parcels and submit them separately.
        instance: /v1/subdivisions
        request_id: req_3StU4vW5xY6zA7bC
        errors:
          - pointer: /site
            message: area 18240 m² exceeds 10000 m²
    ProblemInvalidGeometry:
      summary: Self-intersecting site polygon
      value:
        type: https://docs.platyield.com/errors/invalid-geometry
        title: Invalid geometry
        status: 422
        code: INVALID_GEOMETRY
        detail: The site polygon intersects itself between positions 2 and 4.
        instance: /v1/subdivisions
        request_id: req_8DeF9gH0iJ1kL2mN
        errors:
          - pointer: /site/coordinates/0
            message: ring is self-intersecting
    ProblemProviderUnavailable:
      summary: No elevation provider for the pack
      value:
        type: https://docs.platyield.com/errors/elevation-provider-unavailable
        title: Elevation provider unavailable
        status: 422
        code: ELEVATION_PROVIDER_UNAVAILABLE
        detail: us-generic@2027.1 has no elevation provider yet. Use elevation.source points or geotiff_url.
        instance: /v1/grading-plans
        request_id: req_4OpQ5rS6tU7vW8xY
        errors:
          - pointer: /elevation/source
            message: provider is not available for this condition pack
    ProblemRateLimited:
      summary: Rate limit exceeded
      value:
        type: https://docs.platyield.com/errors/rate-limited
        title: Too many requests
        status: 429
        code: RATE_LIMITED
        detail: Rate limit of 60 requests per minute exceeded. Retry after 18 seconds.
        request_id: req_5ZaB6cD7eF8gH9iJ
    ProblemInternal:
      summary: Internal error
      value:
        type: https://docs.platyield.com/errors/internal-error
        title: Internal error
        status: 500
        code: INTERNAL_ERROR
        detail: An unexpected error occurred. Retry with the same Idempotency-Key; contact support with the request_id if it persists.
        request_id: req_0KlM1nO2pQ3rS4tU
