Tasks

Replace a task's photos with one image

Replace the task's existing photos with a single image. This legacy endpoint removes the current gallery before attaching the replacement; it does not append. Requires edit rights on the task and confirmation before replacing photos.

Provide image_url for a publicly reachable HTTP(S) image, or image_base64 only for a tiny generated image (under about 100 KB decoded). For a local photo, stage it with createImageUpload, then use updateTask with image_upload_ids and image_mode: replace. Use addTaskImages to keep existing photos and append instead. Returns the updated task.

post/tasks/{id}/update-image

Request

  • Base URL: https://api.purplegrain.com/api/v1
  • URL: https://api.purplegrain.com/api/v1/tasks/{id}/update-image
  • 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_urlstring uri

Publicly reachable http(s) URL of the image to fetch and attach. Prefer this when the image already lives somewhere addressable.

image_base64string

Base64-encoded image bytes (optionally a "data:...;base64," URI). Use when you hold raw bytes and have no URL.

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 1 revision of this API.