Skip to content

Create a domain

You are viewing in-progress documentation for v2. Switch to the stable version for the current production release.

A domain is the spatial container every other v2 resource hangs off. Grids, inventories, and exports are all addressed by a domain-scoped URL (/domains/{domain_id}/...), so the first call in any FastFuels workflow creates a domain. This guide sends POST /domains with a GeoJSON polygon, captures the id, and verifies it with GET.

  1. An API key. Create one in the FastFuels web app under your account settings. Set it once here: my-api-key. It will propagate to every code block on the page.

  2. A polygon you want to model, satisfying three hard constraints:

    • Within CONUS. The continental US only.
    • A bounding box of at most 16 km². The API measures the axis-aligned bounding box of the polygon in the projected CRS, after any pad_to_resolution padding, not the polygon itself.
    • Wrapped in a FeatureCollection. A bare Feature is rejected.

Submit a POST to /domains with your FeatureCollection. Omit crs and the API treats your coordinates as WGS84 (EPSG:4326) and reprojects to UTM. Supply crs explicitly when your coordinates are already projected (EPSG:5070, UTM, etc.) and the API preserves them. The API stores the polygon’s bounding box as the domain, not the polygon. The example below uses a rectangle near Missoula, Montana in WGS84 — replace the geometry, name, and description with your own.

Request polygon
The polygon in the create request.
Create domain
curl -X 'POST' \
'https://api.fastfuels.silvxlabs.com/v2/domains' \
-H 'accept: application/json' \
-H 'api-key: my-api-key' \
-H 'Content-Type: application/json' \
-d '{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[-114.11217537297199, 46.82496749915157],
[-114.09545796676623, 46.82496749915157],
[-114.09545796676623, 46.8324794598619],
[-114.11217537297199, 46.8324794598619],
[-114.11217537297199, 46.82496749915157]
]
]
}
}
],
"name": "Blue Mountain Recreation Area",
"description": "Approximately 1 square kilometer near Missoula, Montana."
}'

Two fields on the response drive the rest of your workflow:

  • id — the domain identifier. Every subsequent request to grids, inventories, or exports for this domain uses it in the URL.
  • crs — the projected CRS the API stored. GeoTIFF uploads to this domain must use this CRS.

Copy the id from the response into the widget below. Other how-tos have their own DOMAIN_ID field. Paste the ID there on each page that needs it.

Your domain ID: your-domain-id

A GET confirms the domain persisted and is readable.

GET the domain
curl -X 'GET' \
'https://api.fastfuels.silvxlabs.com/v2/domains/your-domain-id' \
-H 'accept: application/json' \
-H 'api-key: my-api-key'

A 200 OK with a matching id confirms it persisted. 404 Not Found means either the ID is wrong or the domain belongs to a different account — domains are scoped to their owner.

  • name and description default to empty strings. Set them when you want the domain to be self-identifying in a list view.
  • pad_to_resolution (meters) snaps the working extent outward to a multiple of this value. Set it when you plan to compose grids at multiple resolutions on the same domain. Otherwise omit it.
  • style carries map render hints (stroke_color, fill_opacity, etc.) consumed by the webapp. Skip unless you’re driving a map UI.
  • Bare Feature instead of FeatureCollection — returns 422 with a pydantic validation array. The fingerprint to look for:

    {"type":"literal_error","loc":["body","type"],
    "msg":"Input should be 'FeatureCollection'"}

    Wrap the feature: {"type":"FeatureCollection","features":[<your feature>], ...}.

  • Polygon outside CONUS — returns 422 with:

    {"detail":"Invalid spatial extent. The domain must be entirely within CONUS."}

    Even one vertex outside the continental US fails. Alaska, Hawaii, and territories are out of scope.

  • Bounding box over 16 km² — returns 422 with:

    {"detail":"Invalid spatial extent. Area must be less than 16 square kilometers."}

    The API checks the area of the bounding box, so a narrow diagonal polygon can fail while its own area is small. Trim the polygon or split it across multiple domains. If you set pad_to_resolution, leave headroom — padding runs before the area check.

  • Missing or wrong api-key header — returns 401 with {"detail":"Unauthorized"}. Confirm the header name is api-key (not Authorization) and the value matches an active key.

  • Mismatched CRS on a follow-up grid upload — not an error on this call. The CRS the API returns on this domain is the one your GeoTIFFs must match, not the one you submitted. Read crs off the create response before reprojecting uploads.