CopyHero

Preflight Task For Agent

POST
/api/v1/tasks/agent-preflight

Preflight one statically bounded external-agent workflow batch.

Authorization

HTTPBearer
headerAuthorizationBearer <token>

Request Body

application/json
  1. body

Agent-only workflow request with a hard fanout/cost boundary.

The UI keeps using :class:JobStart and its live, tenant-configured import cap (currently 250 by default). External agents receive a smaller static contract so one tool call cannot fan out arbitrarily before service-level quota and ownership checks run.

task_blueprint_id?integer|null
store_id?integer|null
import_profile_id?|

Optional saved Import Profile (GET /settings/import-profiles) to expand into this batch's store, workflow, image output, and per-row Shopify options (including metafield_set_id and productLibraryFolderIds). Precedence: an explicit store_id/task_blueprint_id/image_output on this request always wins over the profile's; omitting any of those three takes the profile's value instead; an explicit store_id=null keeps the request targeting the product library and drops the profile's store entirely, even if the profile names one. Per-row fields (e.g. tags, rehostDescriptionImages, setActive/shopify_status, metafield_set_id, productLibraryFolderIds) the profile carries apply only to a row that does not already set that field itself.

image_output?|

Optional generated-image output override for the whole run. Omit or send an empty object to inherit the destination store.

input_data*array<>

Workflow input rows for one bounded agent batch (1-100).

Items1 <= items <= 100

Response Body

Successful Response

application/json
  1. response

A preflight check for a task.

quota_required*Quota Required
quota_available*Quota Available
quota_after_task*Quota After Task
operation_possible*Operation Possible
breakdown?array<>
Example Request
curl -X POST 'https://app.copyhero.app/api/v1/tasks/agent-preflight' \  -H 'Content-Type: application/json' \  -d '{  "input_data": [    {}  ]}'
Example Response
{  "quota_required": 0,  "quota_available": 0,  "quota_after_task": 0,  "operation_possible": true,  "breakdown": [    {      "reason": "string",      "credits": 0,      "count": 0    }  ]}