Endpoints
All endpoints live on https://clex.in, return JSON, and accept JSON request bodies. CORS is open. No keys required for the public surface.
Create a new transfer session. Returns a transfer_id, a 6-character code, and the canonical receive_url.
Request body (all fields optional)
{
"ttl_seconds": 86400, // 60 .. 604800; default 86400 (24h)
"file_name": "design.zip", // optional metadata for the receiver UI
"file_size_bytes": 4823491, // optional, for progress UI
"file_mime": "application/zip",
"client_label": "clex CLI v1.2"
}
Response 200
{
"transfer_id": "f4a3e9b1c8…",
"code": "X7K92Q",
"receive_url": "https://clex.in/receive?code=X7K92Q",
"status": "created",
"expires_at": 1762542901,
"created_at": 1762456501
}
GET
/api/transfers/<id_or_code>
Read the current state of a transfer. Pass either the transfer_id or the 6-character code.
Response 200
{
"transfer_id": "f4a3e9b1c8…",
"code": "X7K92Q",
"receive_url": "https://clex.in/receive?code=X7K92Q",
"status": "connected",
"route": "p2p",
"file_name": "design.zip",
"file_size_bytes": 4823491,
"file_mime": "application/zip",
"events": [
{ "type": "created", "ts": 1762456501 },
{ "type": "connected", "ts": 1762456538, "details": { "peer": "browser" } }
],
"expires_at": 1762542901,
"created_at": 1762456501
}
POST
/api/transfers/<id_or_code>/events
Append a lifecycle event. Useful from a CLI or browser client for keeping the public chain ledger honest.
Request body
{
"type": "completed", // created | connected | completed | cancelled | expired | error
"details": { "bytes_sent": 4823491, "duration_ms": 9421 }
}
Response 200
{ "ok": true, "status": "completed" }
DELETE
/api/transfers/<id_or_code>
Cancel a transfer that hasn't completed yet. Already-completed transfers stay marked completed and are not retroactively erased from the chain ledger.
Response 200
{ "ok": true, "status": "cancelled" }
Public liveness probe. Used by status pages and the lnch.in registry. Cacheable.
Response 200
{
"ok": true,
"service": "clex-api",
"ts": 1762456501,
"version": "phase-2-admin-api"
}