{"openapi":"3.1.0","info":{"title":"NotesBot API","version":"1.0.0","description":"Programmatic access to your NotesBot call recordings, transcripts, and summaries.\n\n## Authentication\n\nAll `/v1/*` endpoints require a Bearer token. Generate an API key from your [dashboard](https://notesbot.io/dashboard/api-keys).\n\n```\nAuthorization: Bearer nb_your_api_key_here\n```\n\n## Permissions & Access Scope\n\n- **Personal keys**: one per Discord account. A personal key returns the calls billed to you that are not team calls, plus team calls you spoke in.\n- **Team keys**: created on the team's dashboard page by a server admin or a team manager (anyone who can manage messages in the team's notes channel), once the team shows its calls on the dashboard. A team key returns that team's calls (except calls marked private), whoever's plan recorded them: the same calls the team's notes-channel readers can open on the dashboard. Calls moved out of the team disappear from it; calls moved in appear. While the team is not shown on the dashboard (its \"Show these calls on the dashboard\" box is unticked), or after the team is deleted, team keys answer `401` with code `key_inactive`.\n- **Read-only** — the API provides read access to call data. Creating, deleting, or modifying calls is not supported. Use the Discord bot for recording and the dashboard for management.\n- **No audio downloads** — call metadata, summaries, and transcripts are available. Audio file downloads are not exposed through the API.\n\n## Rate Limiting\n\nAll endpoints are rate-limited to **60 requests per minute** per API key. Rate limits are the same regardless of subscription plan.\n\nEvery response includes rate limit headers:\n- `X-RateLimit-Limit` — max requests per window (60)\n- `X-RateLimit-Remaining` — requests left in current window\n- `X-RateLimit-Reset` — Unix timestamp when the window resets\n\nWhen exceeded, the API returns `429 Too Many Requests` with a `Retry-After` header.\n\n## Key Management\n\n- **Generate** a key from [notesbot.io/dashboard/api-keys](https://notesbot.io/dashboard/api-keys)\n- **Regenerate** replaces your current key immediately — the old key stops working instantly\n- **Revoke** permanently disables your key with immediate effect\n- Keys are displayed **once** at creation. Store them securely — they cannot be retrieved later.","contact":{"name":"NotesBot Support","url":"https://notesbot.io"}},"servers":[{"url":"https://api.notesbot.io","description":"Production"},{"url":"http://localhost:4000","description":"Local development"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"API key with nb_ prefix. Generate from dashboard at https://notesbot.io/dashboard/api-keys"}},"schemas":{"CallListItem":{"type":"object","properties":{"id":{"type":"string","description":"Unique call identifier","example":"507f1f77bcf86cd799439011"},"summary":{"type":"string","description":"AI-generated meeting summary"},"server_name":{"type":"string","description":"Discord server name","example":"My Team"},"server_id":{"type":"string","description":"Discord server (guild) ID","example":"123456789012345678"},"channel_name":{"type":"string","description":"Discord voice channel name","example":"General"},"channel_id":{"type":"string","description":"Discord voice channel ID","example":"987654321098765432"},"duration":{"type":"integer","description":"Call duration in seconds","example":1800},"participant_count":{"type":"integer","description":"Number of participants","example":4},"created_at":{"type":"string","format":"date-time","description":"ISO 8601 timestamp of when the call was recorded","example":"2025-01-15T14:30:00Z"},"team":{"oneOf":[{"$ref":"#/components/schemas/TeamRef"},{"type":"null"}],"description":"The team that owns this call, or null for a personal call"}},"required":["id","summary","server_name","server_id","channel_name","channel_id","duration","participant_count","created_at","team"]},"TeamRef":{"type":"object","properties":{"id":{"type":"string","description":"Team identifier","example":"66f1c0ffee0ddba11a5e0001"},"name":{"type":["string","null"],"description":"Team name","example":"Design"}},"required":["id","name"]},"CallDetail":{"type":"object","description":"Full call detail including transcript and participants","allOf":[{"$ref":"#/components/schemas/CallListItem"},{"type":"object","properties":{"transcript":{"type":"string","description":"Full conversation transcript with speaker labels"},"participants":{"type":"array","description":"List of call participants","items":{"type":"object","properties":{"display_name":{"type":"string","description":"Discord display name","example":"Alice"},"username":{"type":"string","description":"Discord username","example":"alice#1234"}},"required":["display_name","username"]}}},"required":["transcript","participants"]}]},"PaginationMeta":{"type":"object","properties":{"total_count":{"type":"integer","description":"Total number of matching records","example":42},"page":{"type":"integer","description":"Current page number (1-based)","example":1},"per_page":{"type":"integer","description":"Items per page","example":20},"total_pages":{"type":"integer","description":"Total number of pages","example":3}},"required":["total_count","page","per_page","total_pages"]},"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable error code","example":"not_found"},"message":{"type":"string","description":"Human-readable error message","example":"Resource not found"},"status":{"type":"integer","description":"HTTP status code","example":404}},"required":["code","message","status"]}},"required":["error"]},"HealthResponse":{"type":"object","properties":{"status":{"type":"string","description":"Service status","enum":["ok"],"example":"ok"},"mongo":{"type":"string","description":"MongoDB connectivity","enum":["connected","disconnected"],"example":"connected"},"redis":{"type":"string","description":"Redis connectivity","enum":["connected","disconnected","not_configured"],"example":"connected"}},"required":["status","mongo","redis"]}}},"paths":{"/health":{"get":{"tags":["Health"],"summary":"Health check","description":"Returns service health status including MongoDB and Redis connectivity. Always returns 200.","security":[],"responses":{"200":{"description":"Service health status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}}}}},"/ready":{"get":{"tags":["Health"],"summary":"Readiness check","description":"Returns 200 when the service is ready to accept traffic (MongoDB connected). Returns 503 when not ready.","security":[],"responses":{"200":{"description":"Service is ready","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ready"],"example":"ready"}}}}}},"503":{"description":"Service is not ready","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["not_ready"],"example":"not_ready"},"reason":{"type":"string","example":"mongodb_unavailable"}}}}}}}}},"/v1/calls":{"get":{"tags":["Calls"],"summary":"List calls","description":"Returns a paginated list of your call recordings. Supports filtering by server, channel, date range, and full-text search. Returns only the calls the key's scope allows (see Permissions & Access Scope).","parameters":[{"name":"page","in":"query","description":"Page number (1-based)","required":false,"schema":{"type":"integer","default":1,"minimum":1}},{"name":"per_page","in":"query","description":"Number of items per page","required":false,"schema":{"type":"integer","default":20,"minimum":1,"maximum":100}},{"name":"server_id","in":"query","description":"Filter by Discord server (guild) ID","required":false,"schema":{"type":"string"}},{"name":"channel_id","in":"query","description":"Filter by Discord voice channel ID","required":false,"schema":{"type":"string"}},{"name":"from","in":"query","description":"Filter calls created on or after this ISO 8601 datetime","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","description":"Filter calls created on or before this ISO 8601 datetime","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"q","in":"query","description":"Full-text search across call summaries","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Paginated list of calls","headers":{"X-RateLimit-Limit":{"description":"Maximum number of requests allowed in the current window","schema":{"type":"integer","example":60}},"X-RateLimit-Remaining":{"description":"Number of requests remaining in the current window","schema":{"type":"integer","example":58}},"X-RateLimit-Reset":{"description":"Unix timestamp (seconds) when the rate limit window resets","schema":{"type":"integer","example":1700000000}}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CallListItem"}},"pagination":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","pagination"]}}}},"400":{"description":"Invalid query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing, invalid or revoked key (code unauthorized), or an inactive team key: the team is not shown on the dashboard (or was deleted) (code key_inactive)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/calls/{id}":{"get":{"tags":["Calls"],"summary":"Get call detail","description":"Returns full details for a single call including transcript and participant list. Returns 404 for calls outside the key's scope.","parameters":[{"name":"id","in":"path","description":"Call ID","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Call detail","headers":{"X-RateLimit-Limit":{"description":"Maximum number of requests allowed in the current window","schema":{"type":"integer","example":60}},"X-RateLimit-Remaining":{"description":"Number of requests remaining in the current window","schema":{"type":"integer","example":58}},"X-RateLimit-Reset":{"description":"Unix timestamp (seconds) when the rate limit window resets","schema":{"type":"integer","example":1700000000}}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CallDetail"}},"required":["data"]}}}},"401":{"description":"Missing, invalid or revoked key (code unauthorized), or an inactive team key: the team is not shown on the dashboard (or was deleted) (code key_inactive)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Call not found or outside the key scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"tags":[{"name":"Health","description":"Service health and readiness checks"},{"name":"Calls","description":"Call recordings, transcripts, and summaries"}]}