POST/v1/action

Perform Action

Perform an action on a completed task — upscale a specific image, create a variation, or reroll the entire grid. The action runs asynchronously, just like /imagine.

Request Body

task_idrequired
string
The task_id from a completed /v1/imagine result.
actionrequired
string
The action to perform. See available actions below.
webhook_url
string
Optional URL to receive a POST callback when done.

Available Actions

ActionDescription
upsample1Upscale image #1 (top-left)
upsample2Upscale image #2 (top-right)
upsample3Upscale image #3 (bottom-left)
upsample4Upscale image #4 (bottom-right)
variation1Create variations of image #1
variation2Create variations of image #2
variation3Create variations of image #3
variation4Create variations of image #4
rerollRerun the same prompt to generate a new grid

Example Request

cURL
curl -X POST https://linkrapi.com/api/v1/action \
  -H "Authorization: Bearer lkr_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "task_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "action": "upsample1"
  }'

Response

200 OK
{
  "status": "SUCCESS",
  "task_id": "f7e8d9c0-b1a2-3456-cdef-789012345678",
  "message": "Action submitted successfully"
}

Status Codes

200Action submitted successfully.
400Invalid action or original task has no components.
401Invalid or missing API key.
404Original task not found.
⚠️ Notes
• The original task must have status completed and include component data.
• You can also pass a raw custom_id from the components array for advanced use cases.
• The new task_id returned should be polled via /v1/fetch just like an imagine task.