# Teamday API Documentation

Machine-readable Teamday API contract for agents, files and folders, chats, jobs, missions, MCP, events, idempotency, and rate limits.

Teamday exposes an agent-ready API for durable work: agents, chats, jobs, missions, files and folders, MCP tools, and long-running execution status.

Use the machine-readable contract first when building an integration:

| Resource | URL |
|---|---|
| OpenAPI 3.1 spec | `https://app.teamday.ai/api/openapi.json` |
| Interactive API reference | `https://app.teamday.ai/api/reference` |
| Agent-readiness manifest | `https://app.teamday.ai/api/agent-readiness` |
| Well-known agent manifest | `https://app.teamday.ai/.well-known/teamday-agent-api` |
| SDK and client examples | `https://app.teamday.ai/api/sdk-examples` |
| Versioning and deprecation policy | `https://app.teamday.ai/api/deprecation-policy` |
| Rate-limit policy | `https://app.teamday.ai/api/rate-limits` |
| OAuth authorization server metadata | `https://app.teamday.ai/.well-known/oauth-authorization-server` |
| OAuth protected resource metadata | `https://mcp.teamday.ai/.well-known/oauth-protected-resource` |
| OAuth protected resource metadata for `/mcp` | `https://mcp.teamday.ai/.well-known/oauth-protected-resource/mcp` |

The public docs are also emitted for LLM ingestion:

| Resource | URL |
|---|---|
| Documentation index | `https://docs.teamday.ai/llms.txt` |
| Full docs body | `https://docs.teamday.ai/llms-full.txt` |
| Page Markdown | `https://docs.teamday.ai/api.md` |

## Agent-Ready Guarantees

Teamday's API contract is designed around agent automation:

- **Scoped service-token auth** for server-side automation and browser-session auth for the app.
- **OAuth 2.1 metadata** for MCP clients, with PKCE, dynamic client registration, and the `mcp` scope.
- **Server-Sent Events** for live chat and job output: `/api/chats/{id}/events` and `/api/jobs/{id}/events`.
- **Webhook event delivery** for durable work state changes and successful JSON API mutations, with event subscriptions, stable event IDs, `Teamday-Signature` HMAC-SHA256 verification, delivery attempts, retry backoff, and owner-initiated redelivery from the durable ledger.
- **Replay on stream connect** so clients can reconnect without losing the latest chat or job events.
- **Request IDs** through `X-Request-Id` for support and log correlation.
- **Rate-limit transparency** through `X-RateLimit-*`, standard `RateLimit-*`, and `Retry-After` headers.
- **Machine-readable rate-limit policy** at `/api/rate-limits`, including identity order, burst behavior, retry examples, and enterprise tier semantics.
- **Idempotency keys** on mutating JSON API requests so agents can retry safely after network failures.
- **Long-running jobs** with explicit status endpoints and review/approve/cancel/resume actions.
- **Generated-client recipes and thin SDK source** for TypeScript, Python, SSE streaming, and webhook verification at `/api/sdk-examples`, `/api/sdk/typescript`, and `/api/sdk/python`.
- **Versioning and deprecation policy** with date-based versions, 180-day deprecation notice, and 365-day sunset notice.

- [Authentication](https://docs.teamday.ai/api/authentication)
- [Endpoints](https://docs.teamday.ai/api/endpoints)
- [Error Reference](https://docs.teamday.ai/api/errors)
- [Best Practices](https://docs.teamday.ai/api/best-practices)

> For service-specific APIs, see Newsletter API (omitted from the agent-safe bundle). For general guides, see the [Guides](https://docs.teamday.ai/guides) section.
