---
title: "Create Sandbox Project"
method: POST
path: "/api/v1/project/sandbox"
tags: ["project"]
---

# Create Sandbox Project

`POST /api/v1/project/sandbox`

Create a single-click county sandbox project pre-loaded with the
county's boundary layer.

Two-phase: this handler runs phase 1 (validate FIPS, insert PENDING
project row, return ``project_id``) synchronously and enqueues phase 2
(Neon name resolve, CREATE MATERIALIZED VIEW, register boundary layer,
flip status to READY) on the Celery `sandbox_boundary` queue. Celery is
used instead of FastAPI ``BackgroundTasks`` so a Cloud Run instance
restart between response and task completion can't strand the project
in ``PENDING`` — the broker persists the job until a worker acks.

Workspace RBAC: rejects FIPS codes not in the user's available
geographies (403). FIPS not loaded into the workspace's
``workspace_counties`` table is a 404 before any project row is
inserted. Failures inside the background task mark the project
``status=FAILED`` (visible on the project page); the task itself retries
with exponential backoff before reaching that state.

## Request body

- SandboxProjectRequest — Single-click county sandbox entry. Caller passes the FIPS code of a county already loaded into their workspace; server creates the project + boundary layer atomically.
  - `county_fips` string, required — 5-digit US county FIPS code (e.g. '12103' for Pinellas, FL)
  - `knowledge_skill_workspace_id` string, uuid, nullable

## Response `200`

Successful Response

- SandboxProjectResponse — Response carrying the new project's id so the client can navigate straight into it. The boundary layer is built asynchronously on a Celery worker — its ``layer_id`` is not known at response time. The project page polls the project until ``status`` flips from ``pending`` to ``ready`` or ``failed`` and then refetches the layer list to discover the boundary.
  - `project_id` string, uuid, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/maia-analytics/apis/maia-api.md) · [All operations](https://skmtc.net/maia-analytics/apis/maia-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/maia-analytics/maia-api/versions/ba2b8d962161/schema)
