Skip to main content
When a page is shared on Slack, LinkedIn, X or iMessage, the platform shows the picture in its og:image tag. An instant link makes that picture from a template, with the page’s own words in it, from nothing but a URL:
The first request for a set of words renders the picture and keeps it. Every request after that is served from storage.

How it works

  • One template per link. A link draws one of your workspace’s templates, or a built-in. Link preview (og-card) is 1200 × 630, the size platforms ask for.
  • Fields go in the query string. Each field of the template is a parameter named after it: ?title=…&byline=…. A field you leave out keeps the template’s own words. Parameters that aren’t fields are ignored, and listed in the x-mediamonster-ignored header.
  • The extension is the format. .png, .jpg or .webp.
  • size is optional. size=1080x1080 draws it at another size the template is laid out for, or one of 1080x1080, 1080x1350, 1080x1920, 1920x1080 and 1200x630.
  • Only new pictures cost. A new set of words costs 1 credit, the price of one Fill a template. A picture the link has made before is free, however often it’s loaded. Requests for the same new picture at the same moment wait for one drawing, and it’s billed once. It’s billed to the link’s workspace.
  • It’s cached for good. A picture comes back with Cache-Control: public, max-age=31536000, immutable. The URL names the picture exactly, so the same URL always gets the same picture.
  1. Open the template at mediamonster.app/templates.
  2. Press Get a link, then New link.
  3. Leave Signed URLs only picked, set any limits, and press Make link.
  4. Copy the secret. It’s shown once.
Owners, admins and members can make links. Viewers can see them. You can also make one over the API:
The answer carries secret and an example_url that works. GET /api/v1/instant-links lists your links and DELETE /api/v1/instant-links/{id} deletes one. Making a link needs a live key with the run scope.

Sign each URL on your server

Keep the secret in your server’s environment, never in a page or a repository. Sign each URL where the page is rendered, with the SDK:
Then put it in the page’s head:

Signing without the SDK

s is HMAC-SHA256, written as lower-case hex, under the link’s secret, of this text:
  • <path> is the URL’s path: /i/k3v9x2m4q8w1z7ab.png.
  • <query> is every parameter except s, sorted by name, each name and value escaped as JavaScript’s encodeURIComponent does (Python: quote(v, safe="-_.!~*'()")), joined with &.
  • With no parameters, the text still ends in ?.
Add the result as s. The order you write the query in doesn’t matter. Each parameter can appear once. An open link answers any query with no signature, so a static site with no server can use it. Anyone who has the link can make new pictures with any words in them, and each one costs your workspace 1 credit. So an open link is only made when you pick Anyone with the link, and it’s always held to a limit per address (30 an hour when you don’t set one). Set Most pictures in all as well.

Pictures in fields

A picture field takes a link to a JPEG, PNG, WebP or GIF, starting https://. It’s fetched once, when the picture is first drawn. If the link doesn’t load, the picture is still drawn: the field falls back to the template’s own picture, or is left out. The response says which fields in the x-mediamonster-missing header, and is cached for 5 minutes instead of a year, so the real picture is drawn once the link answers again. A picture from the Vault’s own CDN link isn’t fetched this way yet.

When it doesn’t answer with a picture

A refusal is plain text with its code in the x-mediamonster-error header, and it’s never cached. Out of credits is a 402, not a picture that says so. Platforms keep the first picture they get for a page for days, so a picture of an error would stay on your link previews long after you top up. A 402 isn’t kept, and the next time the platform asks it gets the real picture.

Switch off, rotate or delete

Under Get a link:
  • The switch stops a link answering. Turn it back on and its URLs work again.
  • New secret gives a signed link a new secret. Every URL signed with the old one stops working at once, so sign them again.
  • Delete removes the link for good.
Pictures a browser or a platform has already cached are theirs to keep, whichever you do. Making, changing, rotating and deleting a link each shows on the workspace’s activity.