#LinkCodeDOCS
Docs/Create codes

Management API

Controlled rollout

Create a LinkCode.

Create direct, profile and advanced LinkCodes with the proposed management API contract, idempotency rules, routes and response schemas.

01

Create a code

POST/v1/codesControlled rollout

Creation is atomic: either the code and every route are stored, or nothing is. Codes are unique globally after normalization.

PropertyTypeDescription
codestringrequired

3–24 characters: A–Z, 0–9, underscore or hyphen.

titlestringrequired

Internal and public-safe title, maximum 100 characters.

routing.modesimple | advancedrequired

Simple destination or weighted/geo route groups.

routesRoute[]required

One to 20 destinations. Every country group totals exactly 100.

gateGate

Optional branded step before the selected destination.

{
  "code": "LAUNCH26",
  "title": "Summer launch",
  "routing": { "mode": "simple" },
  "routes": [{
    "label": "Product page",
    "kind": "url",
    "url": "https://shop.example.com/summer",
    "weight": 100
  }]
}
02

Idempotency

Send a unique Idempotency-Key for every logical creation. Retrying the same request with the same key must return the original result rather than create another code.

03

Creation response

{
  "id": "6f43b6a8-4ce0-4a89-bd7b-6d277541252c",
  "code": "LAUNCH26",
  "status": "active",
  "routingMode": "advanced",
  "url": "https://linkcode-wheat.vercel.app/c/LAUNCH26",
  "createdAt": "2026-07-28T15:00:00Z"
}