Save boundary file to the library
POST /v1/files1 unitWrites
Exports a boundary (like export_boundary) and saves it in the organization's file library, so teammates find it on the dashboard and through list_files. visibility org (default) shares it with every member at their role; restricted keeps it to you, admins and whoever you share it with (share_file). Saving the same boundary, format and detail again returns the existing entry. Costs 1 unit. Returns the library entry with its permanent download url.
MCP tool save_file · CLI geocode save-file · RPC POST /v1/ops/save_file
Input
| Field | Type | Description |
|---|---|---|
boundary_idbody, required | string | Boundary id, as get_boundary accepts it (r62422, wikidata:Q64, iso:US-CA…). |
formatbody | "geojson" | "kml" | "wkt" | "svg" | "gml" | Default "geojson". |
detailbody | "low" | "medium" | "high" | "full" | Default "medium". |
namebody | string | A label for the library; default: the boundary's name, format and detail. |
visibilitybody | "org" | "restricted" | Default "org". |
Example request
curl -X POST "https://geocodeai.dev/v1/files" \ -H "Authorization: Bearer $GEOCODE_API_KEY" \ -H "Content-Type: application/json" \ -d '{"boundary_id":"r62422","format":"geojson","detail":"medium","visibility":"org"}'Example response
See the description above for what this returns.
Errors
Failures are RFC 9457 problems. Common ones here: 400 invalid_input, 401 unauthorized, 402 quota_exceeded, 429 rate_limited.