Admin API
The Admin API is the server-side companion for Shen.AI SDK.
Currently, it lets you avoid embedding your permanent SDK key in client apps/pages by issuing short-lived, narrow-scope tokens to client devices whenever you need them.
Use-case | Why the Admin API helps |
---|---|
Ship a mobile / web app without hard-coding long-lived secrets | Store the permanent key on your backend only. |
Limit how many measurements a device can perform | Generate a token with max_measurements . |
Lock a token to the first device that activates it | Set single_device: true . |
Generate single-measurement links for the Web SDK | Embed the token in the link URL. |
The OpenAPI reference is always the source of truth.
For request/response details go to the automatically generated documentation at:
https://api.shen.ai
Overview of the flow
- Server (your backend) authenticates with an Admin Credential (
ska_…
). - It calls
POST /v1/token
(or/tokens
for bulk) and receives a JSON payload containing the new token. - The client app initializes the SDK with that token instead of the permanent key.
- When the token expires (or the measurement cap is reached) the client asks your backend for a fresh one.
What’s next?
- Authentication - generating and managing Admin Credentials
- Short-lived tokens - request format, options, and best practices