12 — DEVELOPER PORTAL NO PUBLIC API
Build against a protocol, not a promise.
بوابة المطورين وواجهات البرمجة.
The interface FALAK will expose: create an experiment from a question, run it, read its results, pull the evidence bundle underneath, and receive webhooks when a run finishes. This page documents the shape of that interface. There is no public API today — no host, no keys, no live endpoints — so every example below is the documented shape and every playground request is simulated in your browser.
- APInot public
- Keys issued0
- Endpoints live0
- Webhook endpoints0
Nothing on this page sends a request anywhere. A response shown here is generated locally and stamped simulated.
01 — Documentation
Start from a question.
The API is shaped around one object: the experiment. You send a question and a design, FALAK compiles a protocol, runs it, and returns results with the evidence that produced them. Nothing in the interface lets you ask for a result without the run that made it.
- Create the experimentQuestion, design and arms. The response carries a draft protocol, not a result.
- Run itA run is a job with an id. It finishes with a status, never with a result and an error at the same time.
- Read results and evidenceEstimates arrive with intervals and the criteria state. The evidence bundle holds the raw files and their hashes.
FALAK does not issue API keys, and this portal cannot create one. The install commands and code below describe the interface being built; running them today fails at the first step, which is the honest state of it.
# No public API exists. This is the shape of the first call, not a runnable script.
export FALAK_KEY="flk_test_PLACEHOLDER" # no key is issued
curl https://api.falak.dev/v1/experiments \
-H "Authorization: Bearer $FALAK_KEY" \
-H "Content-Type: application/json" \
-d '{"question":"Does spaced practice beat massed practice?",
"design":"between_subjects","arms":2}'
Documented base URL api.falak.dev. No host answers there today, so the command returns nothing to read.
02 — API reference
Endpoints, and what state they are in.
Every endpoint below is documented. None is live. The state column is the load-bearing part of this table: not live means the path is a design decision, not a service.
| Method | Path | Purpose | State |
|---|---|---|---|
| POST | /v1/experiments | Create an experiment from a question | not live |
| GET | /v1/experiments/{id} | Read an experiment and its protocol | not live |
| POST | /v1/experiments/{id}/runs | Start a run | not live |
| GET | /v1/experiments/{id}/results | Read estimates, intervals and criteria state | not live |
| GET | /v1/evidence/{id} | Read an evidence bundle and its hashes | not live |
| POST | /v1/webhooks | Register a webhook endpoint | not live |
A row marked not live would not return a 200 today. It would not return anything: nothing is listening.
03 — Playground
A playground that says what it is.
Pick an endpoint, edit the body, and run it. The button says Run simulation on purpose: no request leaves your browser, no key is used, and the response is generated locally from the documented shape. Every simulated response carries "simulated": true.
Request body (edited locally)
The body is documentation. Editing it changes only the simulated response below.
Simulated response — not run yet
{
"note": "Run the simulation to see the documented response shape.",
"simulated": true
}
No network request is made at any point.
04 — Python SDK
Python
The package is not published. The install command below is the one it will use, and it fails today because no distribution exists under that name.
pip install falak-sdk # no distribution exists under this name yet
from falak import Falak
client = Falak(api_key="flk_test_PLACEHOLDER") # no key is issued
experiment = client.experiments.create(
question="Does spaced practice beat massed practice?",
design="between_subjects",
arms=2,
)
print(experiment.id) # exp_… once the API exists
Reading this code does not imply the SDK exists. It does not: the import would fail.
05 — JavaScript SDK
JavaScript
Same interface, same state. The package name is reserved for the shape below; nothing is published to the registry.
npm install @falak/sdk # nothing is published under this name yet
import { Falak } from "@falak/sdk";
const falak = new Falak({ apiKey: "flk_test_PLACEHOLDER" });
const experiment = await falak.experiments.create({
question: "Does spaced practice beat massed practice?",
design: "between_subjects",
arms: 2,
});
console.log(experiment.id); // exp_… once the API exists
06 — Authentication
Keys, scopes, and why you cannot get one.
Authentication is a bearer key with scopes. There are no keys to issue because there is no service to authenticate against: the portal cannot mint one, and none is shown anywhere as if it were real. flk_test_PLACEHOLDER is a placeholder string, not a credential.
| Scope | Grants | Issued today |
|---|---|---|
| experiments:write | Create experiments and start runs | no keys |
| experiments:read | Read experiments, runs and results | no keys |
| evidence:read | Read evidence bundles and hashes | no keys |
| webhooks:write | Register and rotate webhook endpoints | no keys |
Authorization: Bearer flk_test_PLACEHOLDER
Content-Type: application/json
Falak-Version: 2026-12-01
Keys will be scoped and rotatable. A key sent with a scope the endpoint does not need is rejected, not silently accepted.
07 — Webhooks
Webhooks
Events are signed with HMAC-SHA256 over the raw body. The verification code below is real code and would work against a real delivery; there are no deliveries today, because no endpoint is registered and nothing is running.
| Event | Fires when | Deliveries today |
|---|---|---|
| experiment.created | A protocol is compiled | none |
| run.started | A run begins | none |
| run.finished | A run ends with results or with a stated failure | none |
| evidence.ready | An evidence bundle is complete | none |
import hashlib, hmac
def verify(payload: bytes, signature: str, secret: str) -> bool:
expected = hmac.new(secret.encode(), payload, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, signature)
Verify before parsing. A payload that fails this check is not a FALAK event, whatever its body says.
08 — Experiment endpoints
Experiments and runs
Request and response examples, in the shape the API will use. The response carries "simulated": true because it was produced here, not by a service.
run = client.experiments.run(
experiment_id="exp_01J8Z9K2",
seed=4192,
)
print(run.status) # queued | running | finished | failed
const run = await falak.experiments.run({
experimentId: "exp_01J8Z9K2",
seed: 4192,
});
console.log(run.status);
curl -X POST https://api.falak.dev/v1/experiments/exp_01J8Z9K2/runs \
-H "Authorization: Bearer $FALAK_KEY" \
-H "Content-Type: application/json" \
-d '{"seed":4192}'
{
"id": "run_01J8ZA31",
"object": "run",
"experiment_id": "exp_01J8Z9K2",
"status": "finished",
"seed": 4192,
"analysed": 180,
"planned": 180,
"verified": false,
"simulated": true
}
"verified": false is part of the shape, not an oversight: a run finishing is not a result being verified.
09 — Evidence endpoints
Evidence
An evidence bundle is what lets someone else check the work: the protocol as signed, the dataset hash, the analysis output and the reviewer sign-off. A bundle with a missing part reports that part as missing.
{
"id": "evd_01J8ZB77",
"object": "evidence_bundle",
"experiment_id": "exp_01J8Z9K2",
"items": [
{"kind": "protocol", "status": "present", "sha256": "9f2c…a41e"},
{"kind": "dataset", "status": "present", "sha256": "31b7…0cd2"},
{"kind": "analysis", "status": "missing", "sha256": null},
{"kind": "sign_off", "status": "missing", "sha256": null}
],
"complete": false,
"simulated": true
}
"complete": false is the honest answer for a bundle with missing parts. It is not an error; it is the state of the evidence.
10 — Rate limits
Rate limits
Limits are set per key and per endpoint class. None is enforced today, because nothing is serving requests. The numbers below are the planned ceilings, published now so they are not a surprise later.
| Class | Planned limit | Burst | Enforced today |
|---|---|---|---|
| Read endpoints | 600 / min | 60 | not enforced |
| Write endpoints | 60 / min | 10 | not enforced |
| Run starts | 20 / min | 5 | not enforced |
| Evidence downloads | 10 / min | 2 | not enforced |
A rate-limited response will carry 429 with Retry-After. No client has received one, because no client has reached a server.
11 — Error codes
Error codes
These are the codes the API will return, with what each one means. They are documented, not observed: no endpoint is live, so no code has been returned to anyone.
| Code | Name | Means |
|---|---|---|
| 400 | invalid_request | The body is malformed or a required field is missing. |
| 401 | missing_key | No key, or a key that does not parse. |
| 403 | scope_denied | The key is valid but lacks the scope for this endpoint. |
| 404 | not_found | No object with that id, in this account. |
| 409 | protocol_locked | The protocol is locked and cannot be edited after a run starts. |
| 422 | unprocessable | The request is well formed but the design cannot be compiled as stated. |
| 429 | rate_limited | Limit reached. Wait for Retry-After. |
| 500 | internal | FALAK failed. Retry with backoff; the run id is in the body. |
12 — API changelog
Changelog
There are no API releases, so this is a design record rather than a version history. It is kept here so the interface decisions have dates.
-
2026-12-06
Developer portal published
Documentation, endpoint shapes, SDK interfaces, error codes and planned limits published. No API released, no keys issued, no endpoint live.
-
2026-11-28
Endpoint shapes fixed
/v1/experimentsand/v1/evidenceshapes settled, including the rule that a run finishing never implies verification. -
2026-11-14
Error code list fixed
Codes and names settled so client error handling can be written against them.
When a release exists, entries will carry a version and a date, and breaking changes will get their own entry before they ship.