{"id":461,"date":"2025-02-07T10:00:41","date_gmt":"2025-02-07T10:00:41","guid":{"rendered":"https:\/\/leaddesk.com\/docs\/?page_id=461"},"modified":"2026-04-07T08:57:05","modified_gmt":"2026-04-07T05:57:05","slug":"jwt-authentication","status":"publish","type":"page","link":"https:\/\/leaddesk.com\/docs\/jwt-authentication\/","title":{"rendered":"JWT authentication"},"content":{"rendered":"","protected":false},"excerpt":{"rendered":"","protected":false},"author":15,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"page-blocks-en.php","meta":{"footnotes":""},"acf":{"blocks_en_new":[{"acf_fc_layout":"text_editor_wysiwyg","acfe_flexible_toggle":"","text-content":"<h1>JSON Web Token (JWT) Authentication<\/h1>\r\nIntegrations to LeadDesk can use a JSON Web Token (JWT) to pass info about a logged-in user from LeadDesk to another system. This avoids forcing the user to login separately to that other system.\r\n\r\nIn addition, the target system\u00a0<strong>must<\/strong>\u00a0verify that\r\n<ul>\r\n \t<li>the signature in the JWT is correct (see\u00a0<em>Signature<\/em>\u00a0below),<\/li>\r\n \t<li>the token has not expired, i.e. the expiry timestamp (<em><strong>exp<\/strong><\/em>) is not in the past, and<\/li>\r\n<\/ul>\r\n\r\n<hr \/>\r\n\r\n<h2 id=\"LeadDeskIdentityJWTFormat-Signature\">Signature<\/h2>\r\nIdentity JWTs are not encrypted, but they are signed using LeadDesk\u2019s private keys. This means that, before accepting a JWT as valid, its signature (i.e. the third and final part) must be verified using the corresponding public key.\r\n\r\nThe header (first part) of the decoded JWT contains the key ID (<em><strong>\u00a0kid<\/strong><\/em>\u00a0) of the private key that the JWT was signed with. The public counterpart can be retrieved using our\u00a0<a href=\"https:\/\/leaddesk.com\/docs\/leaddesk-api\/#\/public_keys\/get_public_keys_signature_pem\">REST API<\/a>.\r\n\r\nExample command to retrieve all the currently active keys:\r\n<em><strong>curl -s -X GET \u201chttps:\/\/restapi-nor.leaddesk.com\/stable\/public_keys\/signature\/pem\u201d<\/strong><\/em>\r\n\r\n<hr \/>\r\n\r\n<h2 id=\"LeadDeskIdentityJWTFormat-Expirytime\">Expiry time<\/h2>\r\nBy default, an the report JWT expires at the next midnight,\u00a0 (unless generated within the hour before midnight, in which case it will expire at the midnight after that). However, other restrictions apply depending on the use case. When used for a LeadApp page, for example, the token expires in five minutes.\r\n\r\n<hr \/>\r\n\r\n<h2 id=\"LeadDeskIdentityJWTFormat-Version1\">Data structure<\/h2>\r\n<div class=\"codeHeader panelHeader pdl\"><b>JWT content<\/b><\/div>\r\n<div class=\"codeContent panelContent pdl\">\r\n<div>\r\n<div id=\"highlighter_676813\" class=\"syntaxhighlighter sh-confluence nogutter py\">\r\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n<tbody>\r\n<tr>\r\n<td class=\"code\">\r\n<div class=\"container\" title=\"Hint: double-click to select code\">\r\n<div class=\"line number1 index0 alt2\" data-bidi-marker=\"true\"><code class=\"py comments\"># Token expiry time<\/code><\/div>\r\n<div class=\"line number2 index1 alt1\" data-bidi-marker=\"true\"><code class=\"py plain\">exp:\u00a0<\/code><code class=\"py value\">1514379194<\/code><\/div>\r\n<div class=\"line number3 index2 alt2\" data-bidi-marker=\"true\"><\/div>\r\n<div class=\"line number4 index3 alt1\" data-bidi-marker=\"true\"><code class=\"py comments\"># User who opened the report (=UID)<\/code><\/div>\r\n<div class=\"line number5 index4 alt2\" data-bidi-marker=\"true\"><code class=\"py plain\">user:\u00a0<\/code><code class=\"py value\">166320930817<\/code><\/div>\r\n<div class=\"line number6 index5 alt1\" data-bidi-marker=\"true\"><code class=\"py comments\"># User's role<\/code><\/div>\r\n<div class=\"line number7 index6 alt2\" data-bidi-marker=\"true\"><code class=\"py plain\">role:\u00a0<\/code><code class=\"py string\">\"agent\"<\/code><\/div>\r\n<div class=\"line number8 index7 alt1\" data-bidi-marker=\"true\"><code class=\"py comments\"># User's client id<\/code><\/div>\r\n<div class=\"line number9 index8 alt2\" data-bidi-marker=\"true\"><code class=\"py plain\">client:\u00a0<\/code><code class=\"py value\">1<\/code><\/div>\r\n<div class=\"line number10 index9 alt1\" data-bidi-marker=\"true\"><\/div>\r\n<div class=\"line number11 index10 alt2\" data-bidi-marker=\"true\"><code class=\"py comments\"># Request's path and query signature<\/code><\/div>\r\n<div class=\"line number12 index11 alt1\" data-bidi-marker=\"true\"><code class=\"py plain\">signature: b0ca383cb83906bf4d7938f8932140fb2334ae...3dcc5f199fcd02<\/code><\/div>\r\n<\/div><\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<\/div>\r\n<\/div>\r\n<\/div>","text-script":"","unique_css_name":"","custom_css":""}]},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v22.5 (Yoast SEO v22.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>JWT authentication - LeadDesk Developers<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/leaddesk.com\/docs\/jwt-authentication\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JWT authentication\" \/>\n<meta property=\"og:url\" content=\"https:\/\/leaddesk.com\/docs\/jwt-authentication\/\" \/>\n<meta property=\"og:site_name\" content=\"LeadDesk Developers\" \/>\n<meta property=\"article:modified_time\" content=\"2026-04-07T05:57:05+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/leaddesk.com\/docs\/jwt-authentication\/\",\"url\":\"https:\/\/leaddesk.com\/docs\/jwt-authentication\/\",\"name\":\"JWT authentication - LeadDesk Developers\",\"isPartOf\":{\"@id\":\"https:\/\/leaddesk.com\/docs\/#website\"},\"datePublished\":\"2025-02-07T10:00:41+00:00\",\"dateModified\":\"2026-04-07T05:57:05+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/leaddesk.com\/docs\/jwt-authentication\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/leaddesk.com\/docs\/jwt-authentication\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/leaddesk.com\/docs\/jwt-authentication\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/leaddesk.com\/docs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"JWT authentication\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/leaddesk.com\/docs\/#website\",\"url\":\"https:\/\/leaddesk.com\/docs\/\",\"name\":\"LeadDesk Developers\",\"description\":\"Reach thousands of LeadDesk customers around the world by building LeadApps and integrations that help them close more deals and customer service tickets.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/leaddesk.com\/docs\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"JWT authentication - LeadDesk Developers","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/leaddesk.com\/docs\/jwt-authentication\/","og_locale":"en_US","og_type":"article","og_title":"JWT authentication","og_url":"https:\/\/leaddesk.com\/docs\/jwt-authentication\/","og_site_name":"LeadDesk Developers","article_modified_time":"2026-04-07T05:57:05+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/leaddesk.com\/docs\/jwt-authentication\/","url":"https:\/\/leaddesk.com\/docs\/jwt-authentication\/","name":"JWT authentication - LeadDesk Developers","isPartOf":{"@id":"https:\/\/leaddesk.com\/docs\/#website"},"datePublished":"2025-02-07T10:00:41+00:00","dateModified":"2026-04-07T05:57:05+00:00","breadcrumb":{"@id":"https:\/\/leaddesk.com\/docs\/jwt-authentication\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/leaddesk.com\/docs\/jwt-authentication\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/leaddesk.com\/docs\/jwt-authentication\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/leaddesk.com\/docs\/"},{"@type":"ListItem","position":2,"name":"JWT authentication"}]},{"@type":"WebSite","@id":"https:\/\/leaddesk.com\/docs\/#website","url":"https:\/\/leaddesk.com\/docs\/","name":"LeadDesk Developers","description":"Reach thousands of LeadDesk customers around the world by building LeadApps and integrations that help them close more deals and customer service tickets.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/leaddesk.com\/docs\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/leaddesk.com\/docs\/wp-json\/wp\/v2\/pages\/461"}],"collection":[{"href":"https:\/\/leaddesk.com\/docs\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/leaddesk.com\/docs\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/leaddesk.com\/docs\/wp-json\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/leaddesk.com\/docs\/wp-json\/wp\/v2\/comments?post=461"}],"version-history":[{"count":11,"href":"https:\/\/leaddesk.com\/docs\/wp-json\/wp\/v2\/pages\/461\/revisions"}],"predecessor-version":[{"id":1475,"href":"https:\/\/leaddesk.com\/docs\/wp-json\/wp\/v2\/pages\/461\/revisions\/1475"}],"wp:attachment":[{"href":"https:\/\/leaddesk.com\/docs\/wp-json\/wp\/v2\/media?parent=461"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}