API and automation
API task reference
Create builds, list tasks, poll status, read files, and download exports through API v1.
Task endpoints
| Method | Endpoint | Scope |
|---|---|---|
| GET | /api/v1/tasks | tasks:read |
| POST | /api/v1/tasks | tasks:write |
| GET | /api/v1/tasks/{id} | tasks:read |
| GET | /api/v1/tasks/{id}/files | tasks:read |
| GET | /api/v1/tasks/{id}/export | tasks:export |
Create a build
POST /tasks requires an Idempotency-Key header containing 8–128 visible ASCII characters. Reusing the same value inside one organization returns the original task instead of charging or creating a duplicate.
| Field | Type | Notes |
|---|---|---|
| prompt | string | Required; non-empty; at most 20,000 characters. |
| app_type | string | fullstack, landing, site3d, mobile, or game; default fullstack. |
| ai_model | string | Use auto unless the plan allows a specific model. |
| is_public | boolean | Default true; private builds require plan access. |
| with_auth | boolean | Applied only to full-stack builds. |
| project_id | string or null | Must identify a project in the same organization. |
| images | array or null | Optional accepted data-URL reference images. |
curl -X POST https://trigcode.com/api/v1/tasks \
+ -H 'Authorization: Bearer tck_live_REPLACE_WITH_YOUR_KEY' \
+ -H 'Idempotency-Key: release-2026-09-09-dashboard' \
+ -H 'Content-Type: application/json' \
+ -d '{
"prompt": "Build a full-stack client portal...",
"app_type": "fullstack",
"ai_model": "auto",
"is_public": false,
"with_auth": true,
"project_id": null
}'Accepted response and polling
An in-flight build returns HTTP 202. Poll status_url or subscribe to organization webhooks. The API answers automated clarification questions with the planner's recommended first choices so a headless build can continue.
{
"data": {
"id": "short-task-id",
"status": "pending",
"credits_charged": 60,
"status_url": "/api/v1/tasks/short-task-id"
},
"meta": { "accepted": true }
}Read and export
Task identifiers accept the short public ID or internal task ID. GET /tasks supports status, page, and per_page query parameters. The files endpoint returns path/content pairs sorted by path. The export endpoint returns application/zip and includes deployment-kit content when the workspace entitlement allows it.