A practical Python toolkit for exploring the Gainsight NXT APIs and building read-only CSM workflows (timeline → company → contacts → domain insights).
Disclaimer: This is an independent, personal project and is not an official Gainsight product.
- Overview
- Why this exists
- What it does
- Quick start
- Scripts
- Environment variables
- Safety & privacy
- Requirements
- Author
This repository is designed to be safe-by-default: all scripts are read-only and use small limits to reduce the friction of working with Gainsight APIs.
- Reduce the friction of working with Gainsight APIs.
- Provide ready‑to‑run examples for common CSM workflows.
- Keep everything simple, observable, and safe (read‑only).
- Timeline viewer: fetch recent activities for a user.
- Company lookup: resolve a
GsCompanyIdto a readable company name. - Contacts lookup: list active contacts for a company.
- CSM dashboard: combine timeline → company → contacts → domain analysis in one flow.
- Hello world: validate credentials + connectivity.
# Environment variables
export GAINSIGHT_DOMAIN="https://yourcompany.gainsightcloud.com"
export GAINSIGHT_ACCESS_KEY="your-access-key"
# (Optional) reduce output sensitivity
export GAINSIGHT_REDACT=1
# Timeline activities
python3 timeline-viewer.py --user-email "you@company.com" --limit 3
# Lookup a company by GSID
python3 company-lookup.py --company-id "YOUR_COMPANY_GSID"
# List contacts for a company
python3 contacts-lookup.py --company-id "YOUR_COMPANY_GSID" --company-name "Acme"
# Full workflow
python3 csm-dashboard.py --user-email "you@company.com" --limit 3| Script | Purpose |
|---|---|
gainsight-api-hello-world.py |
Connectivity test (read-only) |
timeline-viewer.py |
Timeline activities for a user |
company-lookup.py |
Resolve company name from GSID |
contacts-lookup.py |
List active contacts for a company |
csm-dashboard.py |
End‑to‑end CSM workflow |
GAINSIGHT_DOMAIN– e.g.https://yourcompany.gainsightcloud.comGAINSIGHT_ACCESS_KEY– Gainsight access keyGAINSIGHT_REDACT–1(default) masks emails in console output (example:e***@company.com). Set to0to disable masking.
- Read‑only: no create/update/delete operations.
- Small limits: defaults are conservative.
- Redaction: output can be redacted to avoid exposing sensitive data.
Note: Gainsight data can contain PII (names, emails). Use responsibly.
- Python 3.7+
requests
Maintained for personal use; contributions welcome. Feel free to open an issue or submit a pull request.
Emir Belkahia Staff Customer Success Manager @ Algolia
- Website: emirbelkahia.com
- LinkedIn: linkedin.com/in/emirbelkahia
- GitHub: @emirbelkahia
For questions or issues: