CINXE.COM

Short Links (API) - Pxl Help

<!DOCTYPE html><html class="antialiased [font-feature-settings:&#x27;ss01&#x27;]" lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><title>Short Links (API) - Pxl Help</title><meta name="description" content="Create and manage short links with the Pxl API. Automate link generation, customize previews, and track clicks to enhance your digital marketing efforts."/><meta name="next-head-count" content="4"/><meta property="og:image" content="https://help.pxl.to/tiny.png"/><meta name="twitter:image" content="https://help.pxl.to/tiny.png"/><script> let mediaQuery = window.matchMedia('(prefers-color-scheme: light)') function updateTheme(savedTheme) { let theme = 'system' try { if (!savedTheme) { savedTheme = window.localStorage.theme } if (savedTheme === 'dark') { theme = 'dark' document.documentElement.classList.add('dark') } else if (savedTheme === 'light') { theme = 'light' document.documentElement.classList.remove('dark') } else if (mediaQuery.matches) { document.documentElement.classList.add('dark') } else { document.documentElement.classList.remove('dark') } } catch { theme = 'light' document.documentElement.classList.remove('dark') } return theme } function updateThemeWithoutTransitions(savedTheme) { updateTheme(savedTheme) document.documentElement.classList.add('[&_*]:!transition-none') window.setTimeout(() => { document.documentElement.classList.remove('[&_*]:!transition-none') }, 0) } document.documentElement.setAttribute('data-theme', updateTheme()) new MutationObserver(([{ oldValue }]) => { let newValue = document.documentElement.getAttribute('data-theme') if (newValue !== oldValue) { try { window.localStorage.setItem('theme', newValue) } catch {} updateThemeWithoutTransitions(newValue) } }).observe(document.documentElement, { attributeFilter: ['data-theme'], attributeOldValue: true }) mediaQuery.addEventListener('change', updateThemeWithoutTransitions) window.addEventListener('storage', updateThemeWithoutTransitions) </script><script defer="" data-domain="help.pxl.to" data-api="/pa/api/event" src="/pa/js/script.js"></script><script> window.plausible = window.plausible || function() { (window.plausible.q = window.plausible.q || []).push(arguments) } </script><link rel="preload" href="/_next/static/css/cc0c89da4477359a.css" as="style"/><link rel="stylesheet" href="/_next/static/css/cc0c89da4477359a.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-0d1b80a048d4787e.js"></script><script src="/_next/static/chunks/webpack-5752944655d749a0.js" defer=""></script><script src="/_next/static/chunks/framework-4556c45dd113b893.js" defer=""></script><script src="/_next/static/chunks/main-c7a0ff793fffb508.js" defer=""></script><script src="/_next/static/chunks/pages/_app-f6d2f5d118e3834c.js" defer=""></script><script src="/_next/static/chunks/605040ef-b1de146bca0cbdd3.js" defer=""></script><script src="/_next/static/chunks/951-1eccf3723e92029a.js" defer=""></script><script src="/_next/static/chunks/909-64cbdfde64ae71ab.js" defer=""></script><script src="/_next/static/chunks/pages/docs/api-shorts-80200767bb608836.js" defer=""></script><script src="/_next/static/PkQ8gH5vl9Ff98ShyLQes/_buildManifest.js" defer=""></script><script src="/_next/static/PkQ8gH5vl9Ff98ShyLQes/_ssgManifest.js" defer=""></script></head><body class="bg-white dark:bg-slate-900"><div id="__next"><header class="sticky top-0 z-50 flex flex-wrap items-center justify-between bg-white px-4 py-5 transition duration-500 sm:px-6 lg:px-8 dark:bg-transparent"><div class="mr-6 flex lg:hidden"><button type="button" class="relative" aria-label="Open navigation"><svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" class="h-6 w-6 stroke-slate-500"><path d="M4 7h16M4 12h16M4 17h16"></path></svg></button><div style="position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0;display:none"></div></div><div class="relative flex flex-grow basis-0 items-center"><a aria-label="Home page" class="mt-1" href="/"><div class="hidden [[data-theme=light]_&amp;]:block"><span style="box-sizing:border-box;display:inline-block;overflow:hidden;width:initial;height:initial;background:none;opacity:1;border:0;margin:0;padding:0;position:relative;max-width:100%"><span style="box-sizing:border-box;display:block;width:initial;height:initial;background:none;opacity:1;border:0;margin:0;padding:0;max-width:100%"><img style="display:block;max-width:100%;width:initial;height:initial;background:none;opacity:1;border:0;margin:0;padding:0" alt="" aria-hidden="true" src="data:image/svg+xml,%3csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20version=%271.1%27%20width=%27100%27%20height=%2738%27/%3e"/></span><img alt="pxl.to" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" decoding="async" data-nimg="intrinsic" style="position:absolute;top:0;left:0;bottom:0;right:0;box-sizing:border-box;padding:0;border:none;margin:auto;display:block;width:0;height:0;min-width:100%;max-width:100%;min-height:100%;max-height:100%"/><noscript><img alt="pxl.to" srcSet="/_next/static/media/tiny.58a8ac3c.svg 1x, /_next/static/media/tiny.58a8ac3c.svg 2x" src="/_next/static/media/tiny.58a8ac3c.svg" decoding="async" data-nimg="intrinsic" style="position:absolute;top:0;left:0;bottom:0;right:0;box-sizing:border-box;padding:0;border:none;margin:auto;display:block;width:0;height:0;min-width:100%;max-width:100%;min-height:100%;max-height:100%" loading="lazy"/></noscript></span></div><div class="hidden [[data-theme=dark]_&amp;]:block"><span style="box-sizing:border-box;display:inline-block;overflow:hidden;width:initial;height:initial;background:none;opacity:1;border:0;margin:0;padding:0;position:relative;max-width:100%"><span style="box-sizing:border-box;display:block;width:initial;height:initial;background:none;opacity:1;border:0;margin:0;padding:0;max-width:100%"><img style="display:block;max-width:100%;width:initial;height:initial;background:none;opacity:1;border:0;margin:0;padding:0" alt="" aria-hidden="true" src="data:image/svg+xml,%3csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20version=%271.1%27%20width=%27100%27%20height=%2738%27/%3e"/></span><img alt="pxl.to" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" decoding="async" data-nimg="intrinsic" style="position:absolute;top:0;left:0;bottom:0;right:0;box-sizing:border-box;padding:0;border:none;margin:auto;display:block;width:0;height:0;min-width:100%;max-width:100%;min-height:100%;max-height:100%"/><noscript><img alt="pxl.to" srcSet="/_next/static/media/tinywhite.93d07320.svg 1x, /_next/static/media/tinywhite.93d07320.svg 2x" src="/_next/static/media/tinywhite.93d07320.svg" decoding="async" data-nimg="intrinsic" style="position:absolute;top:0;left:0;bottom:0;right:0;box-sizing:border-box;padding:0;border:none;margin:auto;display:block;width:0;height:0;min-width:100%;max-width:100%;min-height:100%;max-height:100%" loading="lazy"/></noscript></span></div><div class="hidden [:not(.dark)[data-theme=system]_&amp;]:block"><span style="box-sizing:border-box;display:inline-block;overflow:hidden;width:initial;height:initial;background:none;opacity:1;border:0;margin:0;padding:0;position:relative;max-width:100%"><span style="box-sizing:border-box;display:block;width:initial;height:initial;background:none;opacity:1;border:0;margin:0;padding:0;max-width:100%"><img style="display:block;max-width:100%;width:initial;height:initial;background:none;opacity:1;border:0;margin:0;padding:0" alt="" aria-hidden="true" src="data:image/svg+xml,%3csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20version=%271.1%27%20width=%27100%27%20height=%2738%27/%3e"/></span><img alt="pxl.to" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" decoding="async" data-nimg="intrinsic" style="position:absolute;top:0;left:0;bottom:0;right:0;box-sizing:border-box;padding:0;border:none;margin:auto;display:block;width:0;height:0;min-width:100%;max-width:100%;min-height:100%;max-height:100%"/><noscript><img alt="pxl.to" srcSet="/_next/static/media/tiny.58a8ac3c.svg 1x, /_next/static/media/tiny.58a8ac3c.svg 2x" src="/_next/static/media/tiny.58a8ac3c.svg" decoding="async" data-nimg="intrinsic" style="position:absolute;top:0;left:0;bottom:0;right:0;box-sizing:border-box;padding:0;border:none;margin:auto;display:block;width:0;height:0;min-width:100%;max-width:100%;min-height:100%;max-height:100%" loading="lazy"/></noscript></span></div><div class="hidden [.dark[data-theme=system]_&amp;]:block"><span style="box-sizing:border-box;display:inline-block;overflow:hidden;width:initial;height:initial;background:none;opacity:1;border:0;margin:0;padding:0;position:relative;max-width:100%"><span style="box-sizing:border-box;display:block;width:initial;height:initial;background:none;opacity:1;border:0;margin:0;padding:0;max-width:100%"><img style="display:block;max-width:100%;width:initial;height:initial;background:none;opacity:1;border:0;margin:0;padding:0" alt="" aria-hidden="true" src="data:image/svg+xml,%3csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20version=%271.1%27%20width=%27100%27%20height=%2738%27/%3e"/></span><img alt="pxl.to" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" decoding="async" data-nimg="intrinsic" style="position:absolute;top:0;left:0;bottom:0;right:0;box-sizing:border-box;padding:0;border:none;margin:auto;display:block;width:0;height:0;min-width:100%;max-width:100%;min-height:100%;max-height:100%"/><noscript><img alt="pxl.to" srcSet="/_next/static/media/tinywhite.93d07320.svg 1x, /_next/static/media/tinywhite.93d07320.svg 2x" src="/_next/static/media/tinywhite.93d07320.svg" decoding="async" data-nimg="intrinsic" style="position:absolute;top:0;left:0;bottom:0;right:0;box-sizing:border-box;padding:0;border:none;margin:auto;display:block;width:0;height:0;min-width:100%;max-width:100%;min-height:100%;max-height:100%" loading="lazy"/></noscript></span></div></a></div><div class="-my-5 mr-6 sm:mr-8 md:mr-0"><button type="button" class="group flex h-6 w-6 items-center justify-center sm:justify-start md:h-auto md:w-80 md:flex-none md:rounded-lg md:py-2.5 md:pl-4 md:pr-3.5 md:text-sm md:ring-1 md:ring-slate-200 md:hover:ring-slate-300 dark:md:bg-slate-800/75 dark:md:ring-inset dark:md:ring-white/5 dark:md:hover:bg-slate-700/40 dark:md:hover:ring-slate-500 lg:w-96"><svg aria-hidden="true" viewBox="0 0 20 20" class="h-5 w-5 flex-none fill-slate-400 group-hover:fill-slate-500 dark:fill-slate-500 md:group-hover:fill-slate-400"><path d="M16.293 17.707a1 1 0 0 0 1.414-1.414l-1.414 1.414ZM9 14a5 5 0 0 1-5-5H2a7 7 0 0 0 7 7v-2ZM4 9a5 5 0 0 1 5-5V2a7 7 0 0 0-7 7h2Zm5-5a5 5 0 0 1 5 5h2a7 7 0 0 0-7-7v2Zm8.707 12.293-3.757-3.757-1.414 1.414 3.757 3.757 1.414-1.414ZM14 9a4.98 4.98 0 0 1-1.464 3.536l1.414 1.414A6.98 6.98 0 0 0 16 9h-2Zm-1.464 3.536A4.98 4.98 0 0 1 9 14v2a6.98 6.98 0 0 0 4.95-2.05l-1.414-1.414Z"></path></svg><span class="sr-only md:not-sr-only md:ml-2 md:text-slate-500 md:dark:text-slate-400">Search docs</span></button></div><div class="relative flex basis-0 justify-end gap-6 sm:gap-8 md:flex-grow"><div class="relative z-10"><label class="sr-only" id="headlessui-listbox-label-:Rd36:">Theme</label><button class="flex h-6 w-6 items-center justify-center rounded-lg shadow-md shadow-black/5 ring-1 ring-black/5 dark:bg-slate-700 dark:ring-inset dark:ring-white/5" id="headlessui-listbox-button-:Rl36:" type="button" aria-haspopup="true" aria-expanded="false"><svg aria-hidden="true" viewBox="0 0 16 16" class="hidden h-4 w-4 fill-sky-400 [[data-theme=light]_&amp;]:block"><path fill-rule="evenodd" clip-rule="evenodd" d="M7 1a1 1 0 0 1 2 0v1a1 1 0 1 1-2 0V1Zm4 7a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm2.657-5.657a1 1 0 0 0-1.414 0l-.707.707a1 1 0 0 0 1.414 1.414l.707-.707a1 1 0 0 0 0-1.414Zm-1.415 11.313-.707-.707a1 1 0 0 1 1.415-1.415l.707.708a1 1 0 0 1-1.415 1.414ZM16 7.999a1 1 0 0 0-1-1h-1a1 1 0 1 0 0 2h1a1 1 0 0 0 1-1ZM7 14a1 1 0 1 1 2 0v1a1 1 0 1 1-2 0v-1Zm-2.536-2.464a1 1 0 0 0-1.414 0l-.707.707a1 1 0 0 0 1.414 1.414l.707-.707a1 1 0 0 0 0-1.414Zm0-8.486A1 1 0 0 1 3.05 4.464l-.707-.707a1 1 0 0 1 1.414-1.414l.707.707ZM3 8a1 1 0 0 0-1-1H1a1 1 0 0 0 0 2h1a1 1 0 0 0 1-1Z"></path></svg><svg aria-hidden="true" viewBox="0 0 16 16" class="hidden h-4 w-4 fill-sky-400 [[data-theme=dark]_&amp;]:block"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.23 3.333C7.757 2.905 7.68 2 7 2a6 6 0 1 0 0 12c.68 0 .758-.905.23-1.332A5.989 5.989 0 0 1 5 8c0-1.885.87-3.568 2.23-4.668ZM12 5a1 1 0 0 1 1 1 1 1 0 0 0 1 1 1 1 0 1 1 0 2 1 1 0 0 0-1 1 1 1 0 1 1-2 0 1 1 0 0 0-1-1 1 1 0 1 1 0-2 1 1 0 0 0 1-1 1 1 0 0 1 1-1Z"></path></svg><svg aria-hidden="true" viewBox="0 0 16 16" class="hidden h-4 w-4 fill-slate-400 [:not(.dark)[data-theme=system]_&amp;]:block"><path fill-rule="evenodd" clip-rule="evenodd" d="M7 1a1 1 0 0 1 2 0v1a1 1 0 1 1-2 0V1Zm4 7a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm2.657-5.657a1 1 0 0 0-1.414 0l-.707.707a1 1 0 0 0 1.414 1.414l.707-.707a1 1 0 0 0 0-1.414Zm-1.415 11.313-.707-.707a1 1 0 0 1 1.415-1.415l.707.708a1 1 0 0 1-1.415 1.414ZM16 7.999a1 1 0 0 0-1-1h-1a1 1 0 1 0 0 2h1a1 1 0 0 0 1-1ZM7 14a1 1 0 1 1 2 0v1a1 1 0 1 1-2 0v-1Zm-2.536-2.464a1 1 0 0 0-1.414 0l-.707.707a1 1 0 0 0 1.414 1.414l.707-.707a1 1 0 0 0 0-1.414Zm0-8.486A1 1 0 0 1 3.05 4.464l-.707-.707a1 1 0 0 1 1.414-1.414l.707.707ZM3 8a1 1 0 0 0-1-1H1a1 1 0 0 0 0 2h1a1 1 0 0 0 1-1Z"></path></svg><svg aria-hidden="true" viewBox="0 0 16 16" class="hidden h-4 w-4 fill-slate-400 [.dark[data-theme=system]_&amp;]:block"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.23 3.333C7.757 2.905 7.68 2 7 2a6 6 0 1 0 0 12c.68 0 .758-.905.23-1.332A5.989 5.989 0 0 1 5 8c0-1.885.87-3.568 2.23-4.668ZM12 5a1 1 0 0 1 1 1 1 1 0 0 0 1 1 1 1 0 1 1 0 2 1 1 0 0 0-1 1 1 1 0 1 1-2 0 1 1 0 0 0-1-1 1 1 0 1 1 0-2 1 1 0 0 0 1-1 1 1 0 0 1 1-1Z"></path></svg></button></div></div></header><div class="relative mx-auto flex max-w-8xl justify-center sm:px-2 lg:px-8 xl:px-12" id="article"><div class="hidden lg:relative lg:block lg:flex-none"><div class="absolute inset-y-0 right-0 w-[50vw] bg-slate-50 dark:hidden"></div><div class="sticky top-[4.5rem] -ml-0.5 h-[calc(100vh-4.5rem)] overflow-y-auto py-16 pl-0.5"><div class="absolute top-16 bottom-0 right-0 hidden h-12 w-px bg-gradient-to-t from-slate-800 dark:block"></div><div class="absolute top-28 bottom-0 right-0 hidden w-px bg-slate-800 dark:block"></div><nav class="text-base lg:text-sm w-64 pr-8 xl:w-72 xl:pr-16"><ul role="list" class="space-y-9"><li><h2 class="font-display font-medium text-slate-900 dark:text-white">Introduction</h2><ul role="list" class="mt-2 space-y-2 border-l-2 border-slate-100 dark:border-slate-800 lg:mt-4 lg:space-y-4 lg:border-slate-200"><li class="relative"><a class="block w-full pl-3.5 before:pointer-events-none before:absolute before:-left-1 before:top-1/2 before:h-1.5 before:w-1.5 before:-translate-y-1/2 before:rounded-full text-slate-500 before:hidden before:bg-slate-300 hover:text-slate-600 hover:before:block dark:text-slate-400 dark:before:bg-slate-700 dark:hover:text-slate-300" href="/">Getting Started</a></li><li class="relative"><a class="block w-full pl-3.5 before:pointer-events-none before:absolute before:-left-1 before:top-1/2 before:h-1.5 before:w-1.5 before:-translate-y-1/2 before:rounded-full text-slate-500 before:hidden before:bg-slate-300 hover:text-slate-600 hover:before:block dark:text-slate-400 dark:before:bg-slate-700 dark:hover:text-slate-300" href="/docs/faq">Frequently Asked Questions</a></li><li class="relative"><a class="block w-full pl-3.5 before:pointer-events-none before:absolute before:-left-1 before:top-1/2 before:h-1.5 before:w-1.5 before:-translate-y-1/2 before:rounded-full text-slate-500 before:hidden before:bg-slate-300 hover:text-slate-600 hover:before:block dark:text-slate-400 dark:before:bg-slate-700 dark:hover:text-slate-300" href="/docs/troubleshooting">Troubleshooting</a></li></ul></li><li><h2 class="font-display font-medium text-slate-900 dark:text-white">Core Features</h2><ul role="list" class="mt-2 space-y-2 border-l-2 border-slate-100 dark:border-slate-800 lg:mt-4 lg:space-y-4 lg:border-slate-200"><li class="relative"><a class="block w-full pl-3.5 before:pointer-events-none before:absolute before:-left-1 before:top-1/2 before:h-1.5 before:w-1.5 before:-translate-y-1/2 before:rounded-full text-slate-500 before:hidden before:bg-slate-300 hover:text-slate-600 hover:before:block dark:text-slate-400 dark:before:bg-slate-700 dark:hover:text-slate-300" href="/docs/links">Short Links</a></li><li class="relative"><a class="block w-full pl-3.5 before:pointer-events-none before:absolute before:-left-1 before:top-1/2 before:h-1.5 before:w-1.5 before:-translate-y-1/2 before:rounded-full text-slate-500 before:hidden before:bg-slate-300 hover:text-slate-600 hover:before:block dark:text-slate-400 dark:before:bg-slate-700 dark:hover:text-slate-300" href="/docs/dynamic-qr-codes">Dynamic QR Codes</a></li><li class="relative"><a class="block w-full pl-3.5 before:pointer-events-none before:absolute before:-left-1 before:top-1/2 before:h-1.5 before:w-1.5 before:-translate-y-1/2 before:rounded-full text-slate-500 before:hidden before:bg-slate-300 hover:text-slate-600 hover:before:block dark:text-slate-400 dark:before:bg-slate-700 dark:hover:text-slate-300" href="/docs/microsites">Microsites</a></li></ul></li><li><h2 class="font-display font-medium text-slate-900 dark:text-white">Additional Features</h2><ul role="list" class="mt-2 space-y-2 border-l-2 border-slate-100 dark:border-slate-800 lg:mt-4 lg:space-y-4 lg:border-slate-200"><li class="relative"><a class="block w-full pl-3.5 before:pointer-events-none before:absolute before:-left-1 before:top-1/2 before:h-1.5 before:w-1.5 before:-translate-y-1/2 before:rounded-full text-slate-500 before:hidden before:bg-slate-300 hover:text-slate-600 hover:before:block dark:text-slate-400 dark:before:bg-slate-700 dark:hover:text-slate-300" href="/docs/analytics">Analytics</a></li><li class="relative"><a class="block w-full pl-3.5 before:pointer-events-none before:absolute before:-left-1 before:top-1/2 before:h-1.5 before:w-1.5 before:-translate-y-1/2 before:rounded-full text-slate-500 before:hidden before:bg-slate-300 hover:text-slate-600 hover:before:block dark:text-slate-400 dark:before:bg-slate-700 dark:hover:text-slate-300" href="/docs/custom-domains">Custom Domains</a></li><li class="relative"><a class="block w-full pl-3.5 before:pointer-events-none before:absolute before:-left-1 before:top-1/2 before:h-1.5 before:w-1.5 before:-translate-y-1/2 before:rounded-full text-slate-500 before:hidden before:bg-slate-300 hover:text-slate-600 hover:before:block dark:text-slate-400 dark:before:bg-slate-700 dark:hover:text-slate-300" href="/docs/integrations">Integrations</a></li><li class="relative"><a class="block w-full pl-3.5 before:pointer-events-none before:absolute before:-left-1 before:top-1/2 before:h-1.5 before:w-1.5 before:-translate-y-1/2 before:rounded-full text-slate-500 before:hidden before:bg-slate-300 hover:text-slate-600 hover:before:block dark:text-slate-400 dark:before:bg-slate-700 dark:hover:text-slate-300" href="/docs/retargeting">Retargeting &amp; Tracking</a></li><li class="relative"><a class="block w-full pl-3.5 before:pointer-events-none before:absolute before:-left-1 before:top-1/2 before:h-1.5 before:w-1.5 before:-translate-y-1/2 before:rounded-full text-slate-500 before:hidden before:bg-slate-300 hover:text-slate-600 hover:before:block dark:text-slate-400 dark:before:bg-slate-700 dark:hover:text-slate-300" href="/docs/smart-links">Smart Links</a></li><li class="relative"><a class="block w-full pl-3.5 before:pointer-events-none before:absolute before:-left-1 before:top-1/2 before:h-1.5 before:w-1.5 before:-translate-y-1/2 before:rounded-full text-slate-500 before:hidden before:bg-slate-300 hover:text-slate-600 hover:before:block dark:text-slate-400 dark:before:bg-slate-700 dark:hover:text-slate-300" href="/docs/spam-protection">Spam Protection</a></li><li class="relative"><a class="block w-full pl-3.5 before:pointer-events-none before:absolute before:-left-1 before:top-1/2 before:h-1.5 before:w-1.5 before:-translate-y-1/2 before:rounded-full text-slate-500 before:hidden before:bg-slate-300 hover:text-slate-600 hover:before:block dark:text-slate-400 dark:before:bg-slate-700 dark:hover:text-slate-300" href="/docs/team-members">Team Members</a></li><li class="relative"><a class="block w-full pl-3.5 before:pointer-events-none before:absolute before:-left-1 before:top-1/2 before:h-1.5 before:w-1.5 before:-translate-y-1/2 before:rounded-full text-slate-500 before:hidden before:bg-slate-300 hover:text-slate-600 hover:before:block dark:text-slate-400 dark:before:bg-slate-700 dark:hover:text-slate-300" href="/docs/workspaces">Workspaces</a></li></ul></li><li><h2 class="font-display font-medium text-slate-900 dark:text-white">API Reference</h2><ul role="list" class="mt-2 space-y-2 border-l-2 border-slate-100 dark:border-slate-800 lg:mt-4 lg:space-y-4 lg:border-slate-200"><li class="relative"><a class="block w-full pl-3.5 before:pointer-events-none before:absolute before:-left-1 before:top-1/2 before:h-1.5 before:w-1.5 before:-translate-y-1/2 before:rounded-full text-slate-500 before:hidden before:bg-slate-300 hover:text-slate-600 hover:before:block dark:text-slate-400 dark:before:bg-slate-700 dark:hover:text-slate-300" href="/docs/api-requests">Getting Started</a></li><li class="relative"><a class="block w-full pl-3.5 before:pointer-events-none before:absolute before:-left-1 before:top-1/2 before:h-1.5 before:w-1.5 before:-translate-y-1/2 before:rounded-full font-semibold text-sky-500 before:bg-sky-500" href="/docs/api-shorts">Short Links</a></li><li class="relative"><a class="block w-full pl-3.5 before:pointer-events-none before:absolute before:-left-1 before:top-1/2 before:h-1.5 before:w-1.5 before:-translate-y-1/2 before:rounded-full text-slate-500 before:hidden before:bg-slate-300 hover:text-slate-600 hover:before:block dark:text-slate-400 dark:before:bg-slate-700 dark:hover:text-slate-300" href="/docs/api-insight">Analytics</a></li></ul></li><li><h2 class="font-display font-medium text-slate-900 dark:text-white">Earning Money with Pxl</h2><ul role="list" class="mt-2 space-y-2 border-l-2 border-slate-100 dark:border-slate-800 lg:mt-4 lg:space-y-4 lg:border-slate-200"><li class="relative"><a class="block w-full pl-3.5 before:pointer-events-none before:absolute before:-left-1 before:top-1/2 before:h-1.5 before:w-1.5 before:-translate-y-1/2 before:rounded-full text-slate-500 before:hidden before:bg-slate-300 hover:text-slate-600 hover:before:block dark:text-slate-400 dark:before:bg-slate-700 dark:hover:text-slate-300" href="/docs/pxl-partner-program">Pxl Partner Program</a></li></ul></li><li><h2 class="font-display font-medium text-slate-900 dark:text-white">Moving to Pxl</h2><ul role="list" class="mt-2 space-y-2 border-l-2 border-slate-100 dark:border-slate-800 lg:mt-4 lg:space-y-4 lg:border-slate-200"><li class="relative"><a class="block w-full pl-3.5 before:pointer-events-none before:absolute before:-left-1 before:top-1/2 before:h-1.5 before:w-1.5 before:-translate-y-1/2 before:rounded-full text-slate-500 before:hidden before:bg-slate-300 hover:text-slate-600 hover:before:block dark:text-slate-400 dark:before:bg-slate-700 dark:hover:text-slate-300" href="/docs/import-bitly-links-to-pxl">Import Bitly Links to Pxl</a></li></ul></li><li><h2 class="font-display font-medium text-slate-900 dark:text-white">Data &amp; Privacy</h2><ul role="list" class="mt-2 space-y-2 border-l-2 border-slate-100 dark:border-slate-800 lg:mt-4 lg:space-y-4 lg:border-slate-200"><li class="relative"><a class="block w-full pl-3.5 before:pointer-events-none before:absolute before:-left-1 before:top-1/2 before:h-1.5 before:w-1.5 before:-translate-y-1/2 before:rounded-full text-slate-500 before:hidden before:bg-slate-300 hover:text-slate-600 hover:before:block dark:text-slate-400 dark:before:bg-slate-700 dark:hover:text-slate-300" href="/docs/retargeting-consent">Consent for Retargeting</a></li><li class="relative"><a class="block w-full pl-3.5 before:pointer-events-none before:absolute before:-left-1 before:top-1/2 before:h-1.5 before:w-1.5 before:-translate-y-1/2 before:rounded-full text-slate-500 before:hidden before:bg-slate-300 hover:text-slate-600 hover:before:block dark:text-slate-400 dark:before:bg-slate-700 dark:hover:text-slate-300" href="/docs/gdpr-compliance">GDPR Compliance</a></li></ul></li></ul></nav></div></div><div class="min-w-0 max-w-2xl flex-auto px-4 py-16 lg:max-w-none lg:pr-0 lg:pl-8 xl:px-16"><article><header class="mb-9 space-y-1"><p class="font-display text-sm font-medium text-sky-500">API Reference</p><h1 class="font-display text-3xl tracking-tight text-slate-900 dark:text-white">Short Links (API)</h1></header><div class="prose prose-slate max-w-none dark:prose-invert dark:text-slate-400 prose-headings:scroll-mt-28 prose-headings:font-display prose-headings:font-normal lg:prose-headings:scroll-mt-[8.5rem] prose-lead:text-slate-500 dark:prose-lead:text-slate-400 prose-a:font-semibold dark:prose-a:text-sky-400 prose-a:no-underline prose-a:shadow-[inset_0_-2px_0_0_var(--tw-prose-background,#fff),inset_0_calc(-1*(var(--tw-prose-underline-size,4px)+2px))_0_0_var(--tw-prose-underline,theme(colors.sky.300))] hover:prose-a:[--tw-prose-underline-size:6px] dark:[--tw-prose-background:theme(colors.slate.900)] dark:prose-a:shadow-[inset_0_calc(-1*var(--tw-prose-underline-size,2px))_0_0_var(--tw-prose-underline,theme(colors.sky.800))] dark:hover:prose-a:[--tw-prose-underline-size:6px] prose-pre:rounded-xl prose-pre:bg-slate-900 prose-pre:shadow-lg dark:prose-pre:bg-slate-800/60 dark:prose-pre:shadow-none dark:prose-pre:ring-1 dark:prose-pre:ring-slate-300/10 dark:prose-hr:border-slate-800"><p>Create and manage short links with the Pxl API. Automate link generation, customize previews and track clicks to enhance your digital marketing efforts.</p><p>Related guide: <a href="/docs/links">Creating short links</a>.</p><div class="my-4 flex flex-col rounded-xl px-2 py-0 pb-5 bg-sky-50 dark:bg-slate-800/60 dark:ring-1 dark:ring-slate-300/10"><div class="prose"><div class="flex items-center"><svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 flex-none" fill="none" viewBox="0 0 24 24" stroke="#7dd3fc"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path></svg><div class="ml-3"><div class="text-sky-800 [--tw-prose-background:theme(colors.sky.50)] prose-a:text-sky-900 prose-code:text-sky-900 dark:text-slate-300 dark:prose-code:text-slate-300"><p>This feature is available on <em>all plans</em>.</p></div></div></div></div><div class="not-prose pl-9"><a href="https://www.pxl.to/?ref=help-cta" target="_blank" class="rounded-full bg-blue-500 p-2 px-5 text-center text-sm text-white hover:bg-blue-400 hover:text-white focus:outline-none active:bg-blue-600 w-full md:w-auto">Get started for free</a></div></div><hr/><h2 id="the-short-object">The <strong>short</strong> object</h2><p>Each short link has a variety of</p><h4>id: <em>string</em></h4><p>Example: <strong>pxl.to/mylink</strong></p><p>Unique identifier for each short link. The id is a text composite of the domain and route. Prepending <code>https://</code> to the id will form a URL denoting the location of the short link.</p><h4>route: <em>string</em></h4><p>Example: <strong>mylink</strong></p><p>The route of the short link.</p><h4>consent: <em>boolean</em></h4><p>Example: <strong>true</strong></p><p>Specifies whether to request informed consent from visitors before storing cookies.</p><h4>destination: <em>string</em></h4><p>Example: <strong>https://www.bbc.co.uk</strong></p><p>Destination URL the short link will redirect to.</p><h4>title: <em>string</em></h4><p>Example: <strong>My Title</strong></p><p>Title text shown in link previews.</p><h4>description: <em>string</em></h4><p>Example: <strong>My link description</strong></p><p>Description text shown in link previews.</p><h4>image: <em>string</em></h4><p>Example: <strong>https://www.example.com/image.png</strong></p><p>URL location of the image shown in link previews.</p><h4>favicon: <em>string</em></h4><p>Example: <strong>https://www.example.com/favicon.png</strong></p><p>URL location of the favicon shown in browser for redirects.</p><h4>clicks: <em>number</em></h4><p>Example: <strong>100</strong></p><p>Integer representation of the click count.</p><h4>createdAt: <em>date</em></h4><p>Example: <strong>2024-12-27 08:26:49.219717</strong></p><p>Date representation of when the link was created in UTC+0.</p><h4>updatedAt: <em>date</em></h4><p>Example: <strong>2024-12-28 08:26:49.219717</strong></p><p>Date representation of when the link was last updated in UTC+0. This attribute considers updates to the click count, and can therefore be used to infer the date and time of the most recent click.</p><h2 id="create-a-short-link">Create a short link</h2><p>To create a short link, you will make a POST request specifying the defining attributes.</p><pre class="prism-code language-bash"><code><span class="token plain">POST https://api.pxl.to/api/v1/short</span> </code></pre><h3 id="parameters">Parameters</h3><h4>destination: <em>string</em> — required</h4><p>Example: <strong>https://www.bbc.co.uk</strong></p><p>Destination URL of the new short link.</p><h4>domain: <em>string</em></h4><p>Example: <strong>mydomain.com</strong></p><p>The domain or subdomain of the new short link. Custom domains must be added in the dashboard before they can be used. Related guide: <a href="/docs/custom-domains">Creating custom domains</a>.</p><h4>route: <em>string</em></h4><p>Example: <strong>mylink</strong></p><p>The route of the new short link.</p><h4>consent: <em>boolean</em></h4><p>Example: <strong>false</strong></p><p>Specifies whether to request informed consent from visitors before storing cookies. Requires company information on the <a href="https://app.pxl.to/settings#admin">admin page</a>.</p><h4>title: <em>string</em></h4><p>Example: <strong>My Title</strong></p><p>Title text shown in link previews.</p><h4>description: <em>string</em></h4><p>Example: <strong>My link description</strong></p><p>Description text shown in link previews.</p><h4>image: <em>string</em></h4><p>Example: <strong>https://www.example.com/image.png</strong></p><p>URL location of the image shown in link previews.</p><h4>favicon: <em>string</em></h4><p>Example: <strong>https://www.example.com/favicon.png</strong></p><p>URL location of the favicon shown in browser for redirects.</p><h3 id="returns">Returns</h3><p>Returns the short object.</p><h3 id="request">Request</h3><p>An example CURL request:</p><pre class="prism-code language-bash"><code><span class="token function">curl</span><span class="token plain"> -X POST --compressed </span><span class="token string">&quot;https://api.pxl.to/api/v1/short&quot;</span><span class="token plain"> </span><span class="token punctuation">\</span><span class="token plain"></span> <span class="token plain">-H </span><span class="token string">&quot;Accept-Encoding: gzip&quot;</span><span class="token plain"> </span><span class="token punctuation">\</span><span class="token plain"></span> <span class="token plain">-H </span><span class="token string">&quot;Content-Type: application/json&quot;</span><span class="token plain"> </span><span class="token punctuation">\</span><span class="token plain"></span> <span class="token plain">-H </span><span class="token string">&quot;Authorization: Bearer &lt;YOUR_ACCESS_TOKEN&gt;&quot;</span><span class="token plain"> </span><span class="token punctuation">\</span><span class="token plain"></span> <span class="token plain">-d </span><span class="token string">&#x27;{</span> <span class="token string"> &quot;destination&quot;: &quot;example.com&quot;,</span> <span class="token string"> &quot;title&quot;: &quot;Redirect&quot;,</span> <span class="token string"> &quot;description&quot;: &quot;Descriptive text&quot;,</span> <span class="token string"> &quot;image&quot;: &quot;https://example.com/image.png&quot;,</span> <span class="token string"> &quot;favicon&quot;: &quot;https://example.com/favicon.ico&quot;</span> <span class="token string">}&#x27;</span> </code></pre><h3 id="response">Response</h3><p>An example JSON response:</p><pre class="prism-code language-json"><code><span class="token punctuation">{</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;data&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;id&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;pxl.to/x8djds&quot;</span><span class="token punctuation">,</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;route&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;x8djds&quot;</span><span class="token punctuation">,</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;destination&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;https://example.com&quot;</span><span class="token punctuation">,</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;title&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;Redirect&quot;</span><span class="token punctuation">,</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;description&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;Descriptive text&quot;</span><span class="token punctuation">,</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;image&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;https://example.com/image.png&quot;</span><span class="token punctuation">,</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;favicon&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;https://example.com/favicon.ico&quot;</span><span class="token punctuation">,</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;consent&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token boolean">false</span><span class="token punctuation">,</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;clicks&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token number">0</span><span class="token punctuation">,</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;createdAt&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;2022-07-27T15:17:03.525Z&quot;</span><span class="token punctuation">,</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;updatedAt&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;2022-07-27T15:17:03.525Z&quot;</span><span class="token plain"></span> <span class="token plain"> </span><span class="token punctuation">}</span><span class="token plain"></span> <span class="token plain"></span><span class="token punctuation">}</span> </code></pre><h2 id="read-a-short-link">Read a short link</h2><p>To return a specific short link object, you will make a GET request specifying the URL encoded short id.</p><pre class="prism-code language-bash"><code><span class="token plain">GET https://api.pxl.to/api/v1/short/:id</span> </code></pre><h3 id="parameters-2">Parameters</h3><p>No parameters.</p><h3 id="returns-2">Returns</h3><p>Returns the short object.</p><h3 id="request-2">Request</h3><p>An example CURL request:</p><pre class="prism-code language-bash"><code><span class="token function">curl</span><span class="token plain"> -X GET --compressed </span><span class="token string">&quot;https://api.pxl.to/api/v1/short/pxl.to%2Fx8djds&quot;</span><span class="token plain"> </span><span class="token punctuation">\</span><span class="token plain"></span> <span class="token plain">-H </span><span class="token string">&quot;Accept-Encoding: gzip&quot;</span><span class="token plain"> </span><span class="token punctuation">\</span><span class="token plain"></span> <span class="token plain">-H </span><span class="token string">&quot;Authorization: Bearer &lt;YOUR_ACCESS_TOKEN&gt;&quot;</span> </code></pre><h3 id="response-2">Response</h3><p>An example JSON response:</p><pre class="prism-code language-json"><code><span class="token punctuation">{</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;data&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;id&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;pxl.to/x8djds&quot;</span><span class="token punctuation">,</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;route&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;x8djds&quot;</span><span class="token punctuation">,</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;destination&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;https://example.com&quot;</span><span class="token punctuation">,</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;title&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;Redirect&quot;</span><span class="token punctuation">,</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;description&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;Descriptive text&quot;</span><span class="token punctuation">,</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;image&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;https://example.com/image.png&quot;</span><span class="token punctuation">,</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;favicon&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;https://example.com/favicon.ico&quot;</span><span class="token punctuation">,</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;consent&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token boolean">false</span><span class="token punctuation">,</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;clicks&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token number">0</span><span class="token punctuation">,</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;createdAt&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;2022-07-27T15:17:03.525Z&quot;</span><span class="token punctuation">,</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;updatedAt&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;2022-07-27T15:17:03.525Z&quot;</span><span class="token plain"></span> <span class="token plain"> </span><span class="token punctuation">}</span><span class="token plain"></span> <span class="token plain"></span><span class="token punctuation">}</span> </code></pre><h2 id="update-a-short-link">Update a short link</h2><p>To update attributes for a specific short, you will make a PUT request specifying the attributes to update and the URL encoded short id.</p><pre class="prism-code language-bash"><code><span class="token plain">PUT https://api.pxl.to/api/v1/short/:id</span> </code></pre><h3 id="parameters-3">Parameters</h3><h4>destination: <em>string</em></h4><p>Example: <strong>https://www.bbc.co.uk</strong></p><p>Destination URL of the new short link.</p><h4>consent: <em>boolean</em></h4><p>Example: <strong>false</strong></p><p>Specifies whether to request informed consent from visitors before storing cookies. Requires company information on the <a href="https://app.pxl.to/settings#admin">admin page</a>.</p><h4>title: <em>string</em></h4><p>Example: <strong>My Title</strong></p><p>Title text shown in link previews.</p><h4>description: <em>string</em></h4><p>Example: <strong>My link description</strong></p><p>Description text shown in link previews.</p><h4>image: <em>string</em></h4><p>Example: <strong>https://www.example.com/image.png</strong></p><p>URL location of the image shown in link previews.</p><h4>favicon: <em>string</em></h4><p>Example: <strong>https://www.example.com/favicon.png</strong></p><p>URL location of the favicon shown in browser for redirects.</p><h3 id="returns-3">Returns</h3><p>Returns the short object.</p><h3 id="request-3">Request</h3><p>An example CURL request:</p><pre class="prism-code language-bash"><code><span class="token function">curl</span><span class="token plain"> -X PUT --compressed </span><span class="token string">&quot;https://api.pxl.to/api/v1/short/pxl.to%2Fx8djds&quot;</span><span class="token plain"> </span><span class="token punctuation">\</span><span class="token plain"></span> <span class="token plain">-H </span><span class="token string">&quot;Accept-Encoding: gzip&quot;</span><span class="token plain"> </span><span class="token punctuation">\</span><span class="token plain"></span> <span class="token plain">-H </span><span class="token string">&quot;Content-Type: application/json&quot;</span><span class="token plain"> </span><span class="token punctuation">\</span><span class="token plain"></span> <span class="token plain">-H </span><span class="token string">&quot;Authorization: Bearer &lt;YOUR_ACCESS_TOKEN&gt;&quot;</span><span class="token plain"> </span><span class="token punctuation">\</span><span class="token plain"></span> <span class="token plain">-d </span><span class="token string">&#x27;{</span> <span class="token string"> &quot;destination&quot;: &quot;https://google.com&quot;</span> <span class="token string">}&#x27;</span> </code></pre><h3 id="response-3">Response</h3><p>An example JSON response:</p><pre class="prism-code language-json"><code><span class="token punctuation">{</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;data&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;id&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;pxl.to/x8djds&quot;</span><span class="token punctuation">,</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;route&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;x8djds&quot;</span><span class="token punctuation">,</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;destination&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;https://google.com&quot;</span><span class="token punctuation">,</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;title&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;Redirect&quot;</span><span class="token punctuation">,</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;description&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;Descriptive text&quot;</span><span class="token punctuation">,</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;image&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;https://example.com/image.png&quot;</span><span class="token punctuation">,</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;favicon&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;https://example.com/favicon.ico&quot;</span><span class="token punctuation">,</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;consent&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token boolean">false</span><span class="token punctuation">,</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;clicks&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token number">0</span><span class="token punctuation">,</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;createdAt&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;2022-07-27T15:17:03.525Z&quot;</span><span class="token punctuation">,</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;updatedAt&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;2022-07-27T15:17:03.525Z&quot;</span><span class="token plain"></span> <span class="token plain"> </span><span class="token punctuation">}</span><span class="token plain"></span> <span class="token plain"></span><span class="token punctuation">}</span> </code></pre><h2 id="delete-a-short-link">Delete a short link</h2><p>To delete a specific short link, you will make a DELETE request specifying the URL encoded short id.</p><pre class="prism-code language-bash"><code><span class="token plain">DELETE https://api.pxl.to/api/v1/short/:id</span> </code></pre><h3 id="parameters-4">Parameters</h3><p>No parameters.</p><h3 id="returns-4">Returns</h3><p>Returns the number of records affected.</p><h3 id="request-4">Request</h3><p>An example CURL request:</p><pre class="prism-code language-bash"><code><span class="token function">curl</span><span class="token plain"> -X DELETE --compressed </span><span class="token string">&quot;https://api.pxl.to/api/v1/short/pxl.to%2Fx8djds&quot;</span><span class="token plain"> </span><span class="token punctuation">\</span><span class="token plain"></span> <span class="token plain">-H </span><span class="token string">&quot;Accept-Encoding: gzip&quot;</span><span class="token plain"> </span><span class="token punctuation">\</span><span class="token plain"></span> <span class="token plain">-H </span><span class="token string">&quot;Authorization: Bearer &lt;YOUR_ACCESS_TOKEN&gt;&quot;</span> </code></pre><h3 id="response-4">Response</h3><p>An example JSON response:</p><pre class="prism-code language-json"><code><span class="token punctuation">{</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;data&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;raw&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">,</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;affected&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token number">1</span><span class="token plain"></span> <span class="token plain"> </span><span class="token punctuation">}</span><span class="token plain"></span> <span class="token plain"></span><span class="token punctuation">}</span> </code></pre><h2 id="list-short-links">List short links</h2><p>To return all short links associated with your organisation, you will make a GET request.</p><pre class="prism-code language-bash"><code><span class="token plain">GET https://api.pxl.to/api/v1/short</span> </code></pre><h3 id="parameters-5">Parameters</h3><h4>take: <em>number</em></h4><p>Example: <strong>10</strong></p><p>The number of records to return, with a minimum value of 1 and a maximum value of 50. Defaults to 50.</p><h4>skip: <em>number</em></h4><p>Example: <strong>0</strong></p><p>The number of records to skip, with a minimum value of 0 and a maximum value of 50. Defaults to 0.</p><h3 id="returns-5">Returns</h3><p>Returns a list of every short object associated with your organisation.</p><h3 id="request-5">Request</h3><p>An example CURL request:</p><pre class="prism-code language-bash"><code><span class="token function">curl</span><span class="token plain"> -X GET --compressed </span><span class="token string">&quot;https://api.pxl.to/api/v1/short?take=2&amp;skip=10&quot;</span><span class="token plain"> </span><span class="token punctuation">\</span><span class="token plain"></span> <span class="token plain">-H </span><span class="token string">&quot;Accept-Encoding: gzip&quot;</span><span class="token plain"> </span><span class="token punctuation">\</span><span class="token plain"></span> <span class="token plain">-H </span><span class="token string">&quot;Authorization: Bearer &lt;YOUR_ACCESS_TOKEN&gt;&quot;</span><span class="token plain"> </span><span class="token punctuation">\</span> </code></pre><h3 id="response-5">Response</h3><p>An example JSON response:</p><pre class="prism-code language-json"><code><span class="token punctuation">{</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;data&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation">[</span><span class="token plain"></span> <span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;id&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;pxl.to/x8djds&quot;</span><span class="token punctuation">,</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;route&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;x8djds&quot;</span><span class="token punctuation">,</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;destination&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;https://example.com&quot;</span><span class="token punctuation">,</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;title&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;Redirect&quot;</span><span class="token punctuation">,</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;description&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;Descriptive text&quot;</span><span class="token punctuation">,</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;image&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;https://example.com/image.png&quot;</span><span class="token punctuation">,</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;favicon&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;https://example.com/favicon.ico&quot;</span><span class="token punctuation">,</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;consent&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token boolean">false</span><span class="token punctuation">,</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;clicks&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token number">0</span><span class="token punctuation">,</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;createdAt&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;2022-07-27T15:17:03.525Z&quot;</span><span class="token punctuation">,</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;updatedAt&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;2022-07-27T15:17:03.525Z&quot;</span><span class="token plain"></span> <span class="token plain"> </span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token plain"></span> <span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;id&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;pxl.to/bing/preview&quot;</span><span class="token punctuation">,</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;route&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;bing/preview&quot;</span><span class="token punctuation">,</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;destination&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;https://bing.com/search?q=preview&quot;</span><span class="token punctuation">,</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;title&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;Redirect&quot;</span><span class="token punctuation">,</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;description&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;Descriptive text&quot;</span><span class="token punctuation">,</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;image&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;https://bing.com/image.png&quot;</span><span class="token punctuation">,</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;favicon&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;https://bing.com/favicon.ico&quot;</span><span class="token punctuation">,</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;consent&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token boolean">true</span><span class="token punctuation">,</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;clicks&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token number">32</span><span class="token punctuation">,</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;createdAt&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;2022-02-21T12:11:03.545Z&quot;</span><span class="token punctuation">,</span><span class="token plain"></span> <span class="token plain"> </span><span class="token property">&quot;updatedAt&quot;</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;2022-02-21T12:11:03.545Z&quot;</span><span class="token plain"></span> <span class="token plain"> </span><span class="token punctuation">}</span><span class="token plain"></span> <span class="token plain"> </span><span class="token punctuation">]</span><span class="token plain"></span> <span class="token plain"></span><span class="token punctuation">}</span> </code></pre></div></article><dl class="mt-12 flex border-t border-slate-200 pt-6 dark:border-slate-800"><div><dt class="font-display text-sm font-medium text-slate-900 dark:text-white">Previous</dt><dd class="mt-1"><a class="text-base font-semibold text-slate-500 hover:text-slate-600 dark:text-slate-400 dark:hover:text-slate-300" href="/docs/api-requests"><span aria-hidden="true">←</span> <!-- -->Getting Started</a></dd></div><div class="ml-auto text-right"><dt class="font-display text-sm font-medium text-slate-900 dark:text-white">Next</dt><dd class="mt-1"><a class="text-base font-semibold text-slate-500 hover:text-slate-600 dark:text-slate-400 dark:hover:text-slate-300" href="/docs/api-insight">Analytics<!-- --> <span aria-hidden="true">→</span></a></dd></div></dl></div><div class="hidden xl:sticky xl:top-[4.5rem] xl:-mr-6 xl:block xl:h-[calc(100vh-4.5rem)] xl:flex-none xl:overflow-y-auto xl:py-16 xl:pr-6"><nav aria-labelledby="on-this-page-title" class="w-56"><h2 id="on-this-page-title" class="font-display text-sm font-medium text-slate-900 dark:text-white">On this page</h2><ol role="list" class="mt-4 space-y-3 text-sm"><li><h3><a class="text-sky-500" href="/docs/api-shorts#the-short-object">The short object</a></h3></li><li><h3><a class="font-normal text-slate-500 hover:text-slate-700 dark:text-slate-400 dark:hover:text-slate-300" href="/docs/api-shorts#create-a-short-link">Create a short link</a></h3><ol role="list" class="mt-2 space-y-3 pl-5 text-slate-500 dark:text-slate-400"><li><a class="hover:text-slate-600 dark:hover:text-slate-300" href="/docs/api-shorts#parameters">Parameters</a></li><li><a class="hover:text-slate-600 dark:hover:text-slate-300" href="/docs/api-shorts#returns">Returns</a></li><li><a class="hover:text-slate-600 dark:hover:text-slate-300" href="/docs/api-shorts#request">Request</a></li><li><a class="hover:text-slate-600 dark:hover:text-slate-300" href="/docs/api-shorts#response">Response</a></li></ol></li><li><h3><a class="font-normal text-slate-500 hover:text-slate-700 dark:text-slate-400 dark:hover:text-slate-300" href="/docs/api-shorts#read-a-short-link">Read a short link</a></h3><ol role="list" class="mt-2 space-y-3 pl-5 text-slate-500 dark:text-slate-400"><li><a class="hover:text-slate-600 dark:hover:text-slate-300" href="/docs/api-shorts#parameters-2">Parameters</a></li><li><a class="hover:text-slate-600 dark:hover:text-slate-300" href="/docs/api-shorts#returns-2">Returns</a></li><li><a class="hover:text-slate-600 dark:hover:text-slate-300" href="/docs/api-shorts#request-2">Request</a></li><li><a class="hover:text-slate-600 dark:hover:text-slate-300" href="/docs/api-shorts#response-2">Response</a></li></ol></li><li><h3><a class="font-normal text-slate-500 hover:text-slate-700 dark:text-slate-400 dark:hover:text-slate-300" href="/docs/api-shorts#update-a-short-link">Update a short link</a></h3><ol role="list" class="mt-2 space-y-3 pl-5 text-slate-500 dark:text-slate-400"><li><a class="hover:text-slate-600 dark:hover:text-slate-300" href="/docs/api-shorts#parameters-3">Parameters</a></li><li><a class="hover:text-slate-600 dark:hover:text-slate-300" href="/docs/api-shorts#returns-3">Returns</a></li><li><a class="hover:text-slate-600 dark:hover:text-slate-300" href="/docs/api-shorts#request-3">Request</a></li><li><a class="hover:text-slate-600 dark:hover:text-slate-300" href="/docs/api-shorts#response-3">Response</a></li></ol></li><li><h3><a class="font-normal text-slate-500 hover:text-slate-700 dark:text-slate-400 dark:hover:text-slate-300" href="/docs/api-shorts#delete-a-short-link">Delete a short link</a></h3><ol role="list" class="mt-2 space-y-3 pl-5 text-slate-500 dark:text-slate-400"><li><a class="hover:text-slate-600 dark:hover:text-slate-300" href="/docs/api-shorts#parameters-4">Parameters</a></li><li><a class="hover:text-slate-600 dark:hover:text-slate-300" href="/docs/api-shorts#returns-4">Returns</a></li><li><a class="hover:text-slate-600 dark:hover:text-slate-300" href="/docs/api-shorts#request-4">Request</a></li><li><a class="hover:text-slate-600 dark:hover:text-slate-300" href="/docs/api-shorts#response-4">Response</a></li></ol></li><li><h3><a class="font-normal text-slate-500 hover:text-slate-700 dark:text-slate-400 dark:hover:text-slate-300" href="/docs/api-shorts#list-short-links">List short links</a></h3><ol role="list" class="mt-2 space-y-3 pl-5 text-slate-500 dark:text-slate-400"><li><a class="hover:text-slate-600 dark:hover:text-slate-300" href="/docs/api-shorts#parameters-5">Parameters</a></li><li><a class="hover:text-slate-600 dark:hover:text-slate-300" href="/docs/api-shorts#returns-5">Returns</a></li><li><a class="hover:text-slate-600 dark:hover:text-slate-300" href="/docs/api-shorts#request-5">Request</a></li><li><a class="hover:text-slate-600 dark:hover:text-slate-300" href="/docs/api-shorts#response-5">Response</a></li></ol></li></ol></nav></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"markdoc":{"content":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Create and manage short links with the Pxl API. Automate link generation, customize previews and track clicks to enhance your digital marketing efforts."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Related guide: ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"/docs/links"},"children":["Creating short links"]},"."]},{"$$mdtype":"Tag","name":"Availability","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This feature is available on ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["all plans"]},"."]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"h2","attributes":{"id":"the-short-object"},"children":["The ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["short"]}," object"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Each short link has a variety of"]},{"$$mdtype":"Tag","name":"h4","attributes":{},"children":["id: ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Example: ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["pxl.to/mylink"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Unique identifier for each short link. The id is a text composite of the domain and route. Prepending ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://"]}," to the id will form a URL denoting the location of the short link."]},{"$$mdtype":"Tag","name":"h4","attributes":{},"children":["route: ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Example: ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["mylink"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The route of the short link."]},{"$$mdtype":"Tag","name":"h4","attributes":{},"children":["consent: ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["boolean"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Example: ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["true"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Specifies whether to request informed consent from visitors before storing cookies."]},{"$$mdtype":"Tag","name":"h4","attributes":{},"children":["destination: ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Example: ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["https://www.bbc.co.uk"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Destination URL the short link will redirect to."]},{"$$mdtype":"Tag","name":"h4","attributes":{},"children":["title: ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Example: ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["My Title"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Title text shown in link previews."]},{"$$mdtype":"Tag","name":"h4","attributes":{},"children":["description: ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Example: ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["My link description"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Description text shown in link previews."]},{"$$mdtype":"Tag","name":"h4","attributes":{},"children":["image: ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Example: ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["https://www.example.com/image.png"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["URL location of the image shown in link previews."]},{"$$mdtype":"Tag","name":"h4","attributes":{},"children":["favicon: ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Example: ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["https://www.example.com/favicon.png"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["URL location of the favicon shown in browser for redirects."]},{"$$mdtype":"Tag","name":"h4","attributes":{},"children":["clicks: ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["number"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Example: ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["100"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Integer representation of the click count."]},{"$$mdtype":"Tag","name":"h4","attributes":{},"children":["createdAt: ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["date"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Example: ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["2024-12-27 08:26:49.219717"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Date representation of when the link was created in UTC+0."]},{"$$mdtype":"Tag","name":"h4","attributes":{},"children":["updatedAt: ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["date"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Example: ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["2024-12-28 08:26:49.219717"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Date representation of when the link was last updated in UTC+0. This attribute considers updates to the click count, and can therefore be used to infer the date and time of the most recent click."]},{"$$mdtype":"Tag","name":"h2","attributes":{"id":"create-a-short-link"},"children":["Create a short link"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To create a short link, you will make a POST request specifying the defining attributes."]},{"$$mdtype":"Tag","name":"Fence","attributes":{"language":"bash"},"children":["POST https://api.pxl.to/api/v1/short\n"]},{"$$mdtype":"Tag","name":"h3","attributes":{"id":"parameters"},"children":["Parameters"]},{"$$mdtype":"Tag","name":"h4","attributes":{},"children":["destination: ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["string"]}," — required"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Example: ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["https://www.bbc.co.uk"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Destination URL of the new short link."]},{"$$mdtype":"Tag","name":"h4","attributes":{},"children":["domain: ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Example: ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["mydomain.com"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The domain or subdomain of the new short link. Custom domains must be added in the dashboard before they can be used. Related guide: ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"/docs/custom-domains"},"children":["Creating custom domains"]},"."]},{"$$mdtype":"Tag","name":"h4","attributes":{},"children":["route: ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Example: ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["mylink"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The route of the new short link."]},{"$$mdtype":"Tag","name":"h4","attributes":{},"children":["consent: ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["boolean"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Example: ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["false"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Specifies whether to request informed consent from visitors before storing cookies. Requires company information on the ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://app.pxl.to/settings#admin"},"children":["admin page"]},"."]},{"$$mdtype":"Tag","name":"h4","attributes":{},"children":["title: ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Example: ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["My Title"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Title text shown in link previews."]},{"$$mdtype":"Tag","name":"h4","attributes":{},"children":["description: ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Example: ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["My link description"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Description text shown in link previews."]},{"$$mdtype":"Tag","name":"h4","attributes":{},"children":["image: ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Example: ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["https://www.example.com/image.png"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["URL location of the image shown in link previews."]},{"$$mdtype":"Tag","name":"h4","attributes":{},"children":["favicon: ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Example: ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["https://www.example.com/favicon.png"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["URL location of the favicon shown in browser for redirects."]},{"$$mdtype":"Tag","name":"h3","attributes":{"id":"returns"},"children":["Returns"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Returns the short object."]},{"$$mdtype":"Tag","name":"h3","attributes":{"id":"request"},"children":["Request"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["An example CURL request:"]},{"$$mdtype":"Tag","name":"Fence","attributes":{"language":"bash"},"children":["curl -X POST --compressed \"https://api.pxl.to/api/v1/short\" \\\n-H \"Accept-Encoding: gzip\" \\\n-H \"Content-Type: application/json\" \\\n-H \"Authorization: Bearer \u003cYOUR_ACCESS_TOKEN\u003e\" \\\n-d '{\n \"destination\": \"example.com\",\n \"title\": \"Redirect\",\n \"description\": \"Descriptive text\",\n \"image\": \"https://example.com/image.png\",\n \"favicon\": \"https://example.com/favicon.ico\"\n}'\n"]},{"$$mdtype":"Tag","name":"h3","attributes":{"id":"response"},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["An example JSON response:"]},{"$$mdtype":"Tag","name":"Fence","attributes":{"language":"json"},"children":["{\n \"data\": {\n \"id\": \"pxl.to/x8djds\",\n \"route\": \"x8djds\",\n \"destination\": \"https://example.com\",\n \"title\": \"Redirect\",\n \"description\": \"Descriptive text\",\n \"image\": \"https://example.com/image.png\",\n \"favicon\": \"https://example.com/favicon.ico\",\n \"consent\": false,\n \"clicks\": 0,\n \"createdAt\": \"2022-07-27T15:17:03.525Z\",\n \"updatedAt\": \"2022-07-27T15:17:03.525Z\"\n }\n}\n"]},{"$$mdtype":"Tag","name":"h2","attributes":{"id":"read-a-short-link"},"children":["Read a short link"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To return a specific short link object, you will make a GET request specifying the URL encoded short id."]},{"$$mdtype":"Tag","name":"Fence","attributes":{"language":"bash"},"children":["GET https://api.pxl.to/api/v1/short/:id\n"]},{"$$mdtype":"Tag","name":"h3","attributes":{"id":"parameters-2"},"children":["Parameters"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["No parameters."]},{"$$mdtype":"Tag","name":"h3","attributes":{"id":"returns-2"},"children":["Returns"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Returns the short object."]},{"$$mdtype":"Tag","name":"h3","attributes":{"id":"request-2"},"children":["Request"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["An example CURL request:"]},{"$$mdtype":"Tag","name":"Fence","attributes":{"language":"bash"},"children":["curl -X GET --compressed \"https://api.pxl.to/api/v1/short/pxl.to%2Fx8djds\" \\\n-H \"Accept-Encoding: gzip\" \\\n-H \"Authorization: Bearer \u003cYOUR_ACCESS_TOKEN\u003e\"\n"]},{"$$mdtype":"Tag","name":"h3","attributes":{"id":"response-2"},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["An example JSON response:"]},{"$$mdtype":"Tag","name":"Fence","attributes":{"language":"json"},"children":["{\n \"data\": {\n \"id\": \"pxl.to/x8djds\",\n \"route\": \"x8djds\",\n \"destination\": \"https://example.com\",\n \"title\": \"Redirect\",\n \"description\": \"Descriptive text\",\n \"image\": \"https://example.com/image.png\",\n \"favicon\": \"https://example.com/favicon.ico\",\n \"consent\": false,\n \"clicks\": 0,\n \"createdAt\": \"2022-07-27T15:17:03.525Z\",\n \"updatedAt\": \"2022-07-27T15:17:03.525Z\"\n }\n}\n"]},{"$$mdtype":"Tag","name":"h2","attributes":{"id":"update-a-short-link"},"children":["Update a short link"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To update attributes for a specific short, you will make a PUT request specifying the attributes to update and the URL encoded short id."]},{"$$mdtype":"Tag","name":"Fence","attributes":{"language":"bash"},"children":["PUT https://api.pxl.to/api/v1/short/:id\n"]},{"$$mdtype":"Tag","name":"h3","attributes":{"id":"parameters-3"},"children":["Parameters"]},{"$$mdtype":"Tag","name":"h4","attributes":{},"children":["destination: ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Example: ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["https://www.bbc.co.uk"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Destination URL of the new short link."]},{"$$mdtype":"Tag","name":"h4","attributes":{},"children":["consent: ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["boolean"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Example: ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["false"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Specifies whether to request informed consent from visitors before storing cookies. Requires company information on the ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://app.pxl.to/settings#admin"},"children":["admin page"]},"."]},{"$$mdtype":"Tag","name":"h4","attributes":{},"children":["title: ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Example: ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["My Title"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Title text shown in link previews."]},{"$$mdtype":"Tag","name":"h4","attributes":{},"children":["description: ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Example: ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["My link description"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Description text shown in link previews."]},{"$$mdtype":"Tag","name":"h4","attributes":{},"children":["image: ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Example: ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["https://www.example.com/image.png"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["URL location of the image shown in link previews."]},{"$$mdtype":"Tag","name":"h4","attributes":{},"children":["favicon: ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Example: ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["https://www.example.com/favicon.png"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["URL location of the favicon shown in browser for redirects."]},{"$$mdtype":"Tag","name":"h3","attributes":{"id":"returns-3"},"children":["Returns"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Returns the short object."]},{"$$mdtype":"Tag","name":"h3","attributes":{"id":"request-3"},"children":["Request"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["An example CURL request:"]},{"$$mdtype":"Tag","name":"Fence","attributes":{"language":"bash"},"children":["curl -X PUT --compressed \"https://api.pxl.to/api/v1/short/pxl.to%2Fx8djds\" \\\n-H \"Accept-Encoding: gzip\" \\\n-H \"Content-Type: application/json\" \\\n-H \"Authorization: Bearer \u003cYOUR_ACCESS_TOKEN\u003e\" \\\n-d '{\n \"destination\": \"https://google.com\"\n}'\n"]},{"$$mdtype":"Tag","name":"h3","attributes":{"id":"response-3"},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["An example JSON response:"]},{"$$mdtype":"Tag","name":"Fence","attributes":{"language":"json"},"children":["{\n \"data\": {\n \"id\": \"pxl.to/x8djds\",\n \"route\": \"x8djds\",\n \"destination\": \"https://google.com\",\n \"title\": \"Redirect\",\n \"description\": \"Descriptive text\",\n \"image\": \"https://example.com/image.png\",\n \"favicon\": \"https://example.com/favicon.ico\",\n \"consent\": false,\n \"clicks\": 0,\n \"createdAt\": \"2022-07-27T15:17:03.525Z\",\n \"updatedAt\": \"2022-07-27T15:17:03.525Z\"\n }\n}\n"]},{"$$mdtype":"Tag","name":"h2","attributes":{"id":"delete-a-short-link"},"children":["Delete a short link"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To delete a specific short link, you will make a DELETE request specifying the URL encoded short id."]},{"$$mdtype":"Tag","name":"Fence","attributes":{"language":"bash"},"children":["DELETE https://api.pxl.to/api/v1/short/:id\n"]},{"$$mdtype":"Tag","name":"h3","attributes":{"id":"parameters-4"},"children":["Parameters"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["No parameters."]},{"$$mdtype":"Tag","name":"h3","attributes":{"id":"returns-4"},"children":["Returns"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Returns the number of records affected."]},{"$$mdtype":"Tag","name":"h3","attributes":{"id":"request-4"},"children":["Request"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["An example CURL request:"]},{"$$mdtype":"Tag","name":"Fence","attributes":{"language":"bash"},"children":["curl -X DELETE --compressed \"https://api.pxl.to/api/v1/short/pxl.to%2Fx8djds\" \\\n-H \"Accept-Encoding: gzip\" \\\n-H \"Authorization: Bearer \u003cYOUR_ACCESS_TOKEN\u003e\"\n"]},{"$$mdtype":"Tag","name":"h3","attributes":{"id":"response-4"},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["An example JSON response:"]},{"$$mdtype":"Tag","name":"Fence","attributes":{"language":"json"},"children":["{\n \"data\": {\n \"raw\": [],\n \"affected\": 1\n }\n}\n"]},{"$$mdtype":"Tag","name":"h2","attributes":{"id":"list-short-links"},"children":["List short links"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To return all short links associated with your organisation, you will make a GET request."]},{"$$mdtype":"Tag","name":"Fence","attributes":{"language":"bash"},"children":["GET https://api.pxl.to/api/v1/short\n"]},{"$$mdtype":"Tag","name":"h3","attributes":{"id":"parameters-5"},"children":["Parameters"]},{"$$mdtype":"Tag","name":"h4","attributes":{},"children":["take: ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["number"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Example: ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["10"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The number of records to return, with a minimum value of 1 and a maximum value of 50. Defaults to 50."]},{"$$mdtype":"Tag","name":"h4","attributes":{},"children":["skip: ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["number"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Example: ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["0"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The number of records to skip, with a minimum value of 0 and a maximum value of 50. Defaults to 0."]},{"$$mdtype":"Tag","name":"h3","attributes":{"id":"returns-5"},"children":["Returns"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Returns a list of every short object associated with your organisation."]},{"$$mdtype":"Tag","name":"h3","attributes":{"id":"request-5"},"children":["Request"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["An example CURL request:"]},{"$$mdtype":"Tag","name":"Fence","attributes":{"language":"bash"},"children":["curl -X GET --compressed \"https://api.pxl.to/api/v1/short?take=2\u0026skip=10\" \\\n-H \"Accept-Encoding: gzip\" \\\n-H \"Authorization: Bearer \u003cYOUR_ACCESS_TOKEN\u003e\" \\\n"]},{"$$mdtype":"Tag","name":"h3","attributes":{"id":"response-5"},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["An example JSON response:"]},{"$$mdtype":"Tag","name":"Fence","attributes":{"language":"json"},"children":["{\n \"data\": [\n {\n \"id\": \"pxl.to/x8djds\",\n \"route\": \"x8djds\",\n \"destination\": \"https://example.com\",\n \"title\": \"Redirect\",\n \"description\": \"Descriptive text\",\n \"image\": \"https://example.com/image.png\",\n \"favicon\": \"https://example.com/favicon.ico\",\n \"consent\": false,\n \"clicks\": 0,\n \"createdAt\": \"2022-07-27T15:17:03.525Z\",\n \"updatedAt\": \"2022-07-27T15:17:03.525Z\"\n },\n {\n \"id\": \"pxl.to/bing/preview\",\n \"route\": \"bing/preview\",\n \"destination\": \"https://bing.com/search?q=preview\",\n \"title\": \"Redirect\",\n \"description\": \"Descriptive text\",\n \"image\": \"https://bing.com/image.png\",\n \"favicon\": \"https://bing.com/favicon.ico\",\n \"consent\": true,\n \"clicks\": 32,\n \"createdAt\": \"2022-02-21T12:11:03.545Z\",\n \"updatedAt\": \"2022-02-21T12:11:03.545Z\"\n }\n ]\n}\n"]}],"frontmatter":{"title":"Short Links (API)","description":"Create and manage short links with the Pxl API. Automate link generation, customize previews, and track clicks to enhance your digital marketing efforts."},"file":{"path":"/docs/api-shorts.md"}}},"__N_SSG":true},"page":"/docs/api-shorts","query":{},"buildId":"PkQ8gH5vl9Ff98ShyLQes","isFallback":false,"gsp":true,"scriptLoader":[]}</script></body></html>

Pages: 1 2 3 4 5 6 7 8 9 10