Authentication
Use an API key to read each participant's readiness and enrollment. Send it as a bearer token with every request.
Get an API key
- Email your TrueAge contact for an API key (sandbox first, production when you go live). Include:
- Your company name
- That you need a Read-only key
- Copy the key when it arrives. It is shown once.
- Sandbox keys start with
trueage_test_sk_. - Production keys start with
trueage_sk_.
Authenticate requests
Add this header to every request:
Authorization: Bearer <key>
Check credentials
curl 'https://my.trueageretirement.com/api/rk/v1/credentials' \
-H "Authorization: Bearer $TRUEAGE_API_KEY"const res = await fetch('https://my.trueageretirement.com/api/rk/v1/credentials', {
method: 'GET',
headers: {
Authorization: `Bearer ${apiKey}`,
},
});
const result = await res.json();import requests
res = requests.get(
"https://my.trueageretirement.com/api/rk/v1/credentials",
headers={"Authorization": f"Bearer {api_key}"},
)
result = res.json()Check credentials shows the integration and access of a key.
Access
Ask for a Read-only key. It reads readiness and enrollment, which is all you need here.
If you send data by API rather than files, your TrueAge contact will tell you which access you need.
Keep your API key safe
- Keep keys in a secrets manager, never in code, tickets or email.
- Use a Read-only key.
- Keys don't expire. To replace one, ask your TrueAge contact for a new key, switch to it, then ask for the old one to be revoked.
- A call from an address outside a key's allowlist gets
403 IP_NOT_ALLOWED. Ask your TrueAge contact to add the address. - If a key may be exposed, tell your TrueAge contact right away.
Next: Readiness and enrollment