Developers / API

One order object, one gate model, one audit trail.

The platform API exposes the same objects the portals use. Buyer endpoints authenticate with a session; operator endpoints require an explicit bearer token and are default-deny.

Base URL https://mades.ai

Authentication

Buyer and supplier calls use the Logto session cookie issued at /api/auth/signin. Operator calls use Authorization: Bearer <MADES_PLATFORM_OPS_TOKEN> and are additionally restricted to an explicit user allow-list. Missing or invalid credentials return 401; valid credentials with an invalid payload return 422.

Endpoints

Only routes that exist in production are listed. There is no public write API for partners yet.

GET/api/healthLiveness and build revision. No auth required.
GET/api/auth/sessionCurrent session user, plan and tenant context.
GET/api/projectsList buyer projects for the signed-in account.
POST/api/projectsCreate a project from an intake payload.
GET/api/projects/{id}Project detail with stage, gate and documents.
POST/api/projects/{id}/documentsUpload a document; idempotent on client key.
GET/api/documents/{id}/downloadStream a stored document.
POST/api/projects/{id}/quote/{action}Accept or reject the released quote.
POST/api/platform/ops/projects/{id}/quoteOps: create a quote version. Bearer token.
POST/api/platform/ops/projects/{id}/orderOps: create an order from an approved quote.
POST/api/platform/ops/orders/{id}/gates/{code}Ops: release a G0–G7 gate; out-of-order returns 409.
GET/api/auditAudit events for the signed-in tenant.

Idempotency

Write endpoints accept an Idempotency-Key header. A repeated key returns the original result instead of creating a second record; concurrent duplicate requests are serialised by an atomic lease.