---
title: "Save my boundary draft for a property"
method: PUT
path: "/farms/{farm_id}/boundary_draft"
tags: ["BoundaryDrafts"]
---

# Save my boundary draft for a property

`PUT /farms/{farm_id}/boundary_draft`

## Request

- Base URL: `https://api.purplegrain.com/api/v1`
- URL: `https://api.purplegrain.com/api/v1/farms/{farm_id}/boundary_draft`
- Auth: HTTP bearer

Creates or replaces the caller's draft for this property. Only the keys
sent change; `null` clears one. A successful `PUT /farms/{id}/boundary` by the same
person deletes it.

## Path parameters

- `farm_id` string, required

## Request body

- BoundaryDraftUpdateModelAttributes: Flat attributes-adapter request body (Content-Type application/json) for the caller's boundary draft: the same fields directly under `data`. Equivalent JSON:API (nested) shape: `BoundaryDraftUpdateModel` sent as application/vnd.api+json.
  - `data` object, required
    - `ring` array[], nullable: The corners placed so far: an OPEN array of `[longitude, latitude]` pairs in RFC 7946 order — **longitude first** — 0 to 2000 of them. A draft may hold one or two corners, so this is neither a polygon nor GeoJSON; it becomes one only when the boundary is saved (`updateFarmBoundary`, `updatePaddockBoundary`). Longitude within ±180, latitude within ±90.
      - number[]: [longitude, latitude]
    - `location` SetupDraftLocation, nullable: The place the editor found for the property. `label` is required; `lng` and `lat` are both present or both absent. No other keys.
      - `label` string, required
      - `lng` number
      - `lat` number

## Response `200`

The saved draft.

- BoundaryDraftResponseAttributes: Attributes-adapter response (Accept application/json). `data` is null when the caller has no draft for the target.
  - `data` BoundaryDraftModelAttributes, nullable: The caller's unsaved boundary in attributes-adapter shape (Accept application/json), or null when there is none.
    - `id` string
    - `type` 'boundary_drafts'
    - `target_type` 'Farm' | 'Paddock'
    - `target_id` string, uuid
    - `ring` array[], nullable: The corners placed so far: an OPEN array of `[longitude, latitude]` pairs in RFC 7946 order — **longitude first** — 0 to 2000 of them. A draft may hold one or two corners, so this is neither a polygon nor GeoJSON; it becomes one only when the boundary is saved (`updateFarmBoundary`, `updatePaddockBoundary`). Longitude within ±180, latitude within ±90.
      - number[]: [longitude, latitude]
    - `location` SetupDraftLocation, nullable: The place the editor found for the property. `label` is required; `lng` and `lat` are both present or both absent. No other keys.
      - `label` string, required
      - `lng` number
      - `lat` number
    - `updated_at` string, date-time

## Other responses

- `401`: Unauthorized — no session.
- `403`: Forbidden — the caller may not edit this property's boundary; or an API key or an assistant's token (first-party only).
- `404`: No such property.
- `422`: A ring that is not `[lng, lat]` number pairs in range or holds more than 2000, or a location without a label, with half a coordinate pair or with other keys.

---

[API](https://skmtc.dev/purplegrain/apis/purple-grain-api.md) · [All operations](https://skmtc.dev/purplegrain/apis/purple-grain-api/llms.txt) · [OpenAPI document](https://skmtc.dev/purplegrain/apis/purple-grain-api/revisions/a9136f78e9fb?raw)
