---
title: "Save my boundary draft for a paddock"
method: PATCH
path: "/paddocks/{paddock_id}/boundary_draft"
tags: ["BoundaryDrafts"]
---

# Save my boundary draft for a paddock

`PATCH /paddocks/{paddock_id}/boundary_draft`

## Request

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

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

## Path parameters

- `paddock_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 (`updatePropertyBoundary`, `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` 'Property' | '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 (`updatePropertyBoundary`, `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 paddock's boundary; or an API key or an assistant's token (first-party only).
- `404`: No such paddock.
- `409`: Conflict — the JSON:API request document names a different resource from the URL (JSON:API 1.1 §9.2 and §9.3). `errors[0].code` is `type_mismatch` when `data.type` is not one of this endpoint's resource types (`source.pointer` is `/data/type`), or `id_mismatch` when, on an update, `data.id` is not the id in the URL (`/data/id`). Only a body sent as `application/vnd.api+json` is checked; the flat `application/json` body has no resource object. Nothing was changed. A document with no `data.type` is accepted for now.
- `415`: Unsupported Media Type — the request's `Content-Type` is `application/vnd.api+json` with a media type parameter the JSON:API media type does not allow (anything other than `ext` and `profile`; `; charset=utf-8` is the usual one). Send the bare media type. The error's `code` is `unsupported_media_type` and `source.header` is `Content-Type`. Until the switch is on (`JSONAPI_CONTENT_TYPE_PARAMS=reject`) such a request is let through and logged; the operation documents the response it will have.
- `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.

## Changes

- **2026-10-30** `143d65e52617`: 2 info
  - added the non-success response with the status `409`
  - added the non-success response with the status `415`
- **2026-10-30** `92c4663a1266`: 24 warning, 24 info
  - removed the optional property `_meta` from the response with the `401` status (media type: application/json)
  - removed the optional property `_meta` from the response with the `401` status (media type: application/vnd.api+json)
  - removed the optional property `_meta` from the response with the `403` status (media type: application/json)
  - removed the optional property `_meta` from the response with the `403` status (media type: application/vnd.api+json)
  - …44 more
- **2026-10-30** `c1bc18b1cdbc`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/purplegrain/apis/purple-grain-api/changes/paddocks/:paddock_id/boundary_draft/patch.md)

---

[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/e32f34ba218b?raw)
