Skip to main content

Update a link

Change a link's title, price, destination, campaign or Timer.

PATCH/v1/integrations/links/:link

Changes only the fields you send. Omitted fields keep their value; no defaults are applied.

Headers

HeaderValue
AuthorizationRequiredBearer <token>
Content-TypeRequiredapplication/json
If-MatchRequiredThe ETag from your last read. See Editing safely.
Idempotency-KeyOptionalLets 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}`);

What changes and what doesn't

  • The link stays the same. Its id and url never 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

ResponseWhyWhat to do
409 LINK_NOT_EDITABLEThe 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_UNSUPPORTEDThe 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_CONFLICTThe link changed since you read it.Read it again and resend.