API Examples
Current Teamday API examples for generated OpenAPI clients, chat streaming, webhooks, and long-running jobs.
API Examples
Generate Types
curl -o teamday-openapi.json https://app.teamday.ai/api/openapi.json
npx openapi-typescript teamday-openapi.json -o teamday-api.d.tsList Agents
curl https://app.teamday.ai/api/agents \
-H "Authorization: Bearer $TEAMDAY_TOKEN"Send A Chat Message
Open the stream:
curl -N https://app.teamday.ai/api/chats/$CHAT_ID/events \
-H "Authorization: Bearer $TEAMDAY_TOKEN"Send the message:
curl -X POST https://app.teamday.ai/api/chats/$CHAT_ID/messages \
-H "Authorization: Bearer $TEAMDAY_TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: msg-$(uuidgen)" \
-d '{"content":"Review the current workspace and summarize open risks."}'Watch A Job
curl https://app.teamday.ai/api/jobs/$JOB_ID \
-H "Authorization: Bearer $TEAMDAY_TOKEN"
curl -N https://app.teamday.ai/api/jobs/$JOB_ID/events \
-H "Authorization: Bearer $TEAMDAY_TOKEN"Configure A Webhook
curl -X PUT https://app.teamday.ai/api/messaging-integration \
-H "Authorization: Bearer $TEAMDAY_TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: webhook-config-$(uuidgen)" \
-d '{"provider":"webhook","name":"Production event bus","url":"https://example.com/teamday/webhook","enabled":true}'