Skip to content

Authentication ​

All endpoints in the Sharegain API require an API key. To get one, see Getting Started.

Authentication Header ​

http
X-SG-Authorization: [your API key]

Headers ​

HeaderDescription
X-SG-AuthorizationRequired. Your API key, copied from Settings › API access in the lender platform
Content-TypeRequired for POST requests. application/json
X-SG-ApiVersionOptional. Send 1

Example Request ​

bash
curl -X GET https://api.sharegain.com/public/portfolio-analysis/quota \
  -H "X-SG-Authorization: your-api-key"

Authentication Errors ​

StatusMeaning
401The X-SG-Authorization header is missing
403The key is not recognised, or it has been revoked

Key Lifetime ​

Keys don't expire. If you need a key replaced, contact support@sharegain.com. When we rotate a key, the old one stops working immediately, so update your systems at the same time.

Security Best Practices ​

  • Never share your API key or commit it to source control
  • Store it in a secrets manager or environment variables
  • Call the API only from your servers, never from a browser or mobile app
  • If a key may have been exposed, ask us to replace it straight away

Sharegain API Documentation