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.

Status
  • 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.

  1. Create the experimentQuestion, design and arms. The response carries a draft protocol, not a result.
  2. 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.
  3. Read results and evidenceEstimates arrive with intervals and the criteria state. The evidence bundle holds the raw files and their hashes.
There is no key to get yet.

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.

quickstart.sh documented shape · not executable
# 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.

MethodPathPurposeState
POST/v1/experimentsCreate an experiment from a questionnot live
GET/v1/experiments/{id}Read an experiment and its protocolnot live
POST/v1/experiments/{id}/runsStart a runnot live
GET/v1/experiments/{id}/resultsRead estimates, intervals and criteria statenot live
GET/v1/evidence/{id}Read an evidence bundle and its hashesnot live
POST/v1/webhooksRegister a webhook endpointnot 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.

SIMULATION · nothing sent

Request body (edited locally)

The body is documentation. Editing it changes only the simulated response below.

Simulated response — not run yet

response.json synthetic
{
  "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.

terminal package not published
pip install falak-sdk   # no distribution exists under this name yet
create_experiment.py documented shape
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.

terminal package not published
npm install @falak/sdk   # nothing is published under this name yet
create-experiment.mjs documented shape
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.

ScopeGrantsIssued today
experiments:writeCreate experiments and start runsno keys
experiments:readRead experiments, runs and resultsno keys
evidence:readRead evidence bundles and hashesno keys
webhooks:writeRegister and rotate webhook endpointsno keys
headers.http placeholder key
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.

EventFires whenDeliveries today
experiment.createdA protocol is compilednone
run.startedA run beginsnone
run.finishedA run ends with results or with a stated failurenone
evidence.readyAn evidence bundle is completenone
verify_signature.py real algorithm · no deliveries
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_experiment.pydocumented shape
run = client.experiments.run(
    experiment_id="exp_01J8Z9K2",
    seed=4192,
)
print(run.status)     # queued | running | finished | failed
run.jsonsynthetic response
{
  "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.

evidence.jsonsynthetic response
{
  "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.

ClassPlanned limitBurstEnforced today
Read endpoints600 / min60not enforced
Write endpoints60 / min10not enforced
Run starts20 / min5not enforced
Evidence downloads10 / min2not 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.

CodeNameMeans
400invalid_requestThe body is malformed or a required field is missing.
401missing_keyNo key, or a key that does not parse.
403scope_deniedThe key is valid but lacks the scope for this endpoint.
404not_foundNo object with that id, in this account.
409protocol_lockedThe protocol is locked and cannot be edited after a run starts.
422unprocessableThe request is well formed but the design cannot be compiled as stated.
429rate_limitedLimit reached. Wait for Retry-After.
500internalFALAK 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/experiments and /v1/evidence shapes 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.