Start an action run
Start an action run with the FLORA API: POST /runs/action.
Starts a headless prebuilt action run using raw action slugs such as rotate-image, workspace_id, project_id, and non-empty inputs. Direct action runs do not create or mutate canvas nodes. Mutating public API requests support an optional Idempotency-Key header for client retries; duplicate keys within two hours return idempotency_duplicate.
POST https://app.flora.ai/api/v1/runs/actionAuth: API key as a bearer token,
Authorization: Bearer $FLORA_API_KEY. See Authentication.TypeScript SDK:
client.actions.run().Idempotency: optional
Idempotency-Keyheader. See Idempotency.Operation ID:
createActionRun.
Example
curl -X POST 'https://app.flora.ai/api/v1/runs/action' \
-H "Authorization: Bearer $FLORA_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"action_id": "color-grade-image-browser",
"workspace_id": "ws_abc123",
"project_id": "prj_abc123",
"inputs": [
{
"type": "image"
}
]
}'import { FloraClient } from '@flora-ai/flora';
const client = new FloraClient({ apiKey: process.env['FLORA_API_KEY'] });
const action = await client.actions.run({
action_id: 'color-grade-image-browser',
workspace_id: 'ws_abc123',
project_id: 'prj_abc123',
inputs: [
{
type: 'image',
},
],
});
console.log(action);Request body
Required.
The body takes one of 42 shapes, set by action_id.
Fields every shape has:
workspace_id
string
Yes
Workspace identifier. Use the public API ID returned by list workspaces; it must start with ws_. Pattern: ^ws_\S+$. Example: ws_abc123.
project_id
string
Yes
Project identifier. Use the public API ID returned by list projects; it must start with prj_. Used for ownership, billing, and run history. Direct action runs do not mutate the project canvas. Pattern: ^prj_\S+$. Example: prj_abc123.
inputs
array of objects
Yes
Action inputs. Direct action runs are headless and read inputs from URLs/text rather than canvas edges. At least 1 item.
inputs[].type
string
Yes
Action input type. One of: image, video, audio, text, model3d.
inputs[].url
string (uri)
No
Input media URL
inputs[].asset_id
string
No
Asset identifier for model3d inputs. Pattern: ^asset_\S+$. Example: asset_abc123.
inputs[].text
string
No
Input text value
inputs[].name
string
No
Optional input name
params
object
No
Action parameters
state
any
No
Interaction state committed by the action's live preview (JSON, at most 256 KiB), replayed by the run exactly as the canvas replays a node's own state. Only meaningful for browser-runtime actions; omit otherwise.
Fields that depend on the shape:
Responses
201: Action run started.
run_id
string
Yes
Run identifier. Pattern: ^run_\S+$. Example: run_abc123.
type
string
Yes
Run type. One of: generation, technique, action.
model
object or null
No
model.model_id
string
Yes
Model identifier. At least 1 character. Example: t2i-flux-2-pro.
technique
object or null
No
technique.technique_id
string
Yes
Technique identifier. Pattern: ^tech_\S+$. Example: tech_abcd1234.
technique.name
string
Yes
Technique name
action
object or null
No
action.action_id
string
Yes
Action identifier. One of: color-grade-image-browser, overlay-image-browser, draw-image-browser, pixel-remover-image-browser, magic-eraser-image-browser, crop-image-browser, scene-3d-image-browser, blur-image-browser, change-image-ar-browser, rotate-image-browser, color-filter-image-browser, color-tint-image-browser, filter-color-image-browser, duplicate-image-browser, side-by-side-composite-browser, add-shape-to-image-browser, add-text-to-image-browser, qr-code-generator-browser, resize-image-browser, shader-effect-browser, split-text-browser, find-and-replace-text-browser, concat-text-browser, ken-burns-video, stitch-videos, split-video, extract-video-frames, color-grade-video, video-to-frame-grid, boomerang-video, reverse-video, video-to-long-exposure, video-effect, color-filter-video, speed-up-video, slow-down-video, duplicate-video, greenscreen-video, resize-video, change-video-ar, and 2 more.
estimated_seconds
integer or null
Yes
At least 0.
charged_cost
number
Yes
Cost charged in USD. At least 0.
poll_url
string (uri) or null
No
URL to poll pending/running runs or fetch completed/failed run details.
project_id
string or null
No
Project identifier. Pattern: ^prj_\S+$. Example: prj_abc123.
canvas_url
string (uri) or null
No
Link to the project canvas. Hand this to the user as-is; a URL built from project_id does not resolve.
warnings
array of objects
No
Warnings for accepted input (unknown parameters and applied preprocessing changes)
warnings[].code
string
Yes
Stable warning code
warnings[].message
string
Yes
Human-readable warning message
warnings[].field
string
No
Feature or parameter the warning relates to
Errors
Every error has the same body: error.code, error.message, and error.fields on validation errors. See Errors for how to recover from each code.
400
invalid_json, input_validation_error
The body isn't valid JSON, or an input failed validation (fields lists each one).
401
unauthorized, invalid_api_key
The API key is missing, invalid or revoked.
402
insufficient_credits
The workspace balance is too low for this request.
403
forbidden, paid_plan_required
The key can't do this, or the workspace plan doesn't include it.
404
not_found
The resource doesn't exist or isn't visible to this key.
409
idempotency_duplicate, revision_conflict
Duplicate Idempotency-Key or a stale base_revision.
429
rate_limited
Too many requests. Back off and retry.
500
unknown_error, internal_error
Something failed on FLORA's side. Retry with backoff.
503
temporarily_unavailable
Authorization is temporarily unavailable. Retry later.
Last updated
Was this helpful?