Skip to content

Trigger Code2Des

POST /api/v1/organizations/{organization_id}/projects/{project_id}/code2des

Creates a deterministic conversion job from an existing completed Page Import. This endpoint never opens or captures a URL. Requires project Write access.

{
  "pageImportId": "019ffa75-01c0-75a2-8123-456789abcdef",
  "figmaFileKey": "aBc123",
  "screenId": "example.com/",
  "placementTarget": "128:9001"
}

figmaFileKey defaults to unassigned; placementTarget is optional. The Page Import must exist in the same organization/project, be completed, and contain both resultUrl and captureHash. Otherwise the endpoint returns 404 without creating a Code2Des row.

Each valid call creates a new Code2Des job, so one Page Import can produce multiple generations and previous Figma output is not overwritten.

201 response

{
  "code2desId": "019ffa75-01c0-75a2-8123-456789abcdf0",
  "pageImportId": "019ffa75-01c0-75a2-8123-456789abcdef",
  "status": "0",
  "attempt": 1,
  "createdAt": "2026-08-21T00:00:00.000Z"
}

The backend sends the Code2Des worker the completed capture URL/hash directly. If enqueue fails, only this new Code2Des row is marked failed; the reusable Page Import remains completed.