Spray records

Create Spray Record

Create a task with a spray record on the existing paddock identified by paddock_id. Returns the created task, including its spray child and product rows. Requires permission and connection write access for the paddock's owner, which may be a person or business.

Accepts date, description, area_ha, up to ten products, application method as method, equipment settings and weather_readings. Product fields include batch, expiry, rate, grazing_whp_days, harvest_whp_days and export intervals. Never invent a batch, expiry, rate or withholding period. Supply only values the farmer or label states. Missing area_ha defaults to the paddock's area; date defaults to today. A past or today's date creates a completed record at midday in the application time zone and requires at least one product row. A future date creates a pending task with no completed_at.

The response derives grazing and harvest dates from the completion date and the longest positive withholding period among named products; absent qualifying values produce null dates. It stores supplied spray details and does not verify chemical suitability or label compliance. Each successful call creates a new task; check for a same-date, same-product duplicate before submitting or retrying an uncertain result. Confirm the proposed write with the farmer, then call with confirm: true. An insufficient_access error means the connection lacks the required access; show its detail instead of retrying the write. Photos. A file on disk is staged with createImageUpload, whose curl_example PUTs the bytes, and attached with image_upload_ids. Never base64-encode a local photo into a tool call. A public http(s) URL: pass image_urls. Only a tiny generated image (under about 100 KB decoded) uses image_base64s. One upload can be attached to several records until it expires. On update, image_mode defaults to append (add to the existing photos); replace swaps them all out; remove_image_ids deletes specific ones. If any image fails, the whole create or update is rolled back. The attaching call still needs confirm: true. createImageUpload and its PUT do not.

post/paddocks/{paddock_id}/spray-records

Request

  • Base URL: https://api.purplegrain.com/api/v1
  • URL: https://api.purplegrain.com/api/v1/paddocks/{paddock_id}/spray-records
  • Auth: HTTP bearer

Path parameters

paddock_idstring required

The paddock that was sprayed.

Headers

Idempotency-Keystring

Optional. Send the same value when retrying a create after a 502 or 504. The same user, path and key returns the original result instead of writing a second one. The key is kept for 24 hours.

Request body

Example request

{
  "data": {
    "date": "2026-09-28",
    "description": "Spot spray the thistles"
  }
}

Response

Created. The task, with its spray.

Example response

{
  "data": {
    "type": "task"
  }
}

Changes

No recorded changes to this operation across all 3 revisions of this API.