{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-docs/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Authentication","description":"Reference, guides and recipes for the Franklin API — create cases, link sample files, retrieve variants and reports."},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"authentication","__idx":0},"children":["Authentication"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Every endpoint except login requires a Bearer token in the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Authorization"]}," header."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"get-a-token","__idx":1},"children":["Get a token"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api/openapi/authentication/loginpost"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /v1/auth/login"]}]}," with your Franklin credentials in the body. The account must have API access enabled for your organization."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X POST \"https://api.genoox.com/v1/auth/login\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"email\": \"you@example.com\", \"password\": \"your_password\"}'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"token\": \"eyJhbGciOiJIUzI1NiIs...\",\n  \"duration\": 86400,\n  \"expires_at\": 1704153600\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Field"},"children":["Field"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Meaning"},"children":["Meaning"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["token"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Send as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Authorization: Bearer <token>"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["duration"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Validity in seconds, typically 86400 (24 hours)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["expires_at"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Unix timestamp, in seconds, when the token stops working"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api/openapi/authentication/login"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET"]}," variant"]}," also exists, taking the email as a query parameter and the password in the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Authorization"]}," header. Prefer ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST"]}," for new integrations: it keeps the email out of URLs and access logs."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"use-the-token","__idx":2},"children":["Use the token"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl \"https://api.genoox.com/v1/analysis?analysis_id=12345\" \\\n  -H \"Authorization: Bearer $FRANKLIN_TOKEN\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"keep-a-session-alive","__idx":3},"children":["Keep a session alive"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Tokens expire; there is no refresh endpoint. Log in again shortly before ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["expires_at"]},", and once more if a call returns ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["401"]},"."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"import time\nimport requests\n\nBASE = \"https://api.genoox.com\"\n\nclass FranklinClient:\n    def __init__(self, email, password):\n        self.email, self.password = email, password\n        self.token, self.expires_at = None, 0\n\n    def _login(self):\n        r = requests.post(f\"{BASE}/v1/auth/login\",\n                          json={\"email\": self.email, \"password\": self.password})\n        r.raise_for_status()\n        body = r.json()\n        self.token, self.expires_at = body[\"token\"], body[\"expires_at\"]\n\n    def request(self, method, path, **kwargs):\n        if time.time() > self.expires_at - 300:          # renew 5 minutes early\n            self._login()\n        headers = {\"Authorization\": f\"Bearer {self.token}\"}\n        r = requests.request(method, f\"{BASE}{path}\", headers=headers, **kwargs)\n        if r.status_code == 401:                          # revoked or expired early\n            self._login()\n            headers[\"Authorization\"] = f\"Bearer {self.token}\"\n            r = requests.request(method, f\"{BASE}{path}\", headers=headers, **kwargs)\n        return r\n","lang":"python"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The recipes use this ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FranklinClient"]}," as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["client"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"login-failures","__idx":4},"children":["Login failures"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Status"},"children":["Status"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"message"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["message"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"What to do"},"children":["What to do"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["401"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["login failed, check email and password"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Check the credentials"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["401"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["user you@example.com is not allowed to use api"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Ask your Franklin representative to enable API access for this user"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["429"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["rate limit exceeded"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Back off. Repeated failed logins can temporarily block the account"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"good-practice","__idx":5},"children":["Good practice"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Use a dedicated integration user rather than a person's account, so rotating the password or offboarding someone never breaks the integration."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Keep credentials in a secret store, never in source code."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Reuse one token for its lifetime instead of logging in before every call."]}]}]},"headings":[{"value":"Authentication","id":"authentication","depth":1},{"value":"Get a token","id":"get-a-token","depth":2},{"value":"Use the token","id":"use-the-token","depth":2},{"value":"Keep a session alive","id":"keep-a-session-alive","depth":2},{"value":"Login failures","id":"login-failures","depth":2},{"value":"Good practice","id":"good-practice","depth":2}],"frontmatter":{"seo":{"title":"Authentication"}},"lastModified":"2026-09-30T21:14:32.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/docs/guides/authentication","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}