feat(scripts): add Mintlify assistant conversations export#2325
feat(scripts): add Mintlify assistant conversations export#2325johndmulhausen wants to merge 1 commit intomainfrom
Conversation
This update includes the addition of the .env file to the .gitignore to prevent sensitive environment variables from being tracked in version control.
| "Warning: Mintlify admin API keys normally start with mint_. " | ||
| f"If requests fail, create a key on {_DASHBOARD_API_KEYS}.", |
Check failure
Code scanning / CodeQL
Clear-text logging of sensitive information High
Copilot Autofix
AI 12 days ago
Copilot could not generate an autofix suggestion
Copilot could not generate an autofix suggestion for this alert. Try pushing a new commit or if the problem persists contact support.
| "\n401 means Mintlify rejected the Bearer token for this project (not a transport bug).\n" | ||
| f" - Open {_DASHBOARD_API_KEYS}\n" | ||
| " - Create or rotate an organization admin API key (usually mint_...).\n" | ||
| " - Set MINTLIFY_PROJECT_ID to the Project ID shown on that page, not the docs " | ||
| "subdomain unless the dashboard explicitly says they are the same.\n" | ||
| " - Put only the raw secret in MINTLIFY_API_KEY (no 'Bearer ' prefix).\n" | ||
| " - Run again with --verbose to confirm URL, ID length, and key prefix.\n" | ||
| " - If it still fails, the key may lack Analytics API access for your plan; " | ||
| "contact Mintlify support with the time of the request.\n", |
Check failure
Code scanning / CodeQL
Clear-text logging of sensitive information High
Copilot Autofix
AI 12 days ago
Copilot could not generate an autofix suggestion
Copilot could not generate an autofix suggestion for this alert. Try pushing a new commit or if the problem persists contact support.
🔗 Link Checker Results✅ All links are valid! No broken links were detected. Checked against: https://wb-21fd5541-conversation-downloader.mintlify.app |
|
I'm not sure exactly what this PR does. I created a simple shell script that got responses. 🤷 Script to get responses: https://github.com/ngrayluna/explore_mintlify_agent/blob/main/get_responses.sh |
Summary
Adds
scripts/download_mintlify_assistant_conversations.pyto download AI assistant conversation history from the Mintlify Analytics API (GET /v1/analytics/{projectId}/assistant), following pagination untilhasMoreis false. Output is JSON withcountandconversations.Credentials
.envand.env.local(.env.localoverrides duplicate keys).MINTLIFY_PROJECT_ID,MINTLIFY_API_KEY(organization admin key, usuallymint_).Implementation
urllib).User-Agent; on HTTP 403, retries viacurlwhen available.Bearerprefix, scrubs invisible Unicode from secrets, URL-encodesprojectIdin the path.--verbosefor debugging 401s; extra stderr hints when unauthorized.Other
.gitignore: ignore.envso API keys are not committed.How to test