Tasks

Add Task Images

Append one or more photos to the task's gallery. The first gallery photo is the cover (exposed as the singular image_url). A legacy single image is migrated into the gallery (keeping its id) before appending.

A file on disk: call createImageUpload, run the returned curl_example from the shell, then pass 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. This call always appends. To swap the gallery or drop specific photos, use updateTask with image_mode: replace or remove_image_ids.

post/tasks/{id}/images

Request

  • Base URL: https://api.purplegrain.com/api/v1
  • URL: https://api.purplegrain.com/api/v1/tasks/{id}/images
  • Auth: HTTP bearer

Path parameters

idstring required

Id of the record

Query parameters

includestring
Example:producer,provider,service

Comma-separated snake_case relationship paths to embed (JSON:API included array, or inlined for application/json). Never embedded by default; unknown paths ignored; 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, farm, parent, children, asset.

Request body

image_upload_idsstring[]

Staged uploads from createImageUpload, in gallery order. This is how a file on the agent's disk is attached: call createImageUpload, run the returned curl_example from the shell, then pass these ids. Never base64-encode a local photo into a tool call. One upload can be attached to several records (up to 20) until it expires; they share the same photo.

image_urlsstring[]

Publicly reachable http(s) URLs of images to fetch and attach, in gallery order. Use this when the image is already at a public URL.

image_base64sstring[]

Base64-encoded image payloads (each optionally a "data:...;base64," URI), in gallery order. Only for a tiny generated image under about 100 KB decoded. A local photo uses image_upload_ids.

image_urlstring uri

Single-image convenience form of image_urls.

image_base64string

Single-image convenience form of image_base64s.

Response

Success. 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

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