Update OG After Sharing

4 min

Before you start

1) Update the link metadata

# cURL - Update title and image
curl -X PATCH https://api.ogli.sh/link/YOUR_LINK_ID \
  -H "Authorization: Bearer $OGLI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "New Amazing Title",
    "ogImage": "https://cdn.example.com/new-image.jpg?v=2"
  }'
// Node.js
const response = await fetch(`https://api.ogli.sh/link/${linkId}`, {
  method: "PATCH",
  headers: {
    "Authorization": `Bearer ${process.env.OGLI_API_KEY}`,
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    title: "New Amazing Title",
    description: "Updated description that converts better",
    ogImage: "https://cdn.example.com/new-image.jpg?v=2",
    ogImageAlt: "Updated image description"
  })
});

const updatedLink = await response.json();

2) Force cache refresh (important!)

Social platforms cache previews. Use these techniques:

Change the image URL

# Add version parameter to bust cache
Old: https://cdn.example.com/image.jpg
New: https://cdn.example.com/image.jpg?v=2

Use platform debug tools

3) Re-share to see changes

What you can update

Pro tips


← Back to all how-tos