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.
Prerequisites
Section titled “Prerequisites”-
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.
-
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_resolutionpadding, not the polygon itself. - Wrapped in a
FeatureCollection. A bareFeatureis rejected.
Create the domain
Section titled “Create the domain”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.
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."}'import fastfuels_sdk.v2 as ff
ff.set_api_key("my-api-key")
domain = ff.Domain.from_geojson( { "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.",)print(domain.id, domain.crs.properties.name){ "bbox": [ 720227.9398802927, 5189763.323999467, 721533.6406826023, 5190645.048516054 ], "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { "type": "Polygon", "coordinates": [ [ [720227.9398802927, 5189763.323999467], [721533.6406826023, 5189763.323999467], [721533.6406826023, 5190645.048516054], [720227.9398802927, 5190645.048516054], [720227.9398802927, 5189763.323999467] ] ] }, "properties": { "name": "domain" } } ], "name": "Blue Mountain Recreation Area", "description": "Approximately 1 square kilometer near Missoula, Montana.", "crs": { "type": "name", "properties": { "name": "EPSG:32611" } }, "tags": [], "id": "your-domain-id", "created_on": "2026-11-05T18:56:54.244189", "modified_on": "2026-11-05T18:56:54.244189"}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.
Record the domain ID
Section titled “Record the domain ID”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
Verify
Section titled “Verify”A GET confirms the domain persisted and is readable.
curl -X 'GET' \ 'https://api.fastfuels.silvxlabs.com/v2/domains/your-domain-id' \ -H 'accept: application/json' \ -H 'api-key: my-api-key'domain = ff.Domain.from_id("your-domain-id"){ "bbox": [ 720227.9398802927, 5189763.323999467, 721533.6406826023, 5190645.048516054 ], "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { "type": "Polygon", "coordinates": [ [ [720227.9398802927, 5189763.323999467], [721533.6406826023, 5189763.323999467], [721533.6406826023, 5190645.048516054], [720227.9398802927, 5190645.048516054], [720227.9398802927, 5189763.323999467] ] ] }, "properties": { "name": "domain" } } ], "name": "Blue Mountain Recreation Area", "description": "Approximately 1 square kilometer near Missoula, Montana.", "crs": { "type": "name", "properties": { "name": "EPSG:32611" } }, "tags": [], "pad_to_resolution": null, "style": null, "id": "your-domain-id", "created_on": "2026-11-05T18:56:54.244189Z", "modified_on": "2026-11-05T18:56:54.244189Z"}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.
Optional fields on create
Section titled “Optional fields on create”nameanddescriptiondefault 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.stylecarries map render hints (stroke_color,fill_opacity, etc.) consumed by the webapp. Skip unless you’re driving a map UI.
Common pitfalls
Section titled “Common pitfalls”-
Bare
Featureinstead ofFeatureCollection— returns422with 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
422with:{"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
422with:{"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-keyheader — returns401with{"detail":"Unauthorized"}. Confirm the header name isapi-key(notAuthorization) 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
crsoff the create response before reprojecting uploads.