PrecisionDocs

Developer Documentation

PrecisionDocs public API reference: authentication, project lifecycle, agent questions, knowledge-base search, reports, MCP connectors, errors, and rate limits.

API Overview

What the PrecisionDocs public API is, the base URL, and how to connect.

What is the PrecisionDocs public API?

The PrecisionDocs public API lets your own tools, agents, and scripts drive the same project workflow your connected AI uses: screen a parcel without a project, create a project for deeper research, ask cited questions from available evidence, search indexed sources, generate reports, and download artifacts.

All REST endpoints live under https://api.precisiondocs.ai/v1.

Two access surfaces, one API:

SurfaceHow it connectsBest for
Remote MCPhttps://mcp.precisiondocs.ai/mcp - PrecisionDocs OAuth, no keyClaude, ChatGPT, Claude Code, OpenAI Codex, Gemini CLI, Cursor, any MCP client
RESTHTTPS + Authorization: Bearer pd_live_... headerScripts, backends, CI, ChatGPT Actions

The machine-readable spec is at https://api.precisiondocs.ai/v1/openapi.json.

To connect your AI, log in to PrecisionDocs, choose your app, and follow the guided setup. No API key is needed. This page is the endpoint-level reference.

Creating a project from an agent. A connected agent walks the same steps as project setup:

  1. Resolve each address or APN with POST /v1/parcels/resolve. Candidates carry address, size, confidence and GeoJSON geometry, and ll_uuid where the parcel has one.
  2. Show the user the chosen parcels with POST /v1/parcels/preview.
  3. Learn which goal questions still need asking with POST /v1/plan-check.
  4. Dry-run the create with POST /v1/projects, dry_run: true and setup_mode: "wizard". The response is the pre-Create screen: estimate, prep_summary.sources (every governing source discovery found, with status and URL) and gaps (each source discovery could not settle, naming the request field that fills it: ordinance_url, county_ordinance_url, pending_gis_sources, or a skip_* flag the user must confirm). A confirmation_required response is a question for the user; answer it by re-submitting with the field its options map to.
  5. Create for real with an Idempotency-Key and poll GET /v1/projects/{id}.

Use available evidence immediately: chat_ready tracks the build and explicit zoning-confirmation checkpoint, while questions, search, reports, documents, and GIS remain available with partial coverage disclosed.

Authentication & API Keys

Bearer pd_live keys, where to create them, scopes, and key-handling rules.

How do I authenticate REST requests?

Every REST request sends an organization API key as a Bearer token:

Authorization: Bearer pd_live_...

Create keys in Account -> API keys. Organization owners and active members can create keys; owner-created keys are org-wide, while member-created keys only authorize projects the member owns or is explicitly shared into. A connector (OAuth) session is always scoped to one person: it sees only projects that user owns or is shared into, whatever their role.

Key facts:

  • Keys are shown once at creation. Copy the full pd_live_ secret while it is visible. Only a hashed form is stored.
  • Keys can carry an optional expiry and optional daily, weekly and monthly spending limits.
  • Rotate or revoke keys anytime from Account -> API keys.
  • Test a key with GET https://api.precisiondocs.ai/v1/wallet.

What scopes do API keys have?

Each key carries a scope list. Requests to an endpoint outside the key's scopes fail with 403 insufficient_scope.

ScopeGrantsDefault
project:createCreate projects (POST /v1/projects) and run plan checks (POST /v1/plan-check)Yes
project:readList/poll projects, site knowledge, messages, reports, searchYes
agent:askAsk the project agent (POST /v1/projects/{id}/messages)Yes
report:writeGenerate reports (POST /v1/projects/{id}/reports)Yes
source:writeAdd URL and GIS sources and upload files (POST .../sources, POST .../gis-sources, POST /v1/uploads/*)Yes
artifact:readList artifacts and mint one-time download linksYes
wallet:readRead the organization credit balanceYes
gis:exportGIS export artifacts (POST .../gis-exports) and map/aerial rendering (POST .../maps)Yes
siteplan:readSite-plan design data: concept geometry, design criteria, yield scenarios, CAD exports, proposalsYes
siteplan:writeApprove the development program, propose and decide concept proposals (POST .../site-plan/program/approve, POST .../site-plan/proposals, POST .../site-plan/proposals/{id}/approve or /reject). Also needs site planning on the workspace's planYes

There is no custom-scope picker: every new key carries the full set above, and a connector (OAuth) token carries the same set. A credential keeps the scopes it was minted with - they are never backfilled - so a key or connected app created before siteplan:write existed (September 2026) does not have it: mint a new key, or reconnect the app from its client, to pick it up.

Security rules:

  • Never paste a pd_live_ key into a shared document, prompt, chat message, screenshot, or support ticket.
  • Put keys only in server-side config, sent as the Authorization header. Never in a URL, and never in an MCP client config - MCP clients sign in with OAuth and hold no key.
  • Rotate a key immediately if it may have been exposed.

Projects Lifecycle

Create a project, poll readiness, and verify parcel zoning over REST.

How do I create and manage projects?

EndpointWhat it doesRate limit
POST /v1/projectsCreate a project (returns 202; the build runs in the background)8/min
GET /v1/projectsList your projects, a page at a time: limit (1-100) and cursor, answered as data and next_cursor (null on the last page)60/min
GET /v1/projects/{project_id}Poll readiness + knowledge-base summary60/min
PATCH /v1/projects/{project_id}/parcels/{parcel_index}/zoningVerify or correct a parcel zoning designation30/min

Creating a project (POST /v1/projects):

  • dry_run: true returns a setup and cost estimate without creating anything.
  • setup_mode: "wizard" (default) runs the same source checks as project setup in a connected AI; setup_mode: "provided" preserves caller-supplied parcels and source decisions.
  • When the platform needs a decision (ambiguous parcels, source choices, duplicates), the API responds 422 with confirmation_required and the choices to present. Re-submit with the selections applied.
  • Send an Idempotency-Key header so a retried create never makes a duplicate project.

Polling readiness (GET /v1/projects/{project_id}):

  • Poll every 5-15 seconds. agent_ready means available project and parcel evidence can be used now. chat_ready tracks the build and explicit zoning-confirmation checkpoint; it does not gate questions, reports, documents, searches or GIS. Each calculation still needs its specific inputs, and partial source coverage must be disclosed.
  • status is queued, running, ready, partial (the build finished with source gaps, which message names and GET /v1/projects/{project_id}/source-needs lists), needs_input (a code lane waits for the source your agent hands back) or failed.
  • The response carries a readiness block with per-target ordinance status, GIS layer states, supplemental source lanes, and advisories - use it to see exactly which lane is still open. A section that could not be read holds one row with status unread, which is not evidence that nothing is pending: poll again.
  • chat_ready: false with zoning_verification_required identifies parcels whose district needs confirmation. Confirm or correct them through the zoning PATCH. API chat never records that confirmation, and unrelated available work remains usable.

Plan Check, Sources & Uploads

Classify a goal before creation, then attach URL sources, GIS sources, and file uploads to a project.

How do I classify a goal and attach sources to a project?

All five endpoints require the source:write scope except plan check, which uses project:create. Source and upload writes accept an Idempotency-Key header so a retry never double-ingests.

EndpointWhat it doesScopeRate limit
POST /v1/plan-checkClassifies goal text into a typology and reports which follow-up values the goal already answersproject:create20/min
POST /v1/projects/{project_id}/sourcesAdds a URL source; the response names the lane that accepted it (document, supplemental ordinance, or GIS)source:write10/min
POST /v1/projects/{project_id}/gis-sourcesRegisters a user-verified GIS source by authority scopesource:write10/min
POST /v1/uploads/initiateStarts a file-upload job for a local documentsource:write30/min
POST /v1/uploads/{job_id}/finalizeFinalizes an initiated upload into the project knowledge basesource:write30/min

Plan check (POST /v1/plan-check, precisiondocs_plan_check over MCP): send { goal_text, primary_typology?, has_existing_structure? }. The verdicts in the response tell your agent which follow-up values the goal already settled and which come back as ask. Ask the user only the ask items, then pass the settled answers as project_goal_context on POST /v1/projects.

URL sources (POST .../sources): send { url, title?, category? }. The response reports which ingest lane accepted the URL - a project document, a supplemental ordinance corpus, or a GIS source - so your client can say what will happen next.

GIS sources (POST .../gis-sources): send { url, scope, jurisdiction_name? } where scope is municipality, county, or state_reference. Use it for a viewer or ArcGIS REST endpoint the jurisdiction publishes that discovery did not find.

File uploads: local files never travel as URLs. Call POST /v1/uploads/initiate, PUT the raw bytes to the returned upload_url with the file's Content-Type, then call POST /v1/uploads/{job_id}/finalize. The upload_url is a one-time PrecisionDocs link on api.precisiondocs.ai (it works once and expires after 15 minutes; the storage URL behind it never leaves the server); if the PUT fails or finalize answers upload_object_missing, initiate again with the same body and Idempotency-Key for a fresh link to the same job, PUT the bytes, then finalize; once the job is past the upload step that initiate answers 409 upload_already_finished, so read GET /v1/uploads/{job_id} instead. Over MCP the same two steps are precisiondocs_start_upload and precisiondocs_finish_upload, which need a client that can read the file and make an HTTP request (Claude Code, Codex). Before finalize, GET /v1/uploads/{job_id}/toc lists a long PDF's sections so page_ranges indexes only the ones needed. GET /v1/uploads/{job_id} reads where an upload stands: an upload paused for consent to a large file's cost continues with POST /v1/uploads/{job_id}/confirm, one paused for credits with POST /v1/uploads/{job_id}/resume once the wallet is topped up, and a failed one runs again with POST /v1/uploads/{job_id}/retry, each from the stored file. An upload left unfinished for 6 hours fails as stale_upload_timeout and its partial file is removed, and a retry whose stored file is gone answers 409 upload_object_missing: start a new upload and send the file again. A PDF handed to POST /v1/projects/{project_id}/codes/governing reads completed with phase governing_code: it became the project's code, not an indexed document.

Sources at creation: POST /v1/projects also accepts pending_supplemental_sources (max 10: url, title, category, authority_scope) and pending_gis_sources (max 6: url, scope, jurisdiction_name) so a connector can hand over everything the user confirmed in one create call.

Ask the Agent

Agent questions with model choice, citations and recoverable turn history.

How do I ask the project agent a question?

POST /v1/projects/{project_id}/messages runs the same project agent your connected AI uses. Send wait: false to receive a pollable job handle, or use the default wait: true for a synchronous answer with citations, tool usage and generated artifacts.

Limits and behavior:

  • Rate limit: 2/min per key, with a concurrency limit of 2 in-flight questions.
  • Send an Idempotency-Key header: a retried request returns the original turn instead of re-running (and re-billing) the agent.
  • Available evidence remains usable while unrelated sources are pending, partial or failed. Answers identify source gaps and unconfirmed zoning; only a calculation requiring a missing input waits for it.

Model selection: Read GET /v1/models for the approved models, Auto default and estimated credit rates (requires agent:ask; no inference or charge). Pass an exact returned model_id with your message, or omit it, send null, or send auto to use Auto. Each API request defaults to Auto on its own.

A rejected, unavailable or disabled explicit selection fails before the turn starts. The answering model can be selected; report generation, classifiers and other tools retain their own task-specific models. Finished responses, and a turn read back by id, expose model_selection with requested/resolved IDs and observed served identity when available.

Reading turns back:

EndpointWhat it returns
GET /v1/projects/{project_id}/messages/{turn_id}One prior turn (question, answer, citations, artifacts)
GET /v1/projects/{project_id}/messagesTurn list for the project, only turns asked through the API; data a page at a time (limit, cursor, next_cursor) plus running_turns

Site Plan & CAD Handoff

Read site-plan design data, compile a concept from the interview, and export a concept picture or geometry for Civil 3D.

How do I read site-plan design data and export concept geometry?

All four endpoints require the siteplan:read scope. Every key and connector token carries the full scope set by default, so no separate grant step exists.

EndpointWhat it doesRate limit
GET /v1/projects/{project_id}/site-planLatest compiled concept: object_counts (every object counted by type), metrics and scenario; WGS84-only GeoJSON features only with include_geometry=true60/min
GET /v1/projects/{project_id}/design-criteriaResolved zoning standards per district with per-field provenance60/min
GET /v1/projects/{project_id}/yield-scenarioSettled yield scenarios per district plus snapshot summaries60/min
POST /v1/projects/{project_id}/site-plan-exportsRenders the concept to a picture (concept_png), the plan sheet (pdf), LandXML, DXF, a to-scale exhibit of that DXF (dxf_exhibit), GeoPackage, a CAD bundle, or GeoJSON and returns a one-time download link10/min

Concept geometry: until a concept compiles, the site-plan route returns has_concept: false and geometry_included: false with an empty feature collection, even if include_geometry=true was requested. With a compiled concept, geometry_included is true only when geometry was requested. Features carry object_type, label, layer, status, editable, and measurements; projected coordinates are stripped, WGS84 only. measurements holds site numbers only - solver bookkeeping (planner strategy, fit ratios, discarded-geometry counters) is excluded, so nothing there should be read as an area or dimension on the ground.

Geometry is opt-in. Without include_geometry=true, has_concept, revision, object_counts, metrics and scenario describe the plan with geometry_included: false, an empty FeatureCollection, feature_count 0 and truncated false; that empty collection does not mean the concept is absent. Pass include_geometry=true when you need individual objects or coordinates: coordinates are WGS84 in [longitude, latitude] order, each measurements key names its unit (area_sqft, length_ft), and at most 10,000 features are returned, with truncated: true when the plan holds more. object_counts counts every plan object, including those beyond that cap, in descending count order. Until 2026-10-09 the route returned the geometry by default.

Design criteria: absent values are never bare nulls. A field reads Not provided in ordinance only when the extraction corroborated the absence; otherwise it reads Not located in the indexed ordinance, which claims nothing about the law. user_provided_fields lists the values the user themselves confirmed. citations are readable references such as Tangipahoa Parish Code § 36-91; retrieval chunk identifiers are never returned as citations. stormwater_context splits into known and not_in_code, so a requirement the code is silent on is named rather than read as a zero. governing_district is the district the concept is compiled and checked against, with its basis (current, or rezone_target once the user confirmed a rezone) and the parcel district as current_zoning_code beside it; a rezone target is also listed in districts, so never take the parcel district for the governing one.

Yield scenarios: values the user settled under one district are inherited into another district's partition when missing, with the borrowing stated per key in inherited.

CAD handoff (precisiondocs_export_site_plan over MCP): landxml is the native Civil 3D import format; dxf covers generic CAD; dxf_exhibit is that same DXF plotted to scale on one 36 x 24 in PDF and cut at the edge of the sheet, where the dxf and cad_bundle files keep their whole road context; geopackage is for GIS; cad_bundle zips the DXF, LandXML and GeoPackage with a manifest of CRS, units and provenance; pdf is the plan layout sheet and concept_png a picture of the concept plan, both for people, not CAD. The response is artifact_id, filename, mime_type, download_url, and expires_at (15 minutes); geometry travels as a file, never inline. Send an Idempotency-Key header so a retried request replays the original artifact. With no compiled concept the endpoint returns 404 (no_site_plan_concept).

Concept picture disclosures: the drawing carries recorded wetland exclusion, constraint override and floodplain retention caveats, including suspended decisions. When space is limited, optional notes give way first and a long stated override reason may be shortened with a marker pointing to the full project record; the caveats remain whole. If required disclosures still cannot fit, export returns 400 (invalid_site_plan_export_request) with the refusal message. Retrying the same revision cannot resolve that refusal; transient worker failures remain 502 (export_render_failed).

How do I walk the guided site-planning interview from my own agent?

Three endpoints walk the same interview your connected AI walks. The engine is deterministic: it picks the next question and already knows what the project settled, so you never decide what to ask next.

EndpointWhat it doesRate limit
GET /v1/projects/{project_id}/interview/workflowsGuided workflows this project can walk, which one it is on, and how far in (siteplan:read)60/min
GET /v1/projects/{project_id}/interview/stepThe next 1-3 questions as JSON Schema, plus what is already answered or inferred (siteplan:read)60/min
POST /v1/projects/{project_id}/interview/answersSubmit typed answers, get the next step back (project:create)30/min

Both reads are free. No LLM call and no credit spend, so poll them rather than guessing what comes next. Only the answer endpoint writes.

Questions arrive as JSON Schema, the same questions your connected AI shows: types, ranges, units, and options with their labels. A default on a field is the engine's recommendation, and recommended.reason says why - offer it as a suggestion, never as a requirement.

Nothing is asked twice. answered lists what the project settled and inferred lists what the engine derived, each with the statement behind it. remaining_question_ids is the rest of the walk; complete: true with no questions means the scripted interview is finished, and completeness.missing_required names anything a concept still needs.

A rejected batch records nothing. Values are validated against the same schema server-side; a 400 invalid_interview_answer names every bad field under errors, so fix those and resend the same batch. What is recorded is the user's own decision, on the same record your connected AI writes, so an interview can start in Claude or ChatGPT and finish over the API, or the other way round.

Read standing, not the workflow rows. standing always describes the walk the project is on. selected_workflow_id is null both before a workflow is chosen and for a use that has no template lane (commercial, hotel), so a null there never means the interview has not started.

How do I compile the concept plan once the interview is complete?

When the interview returns complete: true with completeness.ready: true, four endpoints turn the settled program into a drawn concept. They call the same engine the connector uses, so a walk can start in Claude or ChatGPT and finish here, or the other way round.

EndpointWhat it doesRate limit
POST /v1/projects/{project_id}/site-plan/program/approveApprove the development program and advance the session to Generate Concept; idempotent once approved (siteplan:write)30/min
POST /v1/projects/{project_id}/site-plan/proposalsCreate the generate_concept proposal (or a one-zone regeneration with zone_id); returns notes, recap and conflicts, compiles nothing yet (siteplan:write)10/min
GET /v1/projects/{project_id}/site-plan/proposalsProposals on the active planning session, newest first, with limit/offset and status_filter (siteplan:read)60/min
POST /v1/projects/{project_id}/site-plan/proposals/{proposal_id}/approveApprove = compile. Returns the applied revision and the plan's scalar metrics (siteplan:write)10/min
POST /v1/projects/{project_id}/site-plan/proposals/{proposal_id}/rejectReject, recording the optional reason (siteplan:write)10/min

Every write is fenced on the session. Pass the planning_session_id the interview responses carry; a write against a session that is no longer active is 409 planning_session_conflict. state_version is optional and, when given, is a compare-and-swap token against the last response you saw. An accepted proposal write consumes that token even if the later compile blocks or fails, and the proposal-create and decision responses return the session's new state_version - send that one on the next call, and re-read the interview state after a conflict. An already-decided proposal replay consumes nothing. Send an Idempotency-Key on each write so a retry replays rather than repeats.

One home on an existing lot uses placement review. Call POST /v1/projects/{id}/site-plan/placement-draft (precisiondocs_prepare_home_placement) with the interview's planning_session_id; state_version is optional on prepare, and when omitted the draft is prepared against the session's current state. Show the returned house and driveway geometry, dimensions, assumptions and validity to the user. Apply their changes with PATCH on that path (precisiondocs_edit_home_placement). Send the current session and state version, draft_id, expected_draft_revision and envelope_signature from the latest response. Editing a confirmed placement reopens it and answers placement_reopened: true: it must be confirmed again, which compiles and charges again. An edit is refused with home_placement_refused (block_reason: placement_revalidation_pending) while a changed buildable envelope waits on the user in the Studio. Only after the user approves, call POST .../placement-draft/confirm (precisiondocs_confirm_home_placement). This queues the shared compiler; poll GET .../site-plan/jobs/{job_id} (precisiondocs_get_site_plan_job) for its real outcome. queued is not a completed concept. After complete, read the plan and its findings, then export or render its 3D views. Preparation and edits are free; confirmation costs the concept-plan price. Use an Idempotency-Key for prepare and confirm retries.

The writes are gated; the reads are not. Besides siteplan:write, every write needs site planning on the workspace, which comes with every paid plan (a free workspace gets it by choosing a plan or buying extra usage): without it every write answers 403 site_plan_studio_not_enabled while every read in this section keeps answering 200. Generic program/proposal writes for a single-family custom-home session answer 409 home_placement_required. Subdivision and any other single-family program remain 409 typology_not_supported_via_api. To divide a parcel into lots, use POST /v1/projects/{id}/parcels/split (precisiondocs_split_parcel).

A flagged proposal needs the user's reason. conflicts on a proposal names the rules the plan would break. Approving one without a reason is 422 proposal_override_reason_required; the reason is recorded in the plan's decision ledger beside the overridden findings. It is the user's own words - a client must never supply it for them.

The compile runs inline. The engine is deterministic and a 16-acre multifamily concept compiles in seconds, so approve answers with applied_revision_id, zone_failures and metrics in one call, and GET .../site-plan reports has_concept: true right after. 409 proposal_expired means the program or plan changed since the proposal - propose again. 409 proposal_blocked names a prerequisite to fix first and leaves the proposal retryable; 409 proposal_failed is a domain rejection of the compile. Re-approving an applied proposal replays (replayed: true) and never compiles twice.

Reports & Artifacts

Generate due-diligence and feasibility reports, then download artifacts through one-time links.

How do I generate and download reports?

EndpointWhat it doesRate limit
POST /v1/projects/{project_id}/reportsStart a report job (202 with job_id, nullable run_id and poll)5/min
GET /v1/runs/{run_id}Poll the run (precisiondocs_get_run); a succeeded report names its result.deliverable_ids120/min
GET /v1/projects/{project_id}/runsList the project's runs in cursor pages60/min
GET /v1/projects/{project_id}/deliverablesList ready files in cursor pages (precisiondocs_list_deliverables)60/min
GET /v1/projects/{project_id}/deliverables/{deliverable_id}Read file metadata without minting a link (precisiondocs_get_deliverable)60/min
POST /v1/projects/{project_id}/deliverables/{deliverable_id}/linksMint a fresh one-time download link (precisiondocs_create_download_link)30/min
GET /v1/downloads/{token}Stream the file a one-time link names; the link is the credential60/min per IP

Report generation:

  • report_type is due_diligence or feasibility.
  • Generation is asynchronous: follow the returned poll.
  • When poll names /v1/runs/{run_id}, poll that run until it is terminal, respecting retry_after_seconds; a finished report has status succeeded, and one whose document was not saved reads failed, never succeeded with nothing to download.
  • When no run was recorded or the credential lacks project:read, poll keeps the report path.

REST callers can poll that path; MCP callers look for the report with precisiondocs_list_deliverables in a few minutes.

  • If a matching report job is already queued or running, the API attaches to the in-flight job instead of dispatching (and billing) a duplicate.

Deliverable downloads:

  • Use a report run's result.deliverable_ids, an export or agent turn's artifact_id as deliverable_id, or list the project's ready deliverables.

Listing and reading metadata mint no link.

  • The links endpoint (precisiondocs_create_download_link) returns url, expires_at and single_use: the URL works once and expires after 15 minutes, and the file streams from our server without exposing storage URLs or credentials.

Request another link whenever you need a fresh one; reminting is free.

  • Hand your user only these PrecisionDocs links.

If your own code downloads the file, mint a fresh link for the user, because the one you used is spent.

Wallet & Billing

How API usage debits the organization credit wallet, and per-key and per-connection spending limits.

How is API usage billed?

GET /v1/wallet returns the organization's credit balance so your integration can check affordability before metered work.

The credit model:

  • One price per project: project creation (POST /v1/projects) holds the project price up front and debits it once, when the first build finishes. A build that produces nothing is released and charged nothing.
  • Metered: agent turns (POST .../messages), summaries (POST .../summaries), and report generation (POST .../reports) debit credits based on the underlying work, the same way as connector usage.
  • Flat: knowledge-base search (POST .../search) costs 2 credits per call.
  • Free: reads (project polling, site knowledge, message history, report status, artifact listing, wallet checks).

Spending limits:

  • Keys can carry optional daily, weekly and monthly spending limits (never mandatory); a day starts at 00:00 UTC, a week on Monday at 00:00 UTC and a month on the 1st. When a limit or the wallet balance is used up, metered endpoints return 402 (api_key_credit_cap_exceeded or insufficient_credits).
  • A chat-agent (MCP) connection can carry an optional daily, weekly or monthly spending limit, chosen on the consent page or set later on the app's row in Account -> Integrations -> Connected apps; past one, metered endpoints return 402 connection_credit_cap_exceeded; raise or remove the limit on that row.
  • A key's or connection's limits are read before every operation that spends credits, and count what that key or connection charged to the wallet.
  • Owners choose a plan (monthly credits that reset each month) and any member can buy extra usage (from $50, never expires) in Account -> Billing. When this month's plan and the extra usage are both spent, the 402 insufficient_credits message names the date the plan resets, in plan_resets_at as well.

API and connector spend land in the same workspace wallet and are labelled API or MCP in usage views. For the customer-facing explanation of what spends credits and why amounts vary, see the Credits & Billing help articles.

Errors & Rate Limits

The error envelope, common error types, per-route limits, and the 202-then-poll pattern.

What does an error response look like?

Errors rendered by the app's exception handlers are one RFC 9457 problem document, Content-Type: application/problem+json, whether from a route, the scope check, request validation, the operation limiter or an unknown path:

{
  "type": "https://precisiondocs.ai/developers/errors#bootstrap_not_ready",
  "title": "Conflict",
  "status": 409,
  "code": "bootstrap_not_ready",
  "detail": "The requested map layer is still being collected.",
  "request_id": "5d0c1c9e-7f1b-4f5e-9a57-2f6d3c1b8e44",
  "retry_after_seconds": 15,
  "poll": "/v1/projects/{project_id}"
}

Branch on code. detail is human copy, request_id matches the X-Request-ID response header (quote it to support), and recovery.action (with recovery.url where there is one) says what to do next when the error has a known recovery. The context of each error rides beside them: required_scope, required_credits and available_credits, period and credit_cap, gaps, and for a request the schema refused, errors[] with each bad field, its code and a message.

A 429 from the per-route rate limiter is the same shape with code: "rate_limited", retry_after_seconds and a Retry-After header. It is always transient - wait the named seconds and retry the same call. The per-address default limit refuses before routing with application/json, a detail message and Retry-After; it carries neither the problem envelope nor deprecation headers.

Common error codes (each with its HTTP status):

  • not_found (404): unknown resource, or a project outside your organization.
  • insufficient_scope (403): the key lacks the scope for this endpoint.
  • bootstrap_not_ready (409): the requested map has no usable source data yet while collection runs; unrelated reads remain available.
  • goal_version_conflict (409): the project goal moved since the user_goal_revision / user_goal_hash you read. Re-read GET /v1/projects/{id}, confirm the wording with the user, and send again.
  • goal_version_required (428): PATCH /v1/projects/{id} was sent without expected_goal_revision or expected_goal_hash; a goal is replaced whole, never overwritten blind.
  • invalid_interview_answer (400): one or more interview answers were rejected; nothing was recorded, and errors names each bad field.
  • site_plan_studio_not_enabled (403): site planning is not on this workspace's plan (it comes with every paid plan); the compile writes are refused while every read still works.
  • planning_session_conflict (409): the planning_session_id is no longer the active session, or the state_version is stale. Re-read and retry.
  • program_incomplete (409): the program still has required gaps; gaps names them per zone.
  • invalid_program (422): the program cannot be approved as it stands, such as a staged parking draft that could not be confirmed.
  • program_not_approved (409): a concept was proposed before the program was approved.
  • concept_proposal_rejected (409): the proposal could not be built as asked: an unknown zone_id, a zone with no sketched boundary, or no existing concept for a zone_id regeneration to start from.
  • home_placement_required (409): use the single-home prepare, review, edit and confirm placement flow instead of generic program/proposal writes.
  • home_placement_refused (400, 409 or 503): placement could not be prepared, edited, confirmed or queued; resolve the returned block or message, then re-read the current draft before retrying.
  • home_placement_not_supported (409): placement requires one single-family home on an existing lot.
  • typology_not_supported_via_api (409): subdivision and single-family programs outside the custom-home workflow cannot be compiled through this lane. To divide a parcel into lots, use POST /v1/projects/{id}/parcels/split (precisiondocs_split_parcel).
  • proposal_override_reason_required (422): the proposal carries conflicts; approving it needs the user's written reason.
  • proposal_expired (409): the program or plan changed since the proposal was made. Propose again.
  • proposal_blocked (409): a prerequisite the compile needs is missing (block says which); the proposal stays retryable.
  • proposal_failed (409): the compile was refused on a domain rule (repair gate, conflict); the proposal is marked failed.
  • proposal_decided (409): the proposal was already approved, rejected or expired.
  • proposal_execution_failed (500): the compile faulted rather than refusing; the proposal is left retryable, so retry the same approve.
  • idempotency_key_reused (409): the same Idempotency-Key was sent with a different payload.
  • idempotency_in_progress (409): a request with this Idempotency-Key is still running. Retry.
  • concurrency_limit_exceeded (429): too many concurrent agent turns for this key (limit 2), with retry_after_seconds in the body and a Retry-After header.
  • house_paid_daily_limit (429): this key or connection started 50 pieces of work today that PrecisionDocs pays for itself (URL documents, GIS services, source previews, code checks, chapter retries, utilities sources, and free parcel searches and screens), the daily limit for that work. Retry-After names the wait until 00:00 UTC; supplemental ordinance sources, duplicates and calls that queued nothing are not counted.
  • insufficient_credits (402): the organization wallet is empty.
  • api_key_credit_cap_exceeded (402): this key reached its daily, weekly or monthly spending limit.
  • connection_credit_cap_exceeded (402): this chat-agent connection reached the daily, weekly or monthly spending limit chosen when it was connected; raise it in Account -> Integrations -> Connected apps.
  • free_tier_limit (402): a free-plan limit. The feature (own documents, sources, GIS registration) is not on the free plan, or its allowance is used up; limit names which. Add credits.
  • search_unavailable (503): search is temporarily unavailable. Retry with backoff.

What are the rate limits?

Operation limits are per credential. Exceeding one returns 429 with a Retry-After header and a problem document naming the wait (code: "rate_limited" plus retry_after_seconds) - wait and retry the same call. The MCP client puts the wait in the error text as "Retry after Ns".

RouteLimit
POST /v1/projects8/min
POST /v1/plan-check20/min
POST .../sources, POST .../gis-sources10/min
POST /v1/uploads/initiate, POST /v1/uploads/{job_id}/finalize30/min
GET /v1/projects, GET /v1/projects/{id}60/min
PATCH .../parcels/{i}/zoning30/min
PATCH /v1/projects/{id}30/min
GET .../site-knowledge60/min
POST .../messages2/min (concurrency 2)
GET .../messages, GET .../messages/{turn_id}60/min
POST .../search30/min
POST .../summaries5/min
POST .../gis-exports10/min
POST .../maps10/min
POST /v1/parcels/resolve20/min
POST /v1/parcels/preview10/min
GET .../site-plan, GET .../design-criteria, GET .../yield-scenario60/min
POST .../site-plan-exports10/min
GET .../interview/workflows, GET .../interview/step60/min
POST .../interview/answers30/min
POST .../site-plan/program/approve30/min
POST .../site-plan/proposals, POST .../site-plan/proposals/{id}/approve, POST .../site-plan/proposals/{id}/reject10/min
GET .../site-plan/proposals60/min
GET .../gis-exports/{artifact_id}30/min
POST .../reports5/min
GET .../reports, GET .../reports/{job_id}, GET .../artifacts60/min
GET .../artifacts/{artifact_id}30/min
GET /v1/wallet30/min

The 202-then-poll pattern: long-running work (project creation, report generation) returns 202 immediately. Poll the corresponding read endpoint every 5–15 seconds until the resource is terminal - never spin faster than the read limits. GET /v1/runs/{run_id} and GET /v1/projects/{project_id}/messages/{turn_id} also take wait_seconds (0-25, default 0): the call itself waits until the status changes or the seconds pass, then answers as a plain poll would, so one held request replaces a loop.

MCP & Connectors

The remote MCP server, and how its tools map to REST operations.

How do I connect over MCP?

For Claude, ChatGPT, Claude Code, or Codex, start with Account -> Integrations. Choose your AI and follow the guided setup. The technical reference below is for custom integrations.

One MCP endpoint wraps the whole API: https://mcp.precisiondocs.ai/mcp, Streamable HTTP with OAuth 2.1 (dynamic client registration, PKCE S256, refresh-token rotation). The client opens your browser, you approve on the PrecisionDocs consent page, and the client holds a token scoped to your user and organization. No pd_live_ key is involved; the endpoint rejects one.

ClientSetup
Claude Codeclaude mcp add --scope user --transport http precisiondocs https://mcp.precisiondocs.ai/mcp, then /mcp -> precisiondocs -> Authenticate
OpenAI Codexcodex mcp add precisiondocs --url https://mcp.precisiondocs.ai/mcp, then codex mcp login precisiondocs
Gemini CLIgemini mcp add --scope user --transport http precisiondocs https://mcp.precisiondocs.ai/mcp, then /mcp auth precisiondocs (the command writes {"url": "https://mcp.precisiondocs.ai/mcp", "type": "http"} under mcpServers.precisiondocs in settings.json)
Cursor{"mcpServers":{"precisiondocs":{"url":"https://mcp.precisiondocs.ai/mcp"}}} in mcp.json, then sign in when Cursor asks
Claude app (claude.ai, Claude Desktop)Customize -> Connectors -> Add custom connector -> paste the URL -> Add -> Connect (Team and Enterprise: an Owner adds it in Organization settings -> Connectors first)
ChatGPTPlugins -> + -> Add custom MCP server -> paste the URL -> OAuth -> Create as a plugin (no such option: Developer mode under Settings -> Security and login)
Any other MCP clientThe URL alone. A client that only runs local stdio servers: npx -y --before=2026-10-15 mcp-remote@0.15.1 https://mcp.precisiondocs.ai/mcp (the standard mcp-remote bridge, same browser sign-in)

Discovery for a custom client: /.well-known/oauth-protected-resource/mcp names the authorization server, /.well-known/oauth-authorization-server lists authorization_endpoint, token_endpoint, registration_endpoint and revocation_endpoint. Disconnect a client any time from Account -> Integrations -> Connected apps; that revokes its token and refresh token immediately.

A client on a computer with no browser (a server or a container): open the authorization link it prints on any device with a browser, and approve. That device then fails to load the client's local address (http://127.0.0.1:...); copy that whole address, which holds code=, back to the client (often a --code option or a paste prompt). The code works once, within ten minutes, and only for the client that asked for it.

Use MCP when the client prefers tool calls. Use the OpenAPI spec when the client imports actions, connectors or functions natively.

A long agent turn never times out. precisiondocs_ask_agent submits the turn asynchronously (wait: false): the API answers 202 with a job_id, the turn runs on a worker, and the tool polls GET /v1/projects/{id}/messages/{job_id} for up to 45 seconds before handing the model that handle to keep polling, so the call never hits the proxy's read timeout. REST callers get the same contract by sending wait: false; wait: true still runs the turn synchronously in one request. If a transport error ever still says the turn may be running, do not re-ask (a second ask would charge a second turn): list the project messages and read the newest turn.

Switch models by asking: Tell your connected assistant "use Claude Sonnet 5.5" or "switch to Auto". It reads precisiondocs_get_models and passes the approved model_id on subsequent precisiondocs_ask_agent calls. Auto is the default whenever no explicit choice is sent. A preference change itself does not run a paid turn; the assistant keeps it within your current conversation.

MCP tools and their REST equivalents: every MCP tool calls one REST operation. precisiondocs_get_docs with no section lists every operation with the tool that calls it, its scope and its cost, and in the OpenAPI spec each operation names its tool under x-pd-mcp.tool. Over MCP, precisiondocs_add_source calls POST /v1/projects/{id}/sources, or POST /v1/projects/{id}/gis-sources when scope is given; precisiondocs_route calls POST /v1/route and returns the tools a request needs in order; and precisiondocs_get_docs makes no REST call for a workflow guide (section set to a guide id such as maps-and-exports).

REST-only, each for a stated reason precisiondocs_get_docs repeats: PATCH /v1/projects/{id}/documents/{document_id} (no MCP read lists uploaded-document ids, and a display rename changes nothing an answer reads). Deprecated, REST-only while awaiting removal, with Deprecation and Sunset headers on routed answers: GET /v1/projects/{id}/gis-exports/{artifact_id} (use precisiondocs_get_deliverable and precisiondocs_create_download_link), POST /v1/projects/{id}/summaries (use precisiondocs_ask_agent), GET /v1/projects/{id}/reports (use GET /v1/projects/{project_id}/runs and precisiondocs_list_deliverables), GET /v1/projects/{id}/reports/{job_id} (use precisiondocs_get_run), GET /v1/projects/{id}/artifacts (use precisiondocs_list_deliverables) and GET /v1/projects/{id}/artifacts/{artifact_id} (use precisiondocs_get_deliverable and precisiondocs_create_download_link). A request refused before routing by the per-address default limit carries neither header.

For guided setup, log in to PrecisionDocs and choose your AI. The app provides the current buttons and instructions. For help, see Connect your AI.

How do I install the PrecisionDocs skill for Claude?

The PrecisionDocs Agent Skill teaches Claude the workflows behind the MCP tools: which tool answers what and in what order, what needs your confirmation, what spends credits, and every map and export PrecisionDocs makes, with how to put maps into a document. It is generated from the same source as the MCP server's own instructions, so the two never disagree, and it drives the connector above, which must be connected too.

ClientInstall
Claude Code (macOS, Linux, Git Bash)curl -fsSL https://precisiondocs.ai/skills/precisiondocs.zip -o precisiondocs-skill.zip && unzip -o precisiondocs-skill.zip -d ~/.claude/skills && rm precisiondocs-skill.zip
Claude Code (Windows PowerShell)Invoke-WebRequest https://precisiondocs.ai/skills/precisiondocs.zip -OutFile precisiondocs-skill.zip; Expand-Archive -Force precisiondocs-skill.zip "$HOME/.claude/skills"; Remove-Item precisiondocs-skill.zip
Claude app (claude.ai, Claude Desktop)Download precisiondocs.zip, then open Settings, find Skills, choose Upload skill and pick the zip

Claude loads the skill when a request fits it. Without the skill the same guides are one call away inside MCP: precisiondocs_get_docs with section set to a guide id (for example maps-and-exports), or with no section for the list of guides and the full API index.

Can I address PrecisionDocs by my agent name in Claude?

Yes. Name your agent under Account -> Profile -> Agent personality. Every MCP session you connect opens its server instructions with that name (for example: The user calls PrecisionDocs "Atlas". A request to Atlas is a request to use these tools.) and names it on precisiondocs_ask_agent, so asking Claude "Atlas, what are the setbacks on my Maple Street project?" reaches PrecisionDocs instead of being answered from Claude's general knowledge.

The name is kept to plain name characters, up to 50. A name that already means Claude or any assistant (Claude, ChatGPT, Gemini, Copilot, Assistant, AI, Agent, Bot and similar) is not used for routing, because it would send your ordinary requests into paid agent turns; pick a distinct name such as Atlas. Claude reads the instructions when it connects, so after a rename start a new Claude session to pick it up.

OpenAPI Spec

The machine-readable schema and importing it into ChatGPT Actions.

Where is the OpenAPI spec?

The public OpenAPI 3.1 schema lives at https://api.precisiondocs.ai/v1/openapi.json. It is pruned to the public /v1 surface and always matches production.

ChatGPT Actions: in your Custom GPT, open Configure -> Actions -> Create new action, click Import from URL, and paste the spec URL. Do not paste the URL into the large Schema editor; use the Import dialog. Then set Authentication -> API Key -> Bearer with your pd_live_ key.

Any OpenAPI-aware client generator (openapi-typescript, openapi-python-client, Postman/Insomnia import) works against the same URL.

Also useful

PrecisionDocs
Reload page