Authentication
All endpoints in the Sharegain API require authentication.
Authentication Header
http
X-SG-Authorization: [token]Required Headers
| Header | Description |
|---|---|
X-SG-Authorization | Your authentication token provided by Sharegain |
X-SG-ApiVersion | API version (currently 1) |
Content-Type | application/json for POST requests |
Example Request
bash
curl -X GET https://api.sharegain.com/public/portfolio-analysis/quota \
-H "X-SG-Authorization: your-token-here" \
-H "X-SG-ApiVersion: 1"Security Best Practices
- Never share your API token publicly
- Store tokens securely in environment variables
- Rotate tokens periodically
- Only whitelist necessary IP addresses