Nimply Developers
Examples

Add a link to your page when a video goes live

Put every new YouTube upload at the top of your nimply.link page automatically — with the API, Zapier, or n8n.

Scopes: links:read, links:write (plus webhooks:manage if you use the post.published webhook instead of a YouTube trigger).

The pattern: something publishes a video → add a featured link block at the top of your link page → publish the page. Optionally retire the previous "latest video" link so the page never grows.

With the API (Node)

Triggered by your own code, or by the Nimply post.published webhook when the video was scheduled through Nimply:

const API = "https://api.nimply.io";
const headers = {
  Authorization: `Bearer ${process.env.NIMPLY_API_KEY}`,
  "Content-Type": "application/json",
};

// 1. Find the page (most workspaces have one).
const { data: pages } = await (await fetch(`${API}/v1/link-pages`, { headers })).json();
const page = pages.find((p) => p.status !== "SUSPENDED");

// 2. Retire the previous "latest video" link (tagged by our own convention: icon "youtube").
const full = await (await fetch(`${API}/v1/link-pages/${page.id}`, { headers })).json();
for (const b of full.blocks) {
  if (b.type === "LINK" && b.config.icon === "youtube" && b.isActive) {
    await fetch(`${API}/v1/link-pages/${page.id}/blocks/${b.id}`, {
      method: "PATCH",
      headers,
      body: JSON.stringify({ isActive: false }),
    });
  }
}

// 3. Add the new one at the top.
await fetch(`${API}/v1/link-pages/${page.id}/blocks`, {
  method: "POST",
  headers,
  body: JSON.stringify({
    type: "LINK",
    position: 1, // 0 is usually the social icons row; adjust to taste
    config: {
      title: "New video: " + video.title,
      url: video.url,
      icon: "youtube",
      style: "featured",
      thumbnailUrl: video.thumbnailUrl,
    },
  }),
});

// 4. Publish — live at nimply.link/<handle> within about a minute.
await fetch(`${API}/v1/link-pages/${page.id}/publish`, { method: "POST", headers });

video comes from wherever your trigger fires: the post.published webhook payload (postUrl), the YouTube Data API, or an RSS feed of the channel.

With Zapier

  1. Trigger: YouTube → New Video in Channel (or Nimply → Post Published filtered to your YouTube channel).
  2. Action: Nimply → Add Link Block. Pick the page, set Block type to Link, Title to New video: {{Title}}, URL to the video URL, Style to featured, Position to 1, and turn Publish after adding on.

That is the whole Zap. To retire the previous link automatically, add a Nimply → Find Link Page search first and a Code step that PATCHes the old block as in the API example — or simply keep a fixed "Latest video" block and update it: Add Link Block with Replace block ID set to that block id replaces its title and URL instead of adding a new block.

With n8n

  • YouTube Trigger (or Nimply Trigger → post.published) → Nimply → Link Page → Add Block (type: LINK, config from the trigger, Publish after adding: true).

To keep one rolling "latest video" block, use Link Page → Update Block with the stored block id instead of Add Block.

Notes

  • Position 0 inserts at the very top, above whatever is there; most pages keep the social-icons row first, so 1 is a good default.
  • Every URL is Safe-Browsing checked at publish. A flagged URL blocks the publish with the block id in the error body.
  • Publishing is idempotent: re-running the Zap after a partial failure just publishes the current draft again.

On this page