{"id":18695,"date":"2026-07-10T03:16:30","date_gmt":"2026-07-10T09:16:30","guid":{"rendered":"https:\/\/prettylinks.com\/?post_type=ht_kb&#038;p=18695"},"modified":"2026-07-20T05:36:26","modified_gmt":"2026-07-20T11:36:26","slug":"rest-api-reference","status":"publish","type":"ht_kb","link":"https:\/\/prettylinks.com\/fr\/docs\/rest-api-reference\/","title":{"rendered":"R\u00e9f\u00e9rence de l'API REST"},"content":{"rendered":"<p class=\"wp-block-paragraph\"><em>Disponible avec la formule \u00ab Marketer \u00bb et les formules sup\u00e9rieures.<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This page is a high-level orientation. <strong>The full, always-up-to-date REST API reference lives inside your WordPress admin<\/strong> \u2014 go to <strong>Dashboard &gt; Pretty Links &gt; Developer Tools &gt; Docs<\/strong> for complete request and response examples.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Ce guide fait partie de la <a href=\"https:\/\/prettylinks.com\/fr\/docs\/pretty-link-developer-tools-add-on-overview\/\">Pr\u00e9sentation de l'extension \u00ab Pretty Links Developer Tools \u00bb<\/a>, the entry point for the Developer Tools add-on.<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6a5fb540c7fe6&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6a5fb540c7fe6\" class=\"wp-block-image size-full wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1600\" height=\"1000\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/prettylinks.com\/wp-content\/uploads\/2026\/07\/developer-tools-1.png\" alt=\"Pretty Links Developer Tools \u2014 API keys and webhooks\" class=\"wp-image-18694\" srcset=\"https:\/\/prettylinks.com\/wp-content\/uploads\/2026\/07\/developer-tools-1.png 1600w, https:\/\/prettylinks.com\/wp-content\/uploads\/2026\/07\/developer-tools-1-300x188.png 300w, https:\/\/prettylinks.com\/wp-content\/uploads\/2026\/07\/developer-tools-1-1024x640.png 1024w, https:\/\/prettylinks.com\/wp-content\/uploads\/2026\/07\/developer-tools-1-768x480.png 768w, https:\/\/prettylinks.com\/wp-content\/uploads\/2026\/07\/developer-tools-1-50x31.png 50w, https:\/\/prettylinks.com\/wp-content\/uploads\/2026\/07\/developer-tools-1-1536x960.png 1536w\" sizes=\"auto, (max-width: 1600px) 100vw, 1600px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"where-to-find-the-full-reference\"><a href=\"#where-to-find-the-full-reference\">Where to Find the Full Reference<\/a><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Dans la barre lat\u00e9rale d'administration de WordPress, rendez-vous dans <strong>Dashboard &gt; Pretty Links &gt; Developer Tools &gt; Docs<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The Docs tab shows every endpoint with its HTTP method, parameters, request body shape, response shape, and example calls. Because it's served from inside your install, it always matches your actual version of Pretty Links \u2014 no stale online docs to worry about.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Open the Docs tab in a second browser tab while you work. It's the source of truth.<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6a5fb540c8626&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6a5fb540c8626\" class=\"wp-block-image size-full wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1600\" height=\"1000\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/prettylinks.com\/wp-content\/uploads\/2026\/07\/developer-tools-1.png\" alt=\"Pretty Links Developer Tools \u2014 API keys and webhooks\" class=\"wp-image-18694\" srcset=\"https:\/\/prettylinks.com\/wp-content\/uploads\/2026\/07\/developer-tools-1.png 1600w, https:\/\/prettylinks.com\/wp-content\/uploads\/2026\/07\/developer-tools-1-300x188.png 300w, https:\/\/prettylinks.com\/wp-content\/uploads\/2026\/07\/developer-tools-1-1024x640.png 1024w, https:\/\/prettylinks.com\/wp-content\/uploads\/2026\/07\/developer-tools-1-768x480.png 768w, https:\/\/prettylinks.com\/wp-content\/uploads\/2026\/07\/developer-tools-1-50x31.png 50w, https:\/\/prettylinks.com\/wp-content\/uploads\/2026\/07\/developer-tools-1-1536x960.png 1536w\" sizes=\"auto, (max-width: 1600px) 100vw, 1600px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"endpoint-overview\"><a href=\"#endpoint-overview\">Endpoint Overview<\/a><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Here's a quick map of what's available, so you know what's possible before you dig into the in-app docs.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"pretty-links-crud\"><a href=\"#pretty-links-crud\">Pretty Links (CRUD)<\/a><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>List Pretty Links<\/strong> \u2014 Get all of your Pretty Links, with filtering and pagination;<\/li>\n<li><strong>Get a single Pretty Link<\/strong> \u2014 Look up one link by ID;<\/li>\n<li><strong>Create a Pretty Link<\/strong> \u2014 Add a new link programmatically. Useful for migrations, bulk imports, or auto-creating links from another system;<\/li>\n<li><strong>Update a Pretty Link<\/strong> \u2014 Modify an existing link's target URL, slug, redirect type, name, or other fields;<\/li>\n<li><strong>Delete a Pretty Link<\/strong> \u2014 Trash or permanently remove a link.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"webhook-subscriptions\"><a href=\"#webhook-subscriptions\">Webhook Subscriptions<\/a><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Subscribe<\/strong> \u2014 Create a new webhook subscription programmatically (POST);<\/li>\n<li><strong>Unsubscribe<\/strong> \u2014 Remove a webhook subscription by ID (DELETE).<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">These are useful when an external system needs to manage its own webhook subscription lifecycle \u2014 for example, an integration that wants to register itself when activated and clean up when deactivated. To view the current list of subscriptions, use the Webhooks screen in the admin.<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6a5fb540c8e55&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6a5fb540c8e55\" class=\"wp-block-image size-full wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1600\" height=\"1000\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/prettylinks.com\/wp-content\/uploads\/2026\/07\/developer-tools-1.png\" alt=\"Pretty Links Developer Tools \u2014 API keys and webhooks\" class=\"wp-image-18694\" srcset=\"https:\/\/prettylinks.com\/wp-content\/uploads\/2026\/07\/developer-tools-1.png 1600w, https:\/\/prettylinks.com\/wp-content\/uploads\/2026\/07\/developer-tools-1-300x188.png 300w, https:\/\/prettylinks.com\/wp-content\/uploads\/2026\/07\/developer-tools-1-1024x640.png 1024w, https:\/\/prettylinks.com\/wp-content\/uploads\/2026\/07\/developer-tools-1-768x480.png 768w, https:\/\/prettylinks.com\/wp-content\/uploads\/2026\/07\/developer-tools-1-50x31.png 50w, https:\/\/prettylinks.com\/wp-content\/uploads\/2026\/07\/developer-tools-1-1536x960.png 1536w\" sizes=\"auto, (max-width: 1600px) 100vw, 1600px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"authentication\"><a href=\"#authentication\">Authentication<\/a><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">All endpoints require the site API key, sent in either the <code>PRLI-API-KEY<\/code> header or the <code>Authorization<\/code> header. See <strong><a href=\"https:\/\/prettylinks.com\/fr\/docs\/api-keys\/\">Cl\u00e9s API<\/a><\/strong> for where to find it and how to regenerate it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The REST namespace is <code>pl\/v1<\/code> \u2014 for example, <code>https:\/\/yoursite.com\/wp-json\/pl\/v1\/links<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The in-app Docs tab shows the exact header format and a curl example you can copy.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"response-format\"><a href=\"#response-format\">Response Format<\/a><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">All responses are JSON. Successful responses return a 2xx status code with the relevant data in the body. Errors return a 4xx or 5xx status code with a JSON body describing what went wrong.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Standard HTTP conventions apply:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>200 OK<\/code> \u2014 Successful read;<\/li>\n<li><code>201 Created<\/code> \u2014 Successful create;<\/li>\n<li><code>400 Bad Request<\/code> \u2014 Your request was malformed;<\/li>\n<li><code>401 Unauthorized<\/code> \u2014 Missing or invalid API key;<\/li>\n<li><code>404 Not Found<\/code> \u2014 The link or resource doesn't exist;<\/li>\n<li><code>500 Internal Server Error<\/code> \u2014 Something went wrong on the server.<\/li>\n<\/ul>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6a5fb540c95b1&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6a5fb540c95b1\" class=\"wp-block-image size-full wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1600\" height=\"1000\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/prettylinks.com\/wp-content\/uploads\/2026\/07\/developer-tools-1.png\" alt=\"Pretty Links Developer Tools \u2014 API keys and webhooks\" class=\"wp-image-18694\" srcset=\"https:\/\/prettylinks.com\/wp-content\/uploads\/2026\/07\/developer-tools-1.png 1600w, https:\/\/prettylinks.com\/wp-content\/uploads\/2026\/07\/developer-tools-1-300x188.png 300w, https:\/\/prettylinks.com\/wp-content\/uploads\/2026\/07\/developer-tools-1-1024x640.png 1024w, https:\/\/prettylinks.com\/wp-content\/uploads\/2026\/07\/developer-tools-1-768x480.png 768w, https:\/\/prettylinks.com\/wp-content\/uploads\/2026\/07\/developer-tools-1-50x31.png 50w, https:\/\/prettylinks.com\/wp-content\/uploads\/2026\/07\/developer-tools-1-1536x960.png 1536w\" sizes=\"auto, (max-width: 1600px) 100vw, 1600px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"tips-for-working-with-the-api\"><a href=\"#tips-for-working-with-the-api\">Tips for Working With the API<\/a><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Start with a List call.<\/strong> The first request to try is &#8220;list all my Pretty Links.&#8221; It validates your API key, your URL format, and your tool's setup \u2014 all in one go.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Read the in-app docs for exact field names.<\/strong> The list of fields on a Pretty Link is documented inside the admin. Don't guess at field names; copy them from the docs to avoid typos.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Test create and update calls on a staging site first.<\/strong> A typo in a bulk-create script can produce hundreds of garbage links. Run against a staging environment, verify the result, then point at production.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Use webhooks instead of polling.<\/strong> If you find yourself calling the List endpoint on a schedule to check for changes, set up a webhook subscription instead. You'll get changes pushed to you in real time, with no rate-limit concerns.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Check the event log if a webhook isn't firing.<\/strong> Don't assume \u2014 verify. The event log shows whether Pretty Links actually sent the request and what response your endpoint returned.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For everything else, the in-app Docs tab is the source of truth. Bookmark it.<\/p>","protected":false},"excerpt":{"rendered":"<p>Available on the Marketer plan and above. This page is a high-level orientation. The full, always-up-to-date REST API reference lives inside your WordPress admin \u2014 go to Dashboard &gt; Pretty Links &gt; Developer Tools &gt; Docs for complete request and response examples. This guide is part of the Pretty Links Developer Tools Add-on Overview, the&hellip;<\/p>","protected":false},"author":34280,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_strive_editorial_status":"not-started","_strive_copy_of":0,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"ht-kb-category":[716],"ht-kb-tag":[],"class_list":["post-18695","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-developer-tools"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/prettylinks.com\/fr\/wp-json\/wp\/v2\/ht-kb\/18695","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prettylinks.com\/fr\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/prettylinks.com\/fr\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/prettylinks.com\/fr\/wp-json\/wp\/v2\/users\/34280"}],"replies":[{"embeddable":true,"href":"https:\/\/prettylinks.com\/fr\/wp-json\/wp\/v2\/comments?post=18695"}],"version-history":[{"count":1,"href":"https:\/\/prettylinks.com\/fr\/wp-json\/wp\/v2\/ht-kb\/18695\/revisions"}],"predecessor-version":[{"id":18919,"href":"https:\/\/prettylinks.com\/fr\/wp-json\/wp\/v2\/ht-kb\/18695\/revisions\/18919"}],"wp:attachment":[{"href":"https:\/\/prettylinks.com\/fr\/wp-json\/wp\/v2\/media?parent=18695"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/prettylinks.com\/fr\/wp-json\/wp\/v2\/ht-kb-category?post=18695"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/prettylinks.com\/fr\/wp-json\/wp\/v2\/ht-kb-tag?post=18695"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}