OrbitSpaceDocs
Build integrations

API, SDK and event streams

Use the versioned HTTP API and TypeScript SDK for application access, and resumable event streams for execution progress.

Endpoints and errors

The hosted API origin is https://api.orbitspace.dev; resource endpoints use /api/v1. Supply a scoped Bearer credential and the tenant header when required by that credential type. API errors use Problem Details; keep the request ID when reporting a failure.

Common read endpoints include:

ResourceEndpoint
TaskGET /api/v1/tasks/{id}
InvocationGET /api/v1/invocations/{id}
Agent servicesGET /api/v1/agent-deployments
Token issuance policyGET /api/v1/api-token-policy

Only request resources your identity can access. Scope names and policy bindings are part of authorization, not optional client-side hints.

TypeScript client

The @orbitspace/sdk package exposes generated operations and OrbitSpaceClient. Use the SDK version approved for your deployment. Run confidential-token examples on a backend, not in a public browser bundle.

typescript
import { OrbitSpaceClient, taskServiceGetTask } from "@orbitspace/sdk";

const orbitspace = new OrbitSpaceClient({
  baseUrl: "https://api.orbitspace.dev",
  token: () => process.env.ORBITSPACE_API_TOKEN,
  headers: { "X-OrbitSpace-Tenant": process.env.ORBITSPACE_TENANT_ID ?? "" },
});

const result = await taskServiceGetTask({
  client: orbitspace.transport,
  path: { id: "TASK_ID" },
  throwOnError: true,
});
console.log(result.data);

Goal Experience

Create a Goal Experience with POST /api/v1/goal-experiences when your product needs a durable multi-iteration outcome. Prepare its workspace and pinned workflow first. Use the returned projection, event stream and deep link rather than hardcoding internal Console routes.

The SDK's watchGoalExperience() and goalExperienceDeepLink() helpers consume that response. Required workflow and Agent bindings must exist before execution begins. Goal Experience uses tasks:read and tasks:write; add approval or artifact scopes only when the product needs those capabilities.

Execution streams

Task, Workflow, Goal and Invocation streams carry execution events. Retain event IDs and send Last-Event-ID when reconnecting. Cancel the stream when the user leaves the view or the credential changes.

bash
curl --no-buffer --fail-with-body \
  "https://api.orbitspace.dev/api/v1/invocations/$INVOCATION_ID/events" \
  -H "Authorization: Bearer $ORBITSPACE_ACCESS_TOKEN" \
  -H 'Accept: text/event-stream'

Page notifications are different

The Control Plane stream at /api/v1/events?topics=tasks,approvals delivers authorized page invalidations and Runtime updates. Load initial API data first, subscribe only to current-page topics, and release the connection on navigation. On reconnect, reconcile with API state.

Page notifications are not a durable business-event ledger. Use resource execution streams or application Webhooks when your product must follow an individual execution. Never connect a browser directly to the platform's internal message broker.