Skip to content

Datasets

Upload your own polygon datasets (delivery zones, sales territories, custom boundaries) and query them with the same endpoints used for system datasets.

POST /v1/datasets

Creates a dataset record and returns a pre-signed upload URL. Upload your file to the URL, and the pipeline processes it automatically.

{
"name": "My Delivery Zones",
"filename": "zones.geojson"
}
FieldTypeRequiredDescription
namestringYesDisplay name (max 255 characters)
filenamestringYesOriginal filename. Used to detect format.
slugstringNoURL-safe identifier. Auto-generated from name if omitted.
descriptionstringNoShort description (max 255 characters)
{
"datasetId": "a1b2c3d4-...",
"slug": "my-delivery-zones",
"uploadUrl": "https://s3.amazonaws.com/...",
"expiresIn": 900,
"api_version": "v1"
}

Use the uploadUrl to upload your file directly to S3:

Terminal window
curl -X PUT "$UPLOAD_URL" \
-H "Content-Type: application/octet-stream" \
--data-binary @zones.geojson

The upload URL expires in 15 minutes.

Supported formats:

FormatExtensionNotes
GeoJSON.geojson, .jsonRFC 7946
Shapefile.zipZIP archive containing .shp, .shx, .dbf, and .prj
KML.kmlKeyhole Markup Language
KMZ.kmzCompressed KML
CSV.csvMust include lat and lng columns
WKT.wktWell-Known Text geometry
WKB.wkbWell-Known Binary geometry

After upload, the pipeline validates, converts, and indexes your data. This typically takes a few seconds. Poll the dataset status to check progress:

Terminal window
curl -s "https://api.terranode.co/v1/datasets/DATASET_ID" \
-H "x-api-key: YOUR_API_KEY" | jq .status

Status values: pendingprocessingready (or error).


GET /v1/datasets/{id}

Returns dataset metadata including processing status, feature count, bounding box, and any ingestion warnings.

Terminal window
curl -s "https://api.terranode.co/v1/datasets/DATASET_ID" \
-H "x-api-key: YOUR_API_KEY" | jq .
{
"datasetId": "a1b2c3d4-...",
"slug": "my-delivery-zones",
"name": "My Delivery Zones",
"status": "ready",
"features": 847,
"bbox": [-122.5, 37.7, -122.3, 37.9],
"geometryType": "Polygon",
"version": 1,
"createdAt": "2026-03-18T12:00:00Z",
"updatedAt": "2026-03-18T12:00:05Z",
"api_version": "v1"
}

GET /v1/datasets

Returns all datasets owned by your account.

Terminal window
curl -s "https://api.terranode.co/v1/datasets" \
-H "x-api-key: YOUR_API_KEY" | jq .

PUT /v1/datasets/{id}

Upload a new version of an existing dataset. Returns a new upload URL. Previous versions are retained for 30 days.

Terminal window
curl -s -X PUT "https://api.terranode.co/v1/datasets/DATASET_ID" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"filename": "zones-v2.geojson"}' | jq .

DELETE /v1/datasets/{id}

Permanently deletes the dataset and all its versions.

Terminal window
curl -s -X DELETE "https://api.terranode.co/v1/datasets/DATASET_ID" \
-H "x-api-key: YOUR_API_KEY"

Once a dataset reaches ready status, query it using dataset (by slug) or dataset_id (by UUID) on any query endpoint:

Terminal window
# By slug
curl -s "https://api.terranode.co/v1/pip?lat=37.78&lng=-122.41&dataset=my-delivery-zones" \
-H "x-api-key: YOUR_API_KEY" | jq .
# By dataset ID
curl -s "https://api.terranode.co/v1/pip?lat=37.78&lng=-122.41&dataset_id=a1b2c3d4-..." \
-H "x-api-key: YOUR_API_KEY" | jq .
  • 1 custom dataset
  • Up to 500 features per dataset