Targets

Adopt a verified existing package as Current

POST
/targets/{target_id}/adopt

Checks the repository tag, package metadata, and registry artifact, then records the package as an Imported Current release. Opens the first Typeship Draft at the next major version; review it to establish the baseline for preserving existing code.

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}$

Header Parameters

Idempotency-Key?string

Identifies one logical write for 24 hours. The key is scoped to the authenticated account and operation; account-less generation uses a hashed network identity. Retrying the same method, path, query, 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

curl -X POST "https://example.com/targets/tgt_5m8q2v7k1p9d4h6c/adopt" \  -H "Content-Type: application/json" \  -d '{    "version": "string",    "tag": "string"  }'
{  "id": "rel_7m2q8v4k1p9d5h6c",  "object": "target_release",  "target_id": "tgt_5m8q2v7k1p9d4h6c",  "generation_id": "gen_7h2p5d9c3m8w1k6q",  "origin": "typeship",  "version": "string",  "channel": "stable",  "provider": "string",  "repository": {    "provider": "github",    "identifier": "acme/payments-api"  },  "definition_revision_id": "drev_6m1q8v4k2p9d7h3c",  "delivery_revision": "string",  "source_digest": "string",  "previous_generation_id": "gen_7h2p5d9c3m8w1k6q",  "next_generation_id": "gen_7h2p5d9c3m8w1k6q",  "generated_output_hash": "string",  "accepted_combined_snapshot_id": "snap_6m1q8v4k2p9d7h3c",  "customer_diff_hash": "string",  "final_package_hash": "string",  "checks": [    {      "name": "string",      "source": "typeship",      "required": true,      "state": "pending",      "reason": "string",      "revision": "string",      "url": "http://example.com",      "observed_at": "2019-08-24T14:15:22Z"    }  ],  "accepted_risks": [    {      "comparison": "current",      "reason": "string",      "approved_by": "string",      "approved_revision": "string",      "approved_at": "2019-08-24T14:15:22Z"    }  ],  "import_provenance": {    "tag": "string",    "registry_url": "http://example.com",    "artifact_digest": "string",    "imported_at": "2019-08-24T14:15:22Z"  },  "publications": [    {      "id": "pub_2m8q4v7k1p9d5h6c",      "object": "publication",      "target_release_id": "rel_7m2q8v4k1p9d5h6c",      "destination": "github",      "state": "pending",      "attempt": 0,      "run_url": "http://example.com",      "registry_url": "http://example.com",      "artifact_digest": "string",      "error": "string",      "started_at": "2019-08-24T14:15:22Z",      "finished_at": "2019-08-24T14:15:22Z",      "updated_at": "2019-08-24T14:15:22Z"    }  ],  "created_at": "2019-08-24T14:15:22Z",  "request_id": "req_3k8m1v6q9p2d7h4c"}