Targets

Review and recover rewritten repository history

POST
/targets/{target_id}/draft/history/recover

Preview a rewritten default branch and the Draft code to preserve. Approve the exact inspected revisions with dry_run false, then Generate separately. Recovery preserves the previous Draft branch, opens a new Draft from the current default branch, and requires explicit decisions for overlapping code. A rewritten Draft alone recovers automatically during Generate.

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

target_id*string

Stable identifier for one configured generated product.

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

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

curl -X POST "https://example.com/targets/tgt_5m8q2v7k1p9d4h6c/draft/history/recover" \  -H "Content-Type: application/json" \  -d '{    "dry_run": true  }'
{  "object": "draft_history_recovery",  "target_id": "tgt_0000000000000001",  "status": "preview",  "default_revision": "0123456789abcdef0123456789abcdef01234567",  "draft_revision": null,  "preserved_branch": null,  "changes": [],  "draft_changes": [],  "total_changes": 0,  "total_draft_changes": 0,  "has_more": false,  "next_path": null,  "request_id": "req_0000000000000001"}