Create Page Import
POST /api/v1/organizations/{organization_id}/projects/{project_id}/page-imports
Creates one reusable public-URL capture. This endpoint creates only a page_import row and sends only a page_import worker message; it does not create or dispatch Code2Des.
Requires project Write access.
{
"url": "https://example.com/",
"viewport": { "width": 1440, "height": 900, "deviceScaleFactor": 1 },
"readySelector": "main"
}
viewport defaults to 1440ร900 at scale 1. Width and height must each be 240โ7680 CSS pixels, and deviceScaleFactor must be 0.5โ4. readySelector is optional and limited to 512 characters. URLs must use HTTP(S), contain no credentials, use port 80 or 443, and resolve only to public IP addresses. The URL fragment is removed before persistence.
201 response
{
"pageImportId": "019ffa75-01c0-75a2-8123-456789abcdef",
"organizationId": 1,
"projectId": 7,
"sourceKind": "public_url",
"sourceUrl": "https://example.com/",
"viewport": { "width": 1440, "height": 900, "deviceScaleFactor": 1 },
"readySelector": "main",
"status": "0",
"attempt": 1,
"resultUrl": null,
"captureHash": null,
"screenshotUrl": null,
"error": null,
"createdAt": "2026-08-21T00:00:00.000Z",
"updatedAt": "2026-08-21T00:00:00.000Z"
}
Status is "0" processing, "1" completed, or "2" failed. If queue dispatch fails, the Page Import row is marked failed and the request returns an error.
After completion, the same pageImportId may be supplied to multiple Code2Des triggers.