Projects

Generate a Project's Targets

POST
/projects/{project_id}/generate

Queues one Generation per active Target and returns their IDs. Retrieve each Generation until its status moves from queued to running and then completed or failed. completed means generated files are saved; check Delivery and Draft status separately for repository delivery and pull requests. A Target already queued or running is returned without starting another Generation. A 409 targets_inactive means the Project has no active Target to generate. A matching Idempotency-Key replay returns the same Generations with their current statuses.

If the package already matches a destination and no Draft is open, delivery creates no commit, branch, or pull request. An existing Draft stays open. Automatic generation uses the same workflow.

AuthorizationBearer <token>

Organization API key from the console (ak_...), or an OAuth access token with user:org:read, the organization selected during consent, and the capability required by the operation.

In: header

Path Parameters

project_id*string

Unique identifier for a project.

Match^prj_[a-z0-9]{16}$

Header Parameters

Idempotency-Key?string

Identifies one logical write for 24 hours. The key is scoped to the authenticated organization and operation; generation without an organization uses a hashed network identity. Retrying the same method, path, query, If-Match header, and JSON body replays the original response. Reusing the key with changed intent returns 409. After expiry the key starts a new write.

Match^[!-~]+$
Length1 <= length <= 255

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/projects/prj_4f8k2m7x9q1v6b3n/generate" \  -H "Content-Type: application/json" \  -d '{    "target_id": "tgt_5m8q2v7k1p9d4h6c"  }'
{  "data": [    {      "id": "gen_7h2p5d9c3m8w1k6q",      "object": "generation",      "project_id": "prj_4f8k2m7x9q1v6b3n",      "spec_revision_id": null,      "status": "queued",      "trigger": "manual",      "target_id": "tgt_5m8q2v7k1p9d4h6c",      "type": "cli",      "name": null,      "version": null,      "warnings": [],      "coverage": null,      "file_count": 0,      "errors": [],      "runtime_ms": null,      "created_at": "2026-09-23T08:00:00Z",      "updated_at": "2026-09-23T08:00:00Z"    }  ],  "request_id": "req_3k8m1v6q9p2d7h4c"}