Share library file
POST /v1/files/{id}/sharesFreeWrites
Shares a library file with a team (by slug or id) or a person in the organization (by email or user id) at read, write or admin access; sharing again changes the access. Needs admin access on the file (its creator, an org admin, or an admin share). Viewers are capped at read whatever the share says. Free. Returns the file's shares.
MCP tool share_file · CLI geocode share-file · RPC POST /v1/ops/share_file
Input
| Field | Type | Description |
|---|---|---|
idpath, required | string | The file's id from list_files or save_file. |
teambody | string | Team slug or id. |
userbody | string | A member's email or user id. |
accessbody | "read" | "write" | "admin" | Default "read". |
Example request
curl -X POST "https://geocodeai.dev/v1/files/00000000-0000-4000-8000-000000000000/shares" \ -H "Authorization: Bearer $GEOCODE_API_KEY" \ -H "Content-Type: application/json" \ -d '{"team":"gis","access":"read"}'Example response
See the description above for what this returns.
Errors
Failures are RFC 9457 problems. Common ones here: 400 invalid_input, 401 unauthorized, 429 rate_limited.