Skip to content
LakeSharkDocumentation
API REFERENCE / DOCUMENTATION

API overview

Production LakeShark API endpoints, authentication, and client rules.

Production endpoints

API Base URL
Auth https://lakeshark.dev/api/auth
Configuration sets (ConfigStore) https://lakeshark.dev/api/config
Scorecards https://lakeshark.dev/api/scorecards
Answers and HTTP ExecutionSets https://lakeshark.dev/api/answers
Providers https://lakeshark.dev/api/providers
Flows https://lakeshark.dev/api/flows

Customer requests must use the public https://lakeshark.dev/api/<service>/v1/* edge routes. The underlying service origin hostnames are private infrastructure, not customer API endpoints. All API paths below are relative to the base URL in the table.

Geographic access at the edge (configured policy)

The checked-in Cloudflare production edge Terraform and US baseline module define a zone-wide block for requests geolocated outside the United States, with a narrowly scoped exception for the Stripe support webhook. The rule covers the public lakeshark.dev API routes, customer site, and docs.lakeshark.dev; the documentation hostname has a separate US-only custom-challenge skip, not a non-US exemption.

Consequently, a client outside the US may be blocked by Cloudflare before reaching the LakeShark API Worker. An edge-generated block page or HTTP 403 is not necessarily an Auth/RBAC denial and may not have the X-LakeShark-Edge diagnostic header or a LakeShark JSON error body. Do not work around this with a private backend hostname. For access problems, record the requested hostname, time, response status and Cloudflare Ray ID (if supplied), and contact the operator.

This describes version-controlled Terraform intent, not independent evidence that the rules are currently applied at the edge. It is not a data-residency guarantee: country-based request filtering does not establish where data is processed or stored.

Edge routing and request deadlines

The lakeshark-site Worker is the public API gateway. It routes the supported /api/{auth,config,scorecards,answers,providers}/v1/* paths to their approved backends. For Flows, the Worker permits only the canonical POST /api/flows/v1/flows/{flow_id}/runs and legacy POST /api/flows/v1/runs machine-run paths, both routed through Auth’s signed gateway, never directly to the private Flows service. Unsupported service names or paths receive 404 at the edge. Direct backend origin hostnames are not customer API endpoints.

The Worker enforces request deadlines, independent of a backend service’s own timeouts:

Gateway request Edge deadline
Most supported API requests 10 seconds
Provider connection model listing or connection test 20 seconds
Selected generation and management operations, including AnswerSet ask, Knowledge generation, seed generation, GovernanceSet drafting, strict-answer generation, and explicit bound action runs 90 seconds
POST /api/answers/v1/questions and POST /api/answers/v1/answer-sets/{id}/ask-and-execute 180 seconds
POST /api/flows/v1/flows/{flow_id}/runs (and the legacy Flow Key route) 180 seconds

These are maximum Worker wait times, not latency promises or backend service-level objectives. A gateway timeout returns 504; a gateway transport failure returns 502. The Worker adds diagnostic response headers including X-LakeShark-Edge: site-worker, X-LakeShark-Upstream-Status when an upstream response exists, and X-LakeShark-Upstream-Timeout-Ms. An upstream may return its own error code or fail earlier.

A timeout does not prove that a mutation or external action was rolled back. For Question API requests with approved Automatic ExecutionSet connections, reuse the same documented UUID idempotency key for the same logical attempt and inspect action evidence before retrying. See errors and retries and AnswerSet actions.

Source: public gateway implementation.

Authentication

API use Credential
Interactive and management APIs Bearer access token
Management automation Service-account access token
Application question traffic Question Key
Application Flow execution Flow-specific Flow Key plus a Flow ID in the URL

Flows

To execute a particular Flow, call POST /api/flows/v1/flows/{flow_id}/runs using a Flow Key issued for that exact Flow. The key cannot run another Flow. The server executes the active published revision, not the draft.

See Run a Flow with the API for the console workflow, request example, idempotency rules, and responses.

Configuration sets

ConfigStore is the API for named configuration sets with immutable versions.

The first publish to a name creates the set. Every later publish creates and activates another immutable version.

See Configuration sets API.

Question request

export LAKESHARK_QUESTION_KEY='replace-with-question-key'

curl --fail-with-body \
  -X POST 'https://lakeshark.dev/api/answers/v1/questions' \
  -H "Authorization: Bearer $LAKESHARK_QUESTION_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"question":"What is our return policy?"}'

HTTP actions

ExecutionSets use /v1/execution-functions under the Answers API prefix. Explicit AnswerSet actions use /v1/answer-sets/{id}/execution-bindings. The former is not interchangeable with the older deterministic-rule /v1/execution-sets routes. See the HTTP ExecutionSets API and egress boundary.

A Question Key cannot create, modify, or explicitly select actions, but a normal POST /v1/questions can execute the bound AnswerSet’s approved Automatic action connections. Treat these requests as potentially side-effecting. Use an authorized user or service-account token with the required action scopes for explicit execution. Reuse an Idempotency-Key UUID (or idempotency_key request field) when retrying the same logical request; inspect unconfirmed delivery evidence before attempting another action.

Client rules

  1. Use HTTPS.
  2. Keep bearer credentials out of URLs, logs, and source control.
  3. Do not send organization or workspace IDs as replacement authentication context.
  4. Ignore unknown response fields for forward compatibility.
  5. Treat 401 as authentication failure and 403 as authorization failure.
  6. Respect Retry-After on 429 responses.
  7. Use only documented /v1 customer endpoints.