Authentication
The SNH AI Background Check API uses JWT Bearer tokens. Send a valid JWT on protected routes.GET /health is public in standard deployments (Health check).
Getting sandbox access
Contact SNH AI (support@snh-ai.com) to request sandbox access. You receive a Bearer JWT scoped to your account. The token payload must include thetenant claim SNH AI configures for your environment. Without tenant, protected routes may reject the request even when the JWT is otherwise valid. In-repo tooling (workflow-test.ts) documents that Auth0 machine-to-machine tokens sometimes omit tenant unless your identity provider adds it.
Do not commit client IDs, secrets, or sample JWTs into your codebase or docs.
Using the API reference
- Open any page under API Reference (for example Create order).
- Click Authorize (Bearer lock).
- Paste your JWT. You may include the literal
Bearerprefix or omit it; use what your tooling expects consistently. - Use the JSON examples as request bodies. Default host is sandbox (
https://sandbox.theary.com) unless you select another server.
Authentication method
- Type: Bearer JWT
- Header:
Authorization: Bearer <jwt_token>
Making authenticated requests
Include your JWT on protected endpoints (example: List orders).https://api.theary.ai with production-issued credentials.
Verify your token (tenant claim)
This decodes the JWT payload without cryptographic verification (useful locally; rely on SNH AI issuance for correctness):Optional: machine-to-machine (client credentials)
If SNH AI provisions an Auth0 (or compatible) OAuth client for your integration, obtain tokens viaPOST {AUTH_DOMAIN}/oauth/token with grant_type, client_id, client_secret, audience. Prefer AUTH_TOKEN (a token that already contains tenant) when testing, per internal workflow tooling. Never publish secrets.
Security
- Multi-tenant isolation requires the
tenantclaim aligned to your SNH AI tenant. - Protected routes: all documented integration endpoints except
/healthrequire the Bearer JWT.
Troubleshooting
| Symptom | What to try |
|---|---|
401 Unauthorized, empty or generic body | Missing or malformed Authorization header; ensure Bearer <jwt>. |
401 / message about invalid or expired token | Refresh the JWT; ask SNH AI for a new sandbox token. |
Requests fail after token “works” on /health | Decode the JWT and confirm tenant is present. |
403 Forbidden | JWT valid but not allowed for this tenant or operation; contact SNH AI . |
Auth0 M2M token without tenant | Ask SNH AI to add a tenant claim via your IdP Action or use a manually issued JWT. |
Testing connectivity then auth
GET /health does not require auth: