Update a task
Changed onA partial write: send only the fields that change. To change a drench's head or products, prefer updateTreatmentRecord (treatment.id, not the task id). drench.products here also replaces the set. created_as is ignored on update. Back-dating uses completed_at with an Australian offset; see createTask.
Attaching a PurpleGrain AI record. To place a record with no asset (filter[unassigned]=true on listTasks), send the asset relationship (a mob or paddock you can edit). The task's property is set from the asset. This works before and after the formatter has run, and on a record with no typed child. A treatment or husbandry record takes a mob; spray, fertiliser, sowing and field work a paddock. Editing a record never queues it for the formatter again.
PurpleGrain AI records are first-party. An MCP client cannot turn a task into one: a request from one that sets operation_type: ai on a task that is not already an AI record is refused with 403 and nothing is written. Sending an AI record's own type back while attaching its asset still passes.
Broadcasting is paused for agents. A request from an API or MCP client whose body names broadcast or share_scope — true or false — is refused with 403 and nothing is written; leave both out. First-party web and mobile requests are unaffected.
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. image_mode defaults to append (add to the existing photos); replace swaps them all out; remove_image_ids deletes specific ones (ids from image_ids). If any image fails, the update is rolled back. The attaching call still needs confirm: true.
The MCP tool is refused until it is called again with confirm: true. If the call errors or times out, read the task back before retrying.
Request
- Base URLhttps://api.purplegrain.com/api/v1
- URLhttps://api.purplegrain.com/api/v1/tasks/{id}
- AuthHTTP bearer
Path parameters
Id of the record
Query parameters
Comma-separated snake_case relationship paths to embed (JSON:API included array, or inlined for application/json). Never embedded by default; a path outside the allowed list is refused with 400 unknown_include (see the 400 response); dot notation selects children; max 10 paths. Allowed paths: producer, provider, category, place, place.location, service, service.owner, service.category, service.city, service.place, service.location, property, parent, children, asset.
Request body
Response
Update. When the include query parameter is used, the response may contain an included array (JSON:API) or inlined related resources (application/json).
Example response
{
"data": {
"type": "task"
}
}Changes
- info
the request property
/became optional (media type: application/vnd.api+json) - info
added the new
enum value to the request property/////////(media type: application/vnd.api+json) - info
added the new
enum value to the request property/////////(media type: application/vnd.api+json) - info
added the new
enum value to the request property///////(media type: application/vnd.api+json) - info
added the new
enum value to the request property///////(media type: application/vnd.api+json) - info
added the new
enum value to the request property/////////(media type: application/vnd.api+json) - info
added the new
enum value to the request property/////////(media type: application/vnd.api+json) - info
added the new
enum value to the request property///////(media type: application/vnd.api+json) - info
added the new
enum value to the request property/////////(media type: application/vnd.api+json) - info
added the new
enum value to the request property/////////(media type: application/vnd.api+json) - info
added the new
enum value to the request property/////////(media type: application/vnd.api+json) - info
added the new
enum value to the request property/////////(media type: application/vnd.api+json) - info
added the new
enum value to the request property/////////(media type: application/vnd.api+json) - info
added the new
enum value to the request property/////////(media type: application/vnd.api+json) - info
added the new
enum value to the request property/////////(media type: application/vnd.api+json) - info
added the new
enum value to the request property/////////(media type: application/vnd.api+json) - info
added the new
enum value to the request property/////////(media type: application/vnd.api+json) - info
added the new
enum value to the request property///////(media type: application/vnd.api+json) - info
added the new
enum value to the request property///////(media type: application/vnd.api+json) - info
added the new
enum value to the request property/////////(media type: application/vnd.api+json) - info
added the new
enum value to the request property/////////(media type: application/vnd.api+json) - info
added the new
enum value to the request property/////////(media type: application/vnd.api+json) - info
added the new
enum value to the request property/////////(media type: application/vnd.api+json) - info
added the new
enum value to the request property/////////(media type: application/vnd.api+json) - info
added the new
enum value to the request property///////(media type: application/vnd.api+json) - info
added the new
enum value to the request property////////(media type: application/json) - info
added the new
enum value to the request property////////(media type: application/json) - info
added the new
enum value to the request property//////(media type: application/json) - info
added the new
enum value to the request property//////(media type: application/json) - info
added the new
enum value to the request property////////(media type: application/json) - info
added the new
enum value to the request property////////(media type: application/json) - info
added the new
enum value to the request property//////(media type: application/json) - info
added the new
enum value to the request property////////(media type: application/json) - info
added the new
enum value to the request property////////(media type: application/json) - info
added the new
enum value to the request property////////(media type: application/json) - info
added the new
enum value to the request property////////(media type: application/json) - info
added the new
enum value to the request property////////(media type: application/json) - info
added the new
enum value to the request property////////(media type: application/json) - info
added the new
enum value to the request property////////(media type: application/json) - info
added the new
enum value to the request property////////(media type: application/json) - info
added the new
enum value to the request property////////(media type: application/json) - info
added the new
enum value to the request property//////(media type: application/json) - info
added the new
enum value to the request property//////(media type: application/json) - info
added the new
enum value to the request property////////(media type: application/json) - info
added the new
enum value to the request property////////(media type: application/json) - info
added the new
enum value to the request property////////(media type: application/json) - info
added the new
enum value to the request property////////(media type: application/json) - info
added the new
enum value to the request property////////(media type: application/json) - info
added the new
enum value to the request property//////(media type: application/json) - info
added the optional property
///to the response with the status - info
added the optional property
///to the response with the status
- info
- info
added the optional property
//to the response with the status - info
added the optional property
//to the response with the status
- info