{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Advanced","description":"The best API documentation generator ever.","siteUrl":"https://developer-portal-starter.redoc.ly","keywords":"redocly developer portal, api portal starter, api reference docs","lang":"en-US","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"advanced","__idx":0},"children":["Advanced"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To get started using the Lytx API, authenticate yourself by generating an access token. The token gives"," ","you access to the API operations. If you make a request using an API operation that you don't have"," ","access to, an error is returned. The token must be created via user registration using Postman."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"_","__idx":1},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Requirements"]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://www.postman.com/downloads/"},"children":["Postman Desktop App"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://gitforwindows.org/"},"children":["Git for Windows"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Lytx Account credentials for a 'Full Access' user at the highest group level. For detail on creating users, go to ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://support.lytx.com/s/article/add-edit-users"},"children":["Managing Users"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["(For Groups API ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["write"]}," endpoints) Lytx Account credentials for user with 'Full Access' ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["and"]}," 'Group Manager' roles at the highest group level."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"_-1","__idx":2},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Before You Begin"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/assets/postman_collection.b9289c66b5614d0fc97bd8f06d2fcbc20ed198edf70f2535d33b8300b6d87b86.5a30fde5.json","title":"download"},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Customer Collection.postman_collection.json"]}]}," collection must be downloaded and imported into your local workspace."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"_-2","__idx":3},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Instructions"]}]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["If the user to register does not have a public key, generate one. Open git-bash in Windows Search Bar and run these commands in order. This generates a public and private key pair inside the lytx_keys folder."," ","Suggested Script:"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"mkdir lytx_keys\ncd lytx_keys\nopenssl genrsa -out private.pem 2048\nopenssl rsa -in private.pem -outform PEM -pubout -out public.pem\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":2},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In this scenario, the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["public.pem"]}," file contains the public key. Save or copy the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["public.pem"]}," file to Postman's working directory. You can check where it is in: Postman App > Settings > General > Location"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If the Customer Collection from the Before You Begin section has already been imported, select it in Postman. Select ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Customer Collection.postman_collection.json"]},". In the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Variables"]}," tab, update the my_username and my_password with the Lytx Account user credentials. Save your changes."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Click on the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["User Registration"]}," folder, then click the Run icon in the top right."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In the Runner dialog, checkmark ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Persist Responses for a Session"]}," in the bottom-right, then click the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Run"]}," button. Verify all tests passed."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Click on the POST Register User call to see the response. The values (header and payload) will be needed in the next section. These values can also be found in the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Variables"]}," tab of the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Customer Collection.postman_collection.json"]},"."]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"generating-an-access-token","__idx":4},"children":["Generating An Access Token"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To complete registration, you need to generate a JSON Web Token. For that, you need the following:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Header"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Payload"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Private Key"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Public Key"," ","With the data above, the header and payload would be as follows:"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Header sample:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"alg\": \"RS256\",\n  \"typ\": \"JWT\",\n  \"iss\": \"4XMeH767NxCuPZCzWjlHu98aeU1126IN\"\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Payload sample:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"name\": \"kongtestuser\",\n  \"user_id\": \"0000ffff-0000-1b00-71ca-ed46b0d60000\",\n  \"co_id\": \"1129\",\n  \"rootgroupid\": \"2bb2d9b4-c801-e111-81ce-e61f13277aab\",\n  \"roles\": \"Developer\",\n  \"exp\": 1701887152\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To generate the access token, proceed as follows"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Go to ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://jwt.io/"},"children":["JWT.IO"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["For Algorithm, select ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["RS256"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Insert the Header and Payload from above. Note that the \"exp\" field is defaulted to 1 month, but can be adjusted according to the account's security policy."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Navigate to and open your Public and Private Keys, previously created, in a text editor. Copy the entirety of the Public Key, to include ---BEGIN PUBLIC KEY--- and ---END PUBLIC KEY--- and replace the content in the top box under Verify Signature. Repeat the same for the Private Key into the bottom box."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Once Signature is Verified in the bottom-left, your token is the encoded token on the left. Copy this into the Postman Customer Collection variables under Current Value for thirdparty.access-token. This token is the key component for authorization when calling the GET Short Lived Token."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Call the GET Short Lived Token request to receive your signed token. This bearer token will lasts 60 minutes. If this step is successful, you will not need to repeat steps 1-5 until the time your JWT expires."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Copy the token's value only, select the appropriate API call you'd like to make on the left hand side, click Try It in the top right corner, past the token under Bearer Token, ensure all required parameters (marked with an asterisk) are met and any optional parameters are valid, click send."]}]}]},"headings":[{"value":"Advanced","id":"advanced","depth":1},{"value":"","id":"_","depth":2},{"value":"","id":"_-1","depth":2},{"value":"","id":"_-2","depth":2},{"value":"Generating An Access Token","id":"generating-an-access-token","depth":3}],"frontmatter":{"seo":{"title":"Advanced"}},"lastModified":"2026-04-23T11:52:44.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/docs/authentication_advanced","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}