Authentication
Human access tokens, service accounts, and Question Keys.
LakeShark uses separate credentials for interactive users, automation, and application question traffic.
Human login
POST https://lakeshark.dev/api/auth/v1/auth/login
Example:
curl --fail-with-body \
-X POST 'https://lakeshark.dev/api/auth/v1/auth/login' \
-H 'Content-Type: application/json' \
-d '{
"organization_slug": "example-org",
"workspace_slug": "production",
"email": "user@example.com",
"password": "replace-with-password"
}'
The response returns a bearer access token for the authenticated user and selected organization/workspace context.
Organization and workspace selection
POST /v1/auth/options
GET /v1/auth/organizations
POST /v1/auth/organization-switch
POST /v1/auth/workspace-switch
POST /v1/auth/refresh
Switch operations return a new access token. Replace the previous token in the client.
Service accounts
Use service accounts for unattended management automation.
A service credential is exchanged for an access token authorized by the service account’s assigned roles.
Question Keys
Question Keys authenticate application traffic:
POST https://lakeshark.dev/api/answers/v1/questions
A Question Key resolves its organization, workspace, and AnswerSet server-side. It does not grant management or arbitrary ExecutionSet invocation privileges. If that AnswerSet has approved Automatic action connections, the Question API may perform external HTTP side effects. Clients should send a UUID Idempotency-Key and reuse it for retries of the same logical request; inspect action-run evidence when delivery is uncertain. See AnswerSet action authorization.
Management endpoints:
GET /v1/answer-sets/{answer_set_id}/question-keys
POST /v1/answer-sets/{answer_set_id}/question-keys
POST /v1/answer-sets/{answer_set_id}/question-keys/{key_id}/revoke
Credential handling
| Credential | Store in |
|---|---|
| Human password | Password manager or approved identity system |
| Access token | Short-lived secure session storage |
| Service credential | Managed secret store |
| Question Key | Managed application secret store |
| Provider token | LakeShark provider connection |
Do not put credentials in source control, URLs, analytics, or logs.