SDKs and Client Libraries
Teamday integration options: OpenAPI, REST, generated TypeScript and Python clients, Server-Sent Events, MCP, and the official CLI.
SDKs and Client Libraries
Teamday's primary integration contract is the machine-readable OpenAPI spec:
https://app.teamday.ai/api/openapi.jsonUse the spec with generated clients or with the small official recipes below. The same examples are also exposed as machine-readable JSON:
https://app.teamday.ai/api/sdk-examplesInteractive reference:
https://app.teamday.ai/api/referenceIntegration Options
| Option | Status | Best for |
|---|---|---|
| OpenAPI 3.1 | Production | Generating typed clients and tool schemas |
| TypeScript generated client | Production recipe | Browser, Node, Bun, and edge workers |
| Python generated client | Production recipe | Agent runners, backend jobs, and notebooks |
| REST API | Production | Server-side integrations and automation |
| Server-Sent Events | Production | Streaming chat and job output |
| MCP Streamable HTTP | Production | Tool-using agents and MCP clients |
| Teamday CLI | Production | Local operator agents, setup, smoke tests, and admin workflows |
Generate A Client
Use any OpenAPI generator that supports OpenAPI 3.1:
curl -o teamday-openapi.json https://app.teamday.ai/api/openapi.json
npx openapi-typescript teamday-openapi.json -o teamday-api.d.ts
npx @openapitools/openapi-generator-cli generate \
-g typescript-fetch \
-i teamday-openapi.json \
-o ./teamday-typescript
openapi-generator-cli generate \
-g python \
-i teamday-openapi.json \
-o ./teamday-pythonThe generated clients target the same production contract as the app. There is no private docs surface required for an agent to generate and validate an integration.
Minimal TypeScript Client
const TEAMDAY_BASE_URL = "https://app.teamday.ai"
async function teamday(path: string, init: RequestInit = {}) {
const response = await fetch(`${TEAMDAY_BASE_URL}${path}`, {
...init,
headers: {
Authorization: `Bearer ${process.env.TEAMDAY_TOKEN}`,
"Content-Type": "application/json",
...init.headers,
},
})
if (!response.ok) {
const requestId = response.headers.get("x-request-id")
const body = await response.json().catch(() => ({}))
throw new Error(`${response.status} ${body.code ?? body.error ?? "request_failed"} request=${requestId}`)
}
return response.json()
}
const agents = await teamday("/api/agents")Minimal Python Client
import os
import uuid
import httpx
client = httpx.Client(
base_url="https://app.teamday.ai",
headers={
"Authorization": f"Bearer {os.environ['TEAMDAY_TOKEN']}",
"Content-Type": "application/json",
},
)
response = client.post(
"/api/chats",
headers={"Idempotency-Key": str(uuid.uuid4())},
json={"agent_id": agent_id, "workspace_id": workspace_id},
)
response.raise_for_status()
chat = response.json()Streaming Client
For long-running work, open the event stream for the chat or job:
const stream = await fetch(`${TEAMDAY_BASE_URL}/api/jobs/${jobId}/events`, {
headers: { Authorization: `Bearer ${process.env.TEAMDAY_TOKEN}` },
})
if (!stream.ok || !stream.body) throw new Error(`stream failed ${stream.status}`)
for await (const chunk of stream.body) {
process.stdout.write(Buffer.from(chunk).toString("utf8"))
}Webhook Verification
Webhook receivers should verify Teamday-Signature, dedupe on Teamday-Event-Id, and treat Idempotency-Key as the delivery key.
import { createHmac, timingSafeEqual } from "node:crypto"
function verifyTeamdayWebhook(rawBody: string, signature: string, secret: string) {
const parts = Object.fromEntries(signature.split(",").map((part) => part.split("=")))
const expected = createHmac("sha256", secret)
.update(`${parts.t}.${rawBody}`)
.digest("hex")
return timingSafeEqual(Buffer.from(parts.v1, "hex"), Buffer.from(expected, "hex"))
}Sandbox And Production Parity
Teamday deployments expose the same OpenAPI contract, auth scheme, SSE events, webhook signing, idempotency behavior, and rate-limit headers. Use the deployment base URL as the only environment variable:
export TEAMDAY_BASE_URL="https://app.teamday.ai"
export TEAMDAY_TOKEN="<teamday-service-token>"
curl -fsS "$TEAMDAY_BASE_URL/api/agent-readiness" \
-H "Authorization: Bearer $TEAMDAY_TOKEN"CLI
Install and use the Teamday CLI for local agent setup and operational checks:
teamday whoami
teamday agents list
teamday chat <agent-id> "Summarize the current workspace."
teamday jobs events <job-id>The CLI uses the same API primitives as the app: service-token auth, durable chats, jobs, missions, workspace files, and SSE streams.