Update a link
Change a link's title, price, destination, campaign or Timer.
PATCH
/v1/integrations/links/:linkChanges only the fields you send. Omitted fields keep their value; no defaults are applied.
Headers
| Header | Value | |
|---|---|---|
Authorization | Required | Bearer <token> |
Content-Type | Required | application/json |
If-Match | Required | The ETag from your last read. See Editing safely. |
Idempotency-Key | Optional | Lets you retry safely. |
Body
At least one of title, destinationUrl, keysRequired, campaignKey, timedAccessMode or timedAccessSeconds, with the same rules as creation. Send campaignKey: null to remove the campaign, and timedAccessSeconds: null to go back to your account's default wait.
const link = 'https://api.keystorm.xyz/v1/integrations/links/k_61tdb_ruab4MZVYO';const auth = { Authorization: `Bearer ${process.env.KEYSTORM_API_TOKEN}` };// 1. Read the link. Its current version comes back in the ETag header.const current = await fetch(link, { headers: auth });if (!current.ok) throw new Error(`Read failed: ${current.status}`);// 2. Send only the fields you want to change.const response = await fetch(link, { method: 'PATCH', headers: { ...auth, 'Content-Type': 'application/json', 'If-Match': current.headers.get('etag') }, body: JSON.stringify({ keysRequired: 5, campaignKey: null }),});if (!response.ok) throw new Error(`Edit failed: ${response.status}`);import os, requestslink = 'https://api.keystorm.xyz/v1/integrations/links/k_61tdb_ruab4MZVYO'auth = {'Authorization': f"Bearer {os.environ['KEYSTORM_API_TOKEN']}"}# 1. Read the link. Its current version comes back in the ETag header.current = requests.get(link, headers=auth, timeout=15)current.raise_for_status()# 2. Send only the fields you want to change.response = requests.patch( link, json={'keysRequired': 5, 'campaignKey': None}, headers={**auth, 'If-Match': current.headers['ETag']}, timeout=15,)response.raise_for_status()LINK=https://api.keystorm.xyz/v1/integrations/links/k_61tdb_ruab4MZVYO# 1. Read the link and keep its ETagETAG=$(curl -s -D - -o /dev/null $LINK \ -H "Authorization: Bearer $KEYSTORM_API_TOKEN" | grep -i '^etag:' | cut -d' ' -f2 | tr -d '\r')# 2. Send only the fields you want to changecurl -s -X PATCH $LINK \ -H "Authorization: Bearer $KEYSTORM_API_TOKEN" \ -H "Content-Type: application/json" \ -H "If-Match: $ETAG" \ -d '{"keysRequired":5,"campaignKey":null}'What changes and what doesn't
- The link stays the same. Its
idandurlnever change. - Past buyers are not affected. Buyers who already unlocked keep the destination they paid for. New buyers get the new one.
- Timers keep their rules. A Timer a buyer already started finishes with the settings it started with.
- Campaign changes regroup history. Past views and unlocks of the link move to its new campaign in Analytics.
When an edit is refused
| Response | Why | What to do |
|---|---|---|
409 LINK_NOT_EDITABLE | The link is revoked or under review, or its destination can't change while earlier purchases are still being delivered. | Revoked links can't be edited. Otherwise, try again later. |
409 LEGACY_SHARED_CONTENT_UNSUPPORTED | The link shares its content with another link or a widget, so title, price or destination would change for all of them. | Change these in the dashboard. Campaign and Timer can still be edited here. |
412 VERSION_CONFLICT | The link changed since you read it. | Read it again and resend. |