Skip to content

// Developer / API reference

REST + MCP. 285 endpoints.

Every action in Spaceflow is reachable as a typed endpoint. Bring any client. Authenticate once. The rest is conventional.

// Quickstart

From zero to a first agent invocation.

Get a token from your workspace settings. Hit the API with it. Stream the response. Three minutes if you have curl in your terminal.

  • Tokens are short-lived (60s) and refreshed by the SDK.
  • All endpoints are idempotent under a client-supplied key.
  • Responses are streamed by default. Toggle off with stream:false.

quickstart.sh

bash

1# 1. Exchange your workspace key for a session token
2curl https://api.spaceflow.tech/v1/auth/token \
3 -H "Authorization: Bearer $SF_WORKSPACE_KEY"
4
5# 2. Invoke an agent
6curl https://api.spaceflow.tech/v1/agents.invoke \
7 -H "Authorization: Bearer $SF_TOKEN" \
8 -H "Content-Type: application/json" \
9 -d '{ "agent":"procurement.compare", "input":{"rfqId":"RFQ-2847"} }'
10
11# 3. Stream the events
12curl -N https://api.spaceflow.tech/v1/agents/$SESSION/events \
13 -H "Authorization: Bearer $SF_TOKEN"

Endpoints · v1

The endpoints you'll use most.

  • POST/v1/agents.invoke

    Run an agent against an input. Returns a session id + first event stream.

  • GET/v1/agents/{id}/events

    Server-sent event stream of an in-progress or completed agent session.

  • POST/v1/procurement.quote.compare

    Compare quotes for an RFQ. Returns ranked list with citations.

  • POST/v1/procurement.po.create

    Create a PO in the user's ERP. Honors existing approval chains.

  • POST/v1/procurement.po.amend

    Amend an existing PO. Same approval routing as create.

  • GET/v1/suppliers/{id}

    Supplier master record + 14-day lead-time and OTIF rolling window.

  • POST/v1/knowledge.recall

    Semantic + structured query against the Knowledge Hub. Returns sources.

  • GET/v1/audit/events

    Audit log query. Filter by actor, principal, action, time range.

Plus many more. Full reference and OpenAPI spec available with a workspace.

// MCP client

Same endpoints. As MCP tools.

Point any MCP-capable client at the gateway. Your agent gets the full Spaceflow tool catalog. Authentication carries the user identity downstream.

  • Tools surfaced match the user's actual entitlements in the source system.
  • All tool invocations are logged in the audit chain.
  • Sampling, prompts, and resources are all supported.

mcp.ts

typescript

1import { Client } from "@modelcontextprotocol/sdk/client";
2
3const sf = new Client({ name: "my-agent", version: "1.0.0" });
4await sf.connect({
5 transport: { kind: "sse", url: "https://mcp.spaceflow.tech" },
6 auth: { kind: "bearer", token: process.env.SF_TOKEN! },
7});
8
9const tools = await sf.listTools();
10// → 285 typed tools, scoped to the calling user's permissions

Want a workspace key?

Talk to us. We provision sandbox keys for evaluation in under an hour.

Request access