{"openapi":"3.1.0","info":{"title":"waper API","version":"1.0.0","summary":"Spaces, watches, briefs, library, documents, media and your agent over HTTP.","description":"The waper API gives you the same spaces, watches, briefs, library, documents, media and agent as the web app. Desktop, iOS and other agents use it too.\n\n## Authentication\n\nSend `Authorization: Bearer <token>` with every request. The token is a personal API key (`wpr_…`, create one in Settings → API and MCP) or a session token from signing in (response header `set-auth-token`). Cookies are not accepted. This document itself needs no token.\n\n## Conventions\n\n- **Rate limit**: at most 60 requests per minute per account; beyond that you get 429 `RATE_LIMITED`.\n- **Errors** are JSON: `{\"error\": {\"code\": \"WATCH_NOT_FOUND\", \"message\": \"…\"}}`. `code` is stable, branch on it; `message` is for people. Invalid input returns 400 `INVALID_INPUT` with `issues` (`path` and `message` for each problem).\n- **Pagination**: lists return `{\"items\": […], \"nextCursor\": \"…\"}`. Pass `nextCursor` as `?cursor=` for the next page; `null` means there are no more. Cursors are opaque.\n- **Idempotency**: create endpoints accept an `Idempotency-Key` header (any unique string, such as a UUID). Retrying with the same key within 24 hours returns the first result (response header `idempotent-replayed: true`) instead of doing the work twice.\n- **Time**: `date-time` fields are ISO 8601 strings; fields described as Unix time are milliseconds.\n- **Language**: calls that write content accept `lang` (`zh` or `en`); without it, your content language setting is used. Content comes in one language, never side by side.\n- **Credits**: reading is free. Calls that make waper read or write for you (messages to your agent, summaries of saved links and files, media transcripts) spend credits; creating a watch counts toward your monthly watch limit. When credits run out you get 402 `CREDITS_EXHAUSTED`; `GET /me` shows what you have left.\n- **Compatibility**: new fields can appear in any response, so ignore fields you do not know. Removing or renaming a field, an endpoint or an `operationId` is a breaking change.\n\n## For agents\n\nPrefer MCP (`https://waper.ai/mcp`) when your client supports it: the same capabilities as a small set of tools, described in `https://waper.ai/skill.md`. This API reference is also available as Markdown at `https://docs.waper.ai/openapi.md`."},"externalDocs":{"description":"Guides: API keys, MCP and REST","url":"https://docs.waper.ai/en/dev/api"},"servers":[{"url":"https://waper.ai/api/v1"}],"tags":[{"name":"Account","description":"Your plan, trial, credits by pool and plan limits."},{"name":"Spaces","description":"Spaces hold your watches, library items, documents and conversations. Every account has one default space that cannot be deleted."},{"name":"Watches","description":"A watch keeps following a subject, a set of sources or a few pages, and writes a brief with sources on a schedule. Briefs are made of entries; each entry links to its evidence."},{"name":"Library","description":"Everything you keep: saved web pages, brief entries, uploaded files and video/audio. waper reads each one, writes a summary and key points, and picks a space when you leave it out."},{"name":"Docs","description":"Documents in waper Markdown. Every save bumps `revision`; pass the revision you read so you never overwrite newer changes."},{"name":"Media","description":"YouTube, Bilibili and podcast links turned into timestamped transcripts and summaries. Ask for a quote first: it is charged by the minute."},{"name":"Agent","description":"Your agent's name, memory and email address, and the home overview of what it is doing for you."},{"name":"Inbox","description":"Finished tasks, briefs, alerts and suggestions, plus the actions waiting for your decision."},{"name":"Tasks","description":"Background work the agent runs for you (watch setup, research, transcription, scheduled tasks). Poll a task to follow its milestones."},{"name":"Conversations","description":"Talk to your agent. Sending a message starts a turn and returns at once; read the reply from the conversation's messages."},{"name":"Actions","description":"Changes the agent wants to make that need your approval, and actions it already did that you can undo."}],"security":[{"bearer":[]}],"paths":{"/me":{"get":{"operationId":"getMe","tags":["Account"],"summary":"Who am I: plan, trial and remaining credits by pool","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}}},"/spaces":{"get":{"operationId":"listSpaces","tags":["Spaces"],"summary":"List spaces","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Space"}}},"required":["items"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"createSpace","tags":["Spaces"],"summary":"Create a space","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Any unique string (e.g. a UUID). Retrying with the same key within 24 hours returns the first result instead of creating twice; a different body with the same key returns 422.","schema":{"type":"string","maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSpaceRequest"},"example":{"name":"Robotics","icon":"🤖","description":"Hardware, labs and funding"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Space"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"409":{"$ref":"#/components/responses/IdempotencyInProgress"},"422":{"$ref":"#/components/responses/IdempotencyMismatch"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}}},"/spaces/{id}":{"patch":{"operationId":"updateSpace","tags":["Spaces"],"summary":"Rename, change icon, description or position","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSpaceRequest"}}}},"responses":{"204":{"description":"Done (no content)"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}},"delete":{"operationId":"deleteSpace","tags":["Spaces"],"summary":"Delete a space; its contents move to the default space","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done (no content)"},"400":{"description":"SPACE_NOT_DELETABLE: the default space cannot be deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}}},"/watches":{"get":{"operationId":"listFollowedWatches","tags":["Watches"],"summary":"Watches you follow, with their latest brief","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/FollowedWatch"}}},"required":["items"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"createWatch","tags":["Watches"],"summary":"Create a watch","description":"Starts the agent (topic) or registers your sources/pages, then writes a first brief covering the last 7 days. Follow progress with GET /tasks/{taskId}.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Any unique string (e.g. a UUID). Retrying with the same key within 24 hours returns the first result instead of creating twice; a different body with the same key returns 422.","schema":{"type":"string","maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWatchRequest"},"example":{"intent":"Open-source humanoid robots: new models, papers and funding","lang":"en","cadence":"daily"}}}},"responses":{"202":{"description":"Accepted: the work continues in the background","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WatchCreated"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"EMAIL_NOT_VERIFIED: verify your email before creating watches","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"$ref":"#/components/responses/IdempotencyInProgress"},"422":{"$ref":"#/components/responses/IdempotencyMismatch"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}}},"/watches/search":{"get":{"operationId":"searchWatches","tags":["Watches"],"summary":"Find existing public watches for a subject","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/WatchCard"}}},"required":["items"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}}},"/watches/{slug}":{"get":{"operationId":"getWatch","tags":["Watches"],"summary":"A watch with one brief (latest, or a date), its archive and method","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}},{"name":"date","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"lang","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Locale"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WatchPage"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}}},"/watches/{slug}/knowledge":{"get":{"operationId":"getWatchKnowledge","tags":["Watches"],"summary":"Latest weekly report and the timeline of important items","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Knowledge"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}}},"/watches/{slug}/issues":{"get":{"operationId":"listWatchIssues","tags":["Watches"],"summary":"Past briefs, newest first","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"default":30,"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"description":"nextCursor from the previous page","schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/IssueSummary"}},"nextCursor":{"description":"Pass as ?cursor= to get the next page; null when done","type":["string","null"]}},"required":["items","nextCursor"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}}},"/watches/{slug}/follow":{"put":{"operationId":"followWatch","tags":["Watches"],"summary":"Follow a watch (or move it to another space)","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FollowRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FollowState"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"FOLLOW_LIMIT: your plan follows at most `limits.follows` watches (see GET /me)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}},"delete":{"operationId":"unfollowWatch","tags":["Watches"],"summary":"Unfollow a watch","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done (no content)"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}}},"/watches/{slug}/settings":{"patch":{"operationId":"updateWatchSettings","tags":["Watches"],"summary":"Owner only: brief cadence and alerts","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WatchSettingsRequest"}}}},"responses":{"204":{"description":"Done (no content)"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}}},"/entries/{id}/feedback":{"put":{"operationId":"setEntryFeedback","tags":["Watches"],"summary":"Thumbs up or down on a brief item (null clears)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntryFeedbackRequest"}}}},"responses":{"204":{"description":"Done (no content)"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}}},"/entries/{id}/saved":{"put":{"operationId":"setEntrySaved","tags":["Watches"],"summary":"Save a brief item to the library (or remove it)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntrySavedRequest"}}}},"responses":{"204":{"description":"Done (no content)"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}}},"/library":{"get":{"operationId":"listLibrary","tags":["Library"],"summary":"Saved pages, brief items, uploaded files and saved video/audio, newest first; filter by space or kind, or search","parameters":[{"name":"space","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["entry","link","file","media"]}},{"name":"q","in":"query","required":false,"description":"Search instead of listing (no paging)","schema":{"type":"string","maxLength":200}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"description":"nextCursor from the previous page","schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/LibraryItem"}},"nextCursor":{"description":"Pass as ?cursor= to get the next page; null when done","type":["string","null"]}},"required":["items","nextCursor"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"saveLink","tags":["Library"],"summary":"Save a web page; waper reads it and writes a summary and key points","description":"Video and podcast links return media=true; use POST /media instead.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Any unique string (e.g. a UUID). Retrying with the same key within 24 hours returns the first result instead of creating twice; a different body with the same key returns 422.","schema":{"type":"string","maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveLinkRequest"},"example":{"url":"https://example.com/article","note":"For the Friday review"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkSaved"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"409":{"$ref":"#/components/responses/IdempotencyInProgress"},"422":{"$ref":"#/components/responses/IdempotencyMismatch"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}}},"/library/{id}":{"get":{"operationId":"getLibraryItem","tags":["Library"],"summary":"One library item","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LibraryItem"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"updateLibraryItem","tags":["Library"],"summary":"Change the note or move to another space","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateLibraryItemRequest"}}}},"responses":{"204":{"description":"Done (no content)"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}},"delete":{"operationId":"deleteLibraryItem","tags":["Library"],"summary":"Remove from the library","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done (no content)"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}}},"/library/{id}/text":{"get":{"operationId":"readLibraryText","tags":["Library"],"summary":"Full text extracted from an uploaded file, in chunks","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"type":"integer","minimum":0}},{"name":"limit","in":"query","required":false,"schema":{"default":8000,"type":"integer","minimum":100,"maximum":50000}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LibraryText"}}}},"400":{"description":"NO_TEXT: only uploaded files have stored text, or no text was extracted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}}},"/library/files":{"post":{"operationId":"uploadFile","tags":["Library"],"summary":"Upload a PDF, Word (.docx), Markdown, text or image file to the library","description":"The body is the file itself; put its name in X-File-Name (URL-encoded). waper extracts the text (for an image, a text description), writes a summary and key points, and indexes it. The same file is only added once.","parameters":[{"name":"space","in":"query","required":false,"description":"Leave out to let the agent pick a space from the content","schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"note","in":"query","required":false,"schema":{"type":"string","maxLength":2000}},{"name":"lang","in":"query","required":false,"description":"Content language; defaults to your content language setting","schema":{"$ref":"#/components/schemas/Locale"}}],"requestBody":{"required":true,"description":"The file itself; send its name in the X-File-Name header (URL-encoded).","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileSaved"}}}},"400":{"description":"EMPTY_FILE: send the file as the body with a Content-Length","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"413":{"description":"FILE_TOO_LARGE (over your plan's per-file limit) or STORAGE_FULL","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"UNSUPPORTED_TYPE: the library takes PDF, Word (.docx), Markdown, plain text and images","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}}},"/docs":{"get":{"operationId":"listDocs","tags":["Docs"],"summary":"List documents, most recently updated first (no bodies)","parameters":[{"name":"space","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"limit","in":"query","required":false,"schema":{"default":100,"type":"integer","minimum":1,"maximum":500}},{"name":"cursor","in":"query","required":false,"description":"nextCursor from the previous page","schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/DocSummary"}},"nextCursor":{"description":"Pass as ?cursor= to get the next page; null when done","type":["string","null"]}},"required":["items","nextCursor"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"createDoc","tags":["Docs"],"summary":"Create a document from waper Markdown","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Any unique string (e.g. a UUID). Retrying with the same key within 24 hours returns the first result instead of creating twice; a different body with the same key returns 422.","schema":{"type":"string","maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDocRequest"},"example":{"title":"Reading notes","markdown":"# Reading notes\n\n- First point\n"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocCreated"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"409":{"$ref":"#/components/responses/IdempotencyInProgress"},"422":{"$ref":"#/components/responses/IdempotencyMismatch"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}}},"/docs/search":{"get":{"operationId":"searchDocs","tags":["Docs"],"summary":"Search documents by keywords and meaning","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/DocHit"}}},"required":["items"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}}},"/docs/{id}":{"get":{"operationId":"getDoc","tags":["Docs"],"summary":"Read a document (Markdown body and revision)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Doc"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"updateDoc","tags":["Docs"],"summary":"Replace the title and/or body; 409 with the latest content when baseRevision is stale","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDocRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Revision"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"REVISION_CONFLICT: the document changed since you read it; `latest` has the current revision and content","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevisionConflict"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}},"delete":{"operationId":"deleteDoc","tags":["Docs"],"summary":"Delete a document","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done (no content)"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}}},"/docs/{id}/edits":{"post":{"operationId":"editDoc","tags":["Docs"],"summary":"Apply exact-match edits (replace, insert_after, append, prepend, rewrite)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditDocRequest"},"example":{"edits":[{"op":"replace","find":"- First point","replace":"- First point, revised"}],"revision":3}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Revision"}}}},"400":{"description":"EDIT_NOT_APPLICABLE: an edit did not match the current text; read the document again","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"REVISION_CONFLICT: revision is not the latest","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}}},"/media/quote":{"post":{"operationId":"quoteMedia","tags":["Media"],"summary":"Duration and credit cost before transcribing a link (one price per minute, summary and translation included)","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuoteMediaRequest"},"example":{"url":"https://www.youtube.com/watch?v=dQw4w9WgXcQ"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaQuote"}}}},"400":{"description":"The link cannot be transcribed (for example not a supported video or podcast); `code` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"MEDIA_UNAVAILABLE: transcription is temporarily unavailable; try again later","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/media":{"post":{"operationId":"startMedia","tags":["Media"],"summary":"Turn a YouTube, Bilibili or podcast link into a timestamped transcript and summary (credits per minute)","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Any unique string (e.g. a UUID). Retrying with the same key within 24 hours returns the first result instead of creating twice; a different body with the same key returns 422.","schema":{"type":"string","maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartMediaRequest"},"example":{"url":"https://www.youtube.com/watch?v=dQw4w9WgXcQ","lang":"en"}}}},"responses":{"202":{"description":"Accepted: the work continues in the background","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaStarted"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"description":"CREDITS_EXHAUSTED: not enough credits for this length","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"$ref":"#/components/responses/IdempotencyInProgress"},"422":{"$ref":"#/components/responses/IdempotencyMismatch"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"MEDIA_UNAVAILABLE: transcription is temporarily unavailable; try again later","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"listMedia","tags":["Media"],"summary":"Your videos and podcasts, most recently saved first","parameters":[{"name":"space","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"description":"nextCursor from the previous page","schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/MediaItem"}},"nextCursor":{"description":"Pass as ?cursor= to get the next page; null when done","type":["string","null"]}},"required":["items","nextCursor"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}}},"/media/{id}":{"get":{"operationId":"getMedia","tags":["Media"],"summary":"Status, summary, chapters and transcript segments (new segments after a revision while processing)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"lang","in":"query","required":false,"description":"Content language; defaults to your content language setting","schema":{"$ref":"#/components/schemas/Locale"}},{"name":"after","in":"query","required":false,"schema":{"type":"integer","minimum":0}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaPage"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}}},"/media/{id}/transcript":{"get":{"operationId":"getTranscript","tags":["Media"],"summary":"Summary and transcript as Markdown with timestamp links (optionally a time range)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"lang","in":"query","required":false,"description":"Content language; defaults to your content language setting","schema":{"$ref":"#/components/schemas/Locale"}},{"name":"from","in":"query","required":false,"schema":{"type":"number","minimum":0}},{"name":"to","in":"query","required":false,"schema":{"type":"number","minimum":0}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Transcript"}}}},"400":{"description":"MEDIA_NOT_READY: the transcript is not ready yet","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}}},"/agent":{"get":{"operationId":"getAgent","tags":["Agent"],"summary":"Your agent: name, memory (Markdown) and email address","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Agent"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"updateAgent","tags":["Agent"],"summary":"Rename the agent or edit its memory","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAgentRequest"}}}},"responses":{"204":{"description":"Done (no content)"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}}},"/home":{"get":{"operationId":"getHome","tags":["Agent"],"summary":"Home: what your agent read, the latest briefs, running tasks, actions waiting for you, suggestions, unread inbox items and recent conversations","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Home"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}}},"/inbox":{"get":{"operationId":"listInbox","tags":["Inbox"],"summary":"Inbox: actions waiting for your decision, then finished tasks, briefs, alerts and suggestions","parameters":[{"name":"filter","in":"query","required":false,"description":"approval: only actions waiting for you; task / brief: only that kind of item","schema":{"default":"all","type":"string","enum":["all","unread","approval","task","brief"]}},{"name":"cursor","in":"query","required":false,"description":"nextCursor from the previous page","schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Inbox"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}}},"/inbox/{id}":{"post":{"operationId":"markInboxItem","tags":["Inbox"],"summary":"Mark an inbox item read, done or dismissed","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarkInboxRequest"}}}},"responses":{"204":{"description":"Done (no content)"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}}},"/tasks":{"get":{"operationId":"listTasks","tags":["Tasks"],"summary":"Tasks the agent ran for you (watch setup, research, transcription, scheduled tasks), newest first","parameters":[{"name":"space","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"active","in":"query","required":false,"description":"true: only queued, running or waiting tasks","schema":{"type":"string","enum":["true","false"]}},{"name":"kind","in":"query","required":false,"schema":{"$ref":"#/components/schemas/TaskKind"}},{"name":"limit","in":"query","required":false,"schema":{"default":30,"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"description":"nextCursor from the previous page","schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Task"}},"nextCursor":{"description":"Pass as ?cursor= to get the next page; null when done","type":["string","null"]}},"required":["items","nextCursor"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}}},"/tasks/{id}":{"get":{"operationId":"getTask","tags":["Tasks"],"summary":"A task with its milestones (plan, steps, output) and the actions it is waiting on","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskDetail"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}}},"/tasks/{id}/cancel":{"post":{"operationId":"cancelTask","tags":["Tasks"],"summary":"Cancel a running task; work already done is kept","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"TASK_NOT_ACTIVE: the task has already finished","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}}},"/conversations":{"get":{"operationId":"listConversations","tags":["Conversations"],"summary":"Conversations with your agent, most recently active first","parameters":[{"name":"space","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"limit","in":"query","required":false,"schema":{"default":30,"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"description":"nextCursor from the previous page","schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Conversation"}},"nextCursor":{"description":"Pass as ?cursor= to get the next page; null when done","type":["string","null"]}},"required":["items","nextCursor"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}}},"/conversations/{id}/messages":{"get":{"operationId":"getConversationMessages","tags":["Conversations"],"summary":"A conversation and its most recent messages (oldest first)","description":"While a turn is running, conversation.running is true and the reply appears here when it ends. Poll this endpoint, or connect to the WebSocket for streaming.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Most recent messages to return","schema":{"default":60,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Messages"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}}},"/conversations/messages":{"post":{"operationId":"sendMessage","tags":["Conversations"],"summary":"Send a message to your agent (starts a turn); leave out conversationId to start a new conversation","description":"Returns at once with the conversation id and the id of the agent's reply; read it with GET /conversations/{id}/messages. Actions that change things may wait for your approval (POST /actions/{id}/decide). Charged by actual model cost.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Any unique string (e.g. a UUID). Retrying with the same key within 24 hours returns the first result instead of creating twice; a different body with the same key returns 422.","schema":{"type":"string","maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMessageRequest"},"example":{"text":"What changed in my robotics watch this week?"}}}},"responses":{"202":{"description":"Accepted: the work continues in the background","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TurnStarted"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"description":"CREDITS_EXHAUSTED: no AI credits left","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"CONVERSATION_BUSY (the agent is still answering in this conversation) or IDEMPOTENCY_IN_PROGRESS","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/IdempotencyMismatch"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}}},"/conversations/{id}":{"delete":{"operationId":"deleteConversation","tags":["Conversations"],"summary":"Delete a conversation","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done (no content)"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}}},"/actions/{id}/decide":{"post":{"operationId":"decideAction","tags":["Actions"],"summary":"Approve or reject an action waiting for your decision","description":"An approved action runs in the background; its status moves to executed or failed, and the agent continues the conversation.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Any unique string (e.g. a UUID). Retrying with the same key within 24 hours returns the first result instead of creating twice; a different body with the same key returns 422.","schema":{"type":"string","maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecideActionRequest"},"example":{"approve":true}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Action"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"ACTION_DECIDED (already decided) or IDEMPOTENCY_IN_PROGRESS","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/IdempotencyMismatch"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}}},"/actions/{id}/undo":{"post":{"operationId":"undoAction","tags":["Actions"],"summary":"Undo an action the agent already did (within its undo window)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Action"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"ACTION_NOT_UNDOABLE: the undo window has passed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}}}},"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"A personal API key (wpr_…) or a session token from signing in."}},"schemas":{"Action":{"type":"object","properties":{"id":{"type":"string"},"tool":{"type":"string"},"risk":{"$ref":"#/components/schemas/ToolRisk"},"title":{"type":"string"},"status":{"$ref":"#/components/schemas/ActionStatus"},"preview":{"type":["object","null"],"additionalProperties":{}},"ruleScope":{"description":"Pass remember: true when deciding to allow this kind of action from now on","type":["string","null"]},"undoUntil":{"type":["integer","null"],"description":"Unix time in milliseconds"},"conversationId":{"type":["string","null"]},"taskId":{"type":["string","null"]},"createdAt":{"type":"integer","description":"Unix time in milliseconds"}},"required":["id","tool","risk","title","status","preview","ruleScope","undoUntil","conversationId","taskId","createdAt"]},"ActionStatus":{"type":"string","enum":["pending","approved","rejected","expired","executed","failed","undone"]},"Agent":{"type":"object","properties":{"name":{"type":"string"},"memory":{"type":"string","description":"Markdown"},"memoryMax":{"type":"number"},"address":{"type":"string","description":"Email address that reaches your agent"}},"required":["name","memory","memoryMax","address"]},"ArtifactChange":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/ArtifactKind"},"id":{"type":"string"},"title":{"type":"string"},"action":{"type":"string","enum":["created","updated"]},"href":{"type":"string","description":"Site path without a language prefix"},"note":{"type":"string"},"pending":{"description":"Still being processed in the background","type":"boolean"},"outcome":{"type":"string","enum":["done","failed"]},"actionIds":{"type":"array","items":{"type":"string"},"description":"Actions to undo (in reverse order) to revert this change; empty when it can't be undone"},"undoUntil":{"type":["integer","null"],"description":"Unix time in milliseconds"},"undone":{"type":"boolean"}},"required":["kind","id","title","action","href","actionIds","undoUntil"]},"ArtifactKind":{"type":"string","enum":["media","doc","watch","issue","clip","task"]},"BriefEntry":{"type":"object","properties":{"id":{"type":"string"},"position":{"type":"number"},"importance":{"type":"number"},"category":{"type":["string","null"]},"headline":{"type":"string"},"summary":{"type":"string"},"why":{"type":"string","description":"Why it matters"},"primaryUrl":{"type":"string"},"mediaId":{"type":["string","null"]},"feedback":{"type":["string","null"],"enum":["up","down",null]},"saved":{"type":"boolean"},"evidence":{"type":"array","items":{"$ref":"#/components/schemas/Evidence"}}},"required":["id","position","importance","category","headline","summary","why","primaryUrl","mediaId","feedback","saved","evidence"]},"ChatFile":{"type":"object","properties":{"id":{"type":"string","description":"Library item id"},"name":{"type":"string"},"mime":{"type":"string"},"url":{"type":"string","description":"Site path of the file (images: thumbnail)"}},"required":["id","name","mime","url"]},"ChatMessage":{"type":"object","properties":{"id":{"type":"string"},"conversationId":{"type":"string"},"role":{"type":"string","enum":["user","assistant"]},"parts":{"type":"array","items":{"$ref":"#/components/schemas/ChatPart"}},"context":{"$ref":"#/components/schemas/PageContext"},"credits":{"description":"Credits this reply used","type":"number"},"createdAt":{"type":"integer","description":"Unix time in milliseconds"}},"required":["id","conversationId","role","parts","createdAt"]},"ChatPart":{"oneOf":[{"$ref":"#/components/schemas/ChatPartText"},{"$ref":"#/components/schemas/ChatPartFiles"},{"$ref":"#/components/schemas/ChatPartTool"},{"$ref":"#/components/schemas/ChatPartCitations"},{"$ref":"#/components/schemas/ChatPartAction"},{"$ref":"#/components/schemas/ChatPartTask"},{"$ref":"#/components/schemas/ChatPartMedia"},{"$ref":"#/components/schemas/ChatPartChanges"},{"$ref":"#/components/schemas/ChatPartMemory"},{"$ref":"#/components/schemas/ChatPartChoice"},{"$ref":"#/components/schemas/ChatPartConnect"}],"discriminator":{"propertyName":"type","mapping":{"text":"#/components/schemas/ChatPartText","files":"#/components/schemas/ChatPartFiles","tool":"#/components/schemas/ChatPartTool","citations":"#/components/schemas/ChatPartCitations","action":"#/components/schemas/ChatPartAction","task":"#/components/schemas/ChatPartTask","media":"#/components/schemas/ChatPartMedia","changes":"#/components/schemas/ChatPartChanges","memory":"#/components/schemas/ChatPartMemory","choice":"#/components/schemas/ChatPartChoice","connect":"#/components/schemas/ChatPartConnect"}}},"ChatPartAction":{"type":"object","properties":{"type":{"type":"string","const":"action"},"action":{"$ref":"#/components/schemas/Action"}},"required":["type","action"]},"ChatPartChanges":{"type":"object","properties":{"type":{"type":"string","const":"changes"},"items":{"type":"array","items":{"$ref":"#/components/schemas/ArtifactChange"}}},"required":["type","items"]},"ChatPartChoice":{"type":"object","properties":{"type":{"type":"string","const":"choice"},"id":{"type":"string"},"question":{"type":"string"},"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"hint":{"type":"string"}},"required":["id","label"]}}},"required":["type","id","question","options"]},"ChatPartCitations":{"type":"object","properties":{"type":{"type":"string","const":"citations"},"items":{"type":"array","items":{"$ref":"#/components/schemas/Citation"}}},"required":["type","items"]},"ChatPartConnect":{"type":"object","properties":{"type":{"type":"string","const":"connect"},"card":{"$ref":"#/components/schemas/ConnectCard"}},"required":["type","card"]},"ChatPartFiles":{"type":"object","properties":{"type":{"type":"string","const":"files"},"items":{"type":"array","items":{"$ref":"#/components/schemas/ChatFile"}}},"required":["type","items"]},"ChatPartMedia":{"type":"object","properties":{"type":{"type":"string","const":"media"},"mediaId":{"type":"string"},"title":{"type":"string"}},"required":["type","mediaId","title"]},"ChatPartMemory":{"type":"object","properties":{"type":{"type":"string","const":"memory"},"text":{"type":"string"},"actionId":{"type":"string"}},"required":["type","text","actionId"]},"ChatPartTask":{"type":"object","properties":{"type":{"type":"string","const":"task"},"taskId":{"type":"string"},"kind":{"$ref":"#/components/schemas/TaskKind"},"title":{"type":"string"}},"required":["type","taskId","kind","title"]},"ChatPartText":{"type":"object","properties":{"type":{"type":"string","const":"text"},"text":{"type":"string"}},"required":["type","text"]},"ChatPartTool":{"type":"object","properties":{"type":{"type":"string","const":"tool"},"id":{"type":"string"},"name":{"type":"string"},"label":{"type":"string","description":"Localized progress text to show; never show `name`"},"status":{"type":"string","enum":["running","done","error"]}},"required":["type","id","name","label","status"]},"Citation":{"type":"object","properties":{"n":{"type":"number","description":"Citation number used in the text as [n]"},"title":{"type":"string"},"url":{"type":"string"},"source":{"type":"string"}},"required":["n","title","url","source"]},"ConnectCard":{"type":"object","properties":{"connector":{"type":"string"},"name":{"type":"string"},"logo":{"type":["string","null"]},"reason":{"type":"string"},"recipe":{"type":["object","null"],"properties":{"id":{"type":"string"},"title":{"type":"string"},"body":{"type":"string"}},"required":["id","title","body"]},"access":{"type":"string"},"href":{"type":"string","description":"Site path of the connect page; native clients open it in the web app"},"waitId":{"type":["string","null"]},"state":{"$ref":"#/components/schemas/ConnectionState"}},"required":["connector","name","logo","reason","recipe","access","href","waitId","state"]},"ConnectionState":{"type":"string","enum":["available","pending","connected","expired"]},"ContextRef":{"type":"object","properties":{"kind":{"type":"string","enum":["watch","doc","media"]},"id":{"type":"string","maxLength":40}},"required":["kind","id"]},"Conversation":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"spaceId":{"type":["string","null"]},"channel":{"type":"string","enum":["web","email","telegram","mcp","api"]},"preview":{"type":"string"},"messageCount":{"type":"number"},"updatedAt":{"type":"integer","description":"Unix time in milliseconds"},"running":{"type":"boolean","description":"A turn is still in progress"}},"required":["id","title","spaceId","channel","preview","messageCount","updatedAt","running"]},"CreateDocRequest":{"type":"object","properties":{"title":{"default":"","type":"string","maxLength":200},"markdown":{"default":"","description":"waper Markdown, no front matter","type":"string","maxLength":500000},"spaceId":{"type":["string","null"],"minLength":1,"maxLength":80},"folderId":{"type":["string","null"],"minLength":1,"maxLength":80}}},"CreateSpaceRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"icon":{"type":["string","null"],"maxLength":16},"description":{"type":"string","maxLength":300}},"required":["name"]},"CreateWatchRequest":{"type":"object","properties":{"intent":{"type":"string","minLength":2,"maxLength":200,"description":"One sentence: what to track"},"lang":{"description":"Content language; defaults to your content language setting","$ref":"#/components/schemas/Locale"},"visibility":{"default":"public","type":"string","enum":["public","unlisted","private"]},"spaceId":{"type":["string","null"],"minLength":1,"maxLength":80},"type":{"default":"topic","description":"topic: the agent finds sources; sources: the URLs you give; pages: watch pages for changes","type":"string","enum":["topic","sources","pages"]},"urls":{"maxItems":20,"type":"array","items":{"type":"string","maxLength":2048,"format":"uri"}},"cadence":{"default":"daily","type":"string","enum":["daily","weekly","off"]},"alerts":{"maxItems":5,"type":"array","items":{"type":"string","minLength":2,"maxLength":200}}},"required":["intent"]},"DecideActionRequest":{"type":"object","properties":{"approve":{"type":"boolean"},"remember":{"default":false,"description":"Allow this kind of action from now on (when it has a rule scope)","type":"boolean"}},"required":["approve"]},"Doc":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"body":{"type":"string","description":"waper Markdown"},"revision":{"type":"number"},"origin":{"type":"string"},"folderId":{"type":["string","null"]},"updatedAt":{"description":"ISO 8601 timestamp","type":"string","format":"date-time"},"space":{"type":["object","null"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"icon":{"type":["string","null"]},"isDefault":{"type":"boolean"}},"required":["id","name","icon","isDefault"]},"publication":{"type":["object","null"],"properties":{"url":{"type":"string"},"siteId":{"type":"string"},"updatedAt":{"description":"ISO 8601 timestamp","type":"string","format":"date-time"}},"required":["url","siteId","updatedAt"]}},"required":["id","title","body","revision","origin","folderId","updatedAt","space","publication"]},"DocCreated":{"type":"object","properties":{"id":{"type":"string"},"revision":{"type":"number"}},"required":["id","revision"]},"DocHit":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"spaceId":{"type":"string"},"excerpt":{"type":"string"},"updatedAt":{"description":"ISO 8601 timestamp","type":"string","format":"date-time"}},"required":["id","title","spaceId","excerpt","updatedAt"]},"DocSummary":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"spaceId":{"type":"string"},"folderId":{"type":["string","null"]},"revision":{"type":"number"},"updatedAt":{"description":"ISO 8601 timestamp","type":"string","format":"date-time"}},"required":["id","title","spaceId","folderId","revision","updatedAt"]},"EditDocRequest":{"type":"object","properties":{"edits":{"minItems":1,"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/EditOp"}},"revision":{"type":"integer","minimum":1}},"required":["edits"]},"EditOp":{"oneOf":[{"$ref":"#/components/schemas/EditOpReplace"},{"$ref":"#/components/schemas/EditOpInsertAfter"},{"$ref":"#/components/schemas/EditOpAppend"},{"$ref":"#/components/schemas/EditOpPrepend"},{"$ref":"#/components/schemas/EditOpRewrite"}],"discriminator":{"propertyName":"op","mapping":{"replace":"#/components/schemas/EditOpReplace","insert_after":"#/components/schemas/EditOpInsertAfter","append":"#/components/schemas/EditOpAppend","prepend":"#/components/schemas/EditOpPrepend","rewrite":"#/components/schemas/EditOpRewrite"}}},"EditOpAppend":{"type":"object","properties":{"op":{"type":"string","const":"append"},"content":{"type":"string","minLength":1,"maxLength":40000}},"required":["op","content"]},"EditOpInsertAfter":{"type":"object","properties":{"op":{"type":"string","const":"insert_after"},"after":{"type":"string","minLength":1,"maxLength":4000},"content":{"type":"string","minLength":1,"maxLength":40000}},"required":["op","after","content"]},"EditOpPrepend":{"type":"object","properties":{"op":{"type":"string","const":"prepend"},"content":{"type":"string","minLength":1,"maxLength":40000}},"required":["op","content"]},"EditOpReplace":{"type":"object","properties":{"op":{"type":"string","const":"replace"},"find":{"type":"string","minLength":1,"maxLength":20000},"replace":{"type":"string","maxLength":40000}},"required":["op","find","replace"]},"EditOpRewrite":{"type":"object","properties":{"op":{"type":"string","const":"rewrite"},"content":{"type":"string","minLength":1,"maxLength":200000}},"required":["op","content"]},"EntryFeedbackRequest":{"type":"object","properties":{"value":{"type":["string","null"],"enum":["up","down",null]}},"required":["value"]},"EntrySavedRequest":{"type":"object","properties":{"saved":{"type":"boolean"},"spaceId":{"type":["string","null"],"minLength":1,"maxLength":80}},"required":["saved"]},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Stable error code, e.g. WATCH_NOT_FOUND"},"message":{"type":"string","description":"What went wrong, for people"},"issues":{"type":"array","description":"Only for INVALID_INPUT: each field that did not match","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["code","message"]}},"required":["error"]},"Evidence":{"type":"object","properties":{"url":{"type":"string"},"title":{"type":"string"},"source":{"type":"string"},"publishedAt":{"description":"ISO 8601 timestamp","type":["string","null"],"format":"date-time"}},"required":["url","title","source","publishedAt"]},"FileSaved":{"type":"object","properties":{"clipId":{"type":"string"},"fileId":{"type":"string"},"created":{"type":"boolean"},"spaceId":{"type":"string"}},"required":["clipId","fileId","created","spaceId"]},"FollowedWatch":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"kind":{"type":"string","enum":["official","community","private"]},"language":{"$ref":"#/components/schemas/Locale"},"title":{"type":"string"},"summary":{"type":"string"},"followerCount":{"type":"number"},"latest":{"type":["object","null"],"properties":{"editionDate":{"type":"string"},"lead":{"type":"string"},"entryCount":{"type":"number"}},"required":["editionDate","lead","entryCount"]},"following":{"type":"boolean"},"spaceId":{"type":"string"}},"required":["id","slug","kind","language","title","summary","followerCount","latest","following","spaceId"]},"FollowRequest":{"type":"object","properties":{"spaceId":{"type":["string","null"],"minLength":1,"maxLength":80}}},"FollowState":{"type":"object","properties":{"following":{"type":"boolean"},"spaceId":{"type":["string","null"]}},"required":["following","spaceId"]},"Home":{"type":"object","properties":{"agentName":{"type":"string"},"following":{"type":"number","description":"How many watches you follow"},"digest":{"type":"object","properties":{"read":{"type":"number"},"kept":{"type":"number"}},"required":["read","kept"],"description":"Last 24 hours: items your watches went through, and how many made it into briefs"},"running":{"type":"array","items":{"$ref":"#/components/schemas/Task"}},"pending":{"type":"array","items":{"$ref":"#/components/schemas/Action"},"description":"Actions waiting for your decision (the first few)"},"pendingCount":{"type":"number"},"unread":{"type":"number"},"briefs":{"type":"array","items":{"type":"object","properties":{"issueId":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"lead":{"type":"string"},"entryCount":{"type":"number"},"editionDate":{"type":"string"},"publishedAt":{"type":"integer","description":"Unix time in milliseconds"},"unread":{"type":"boolean"}},"required":["issueId","slug","title","lead","entryCount","editionDate","publishedAt","unread"]},"description":"The latest brief of each watch you follow from the last 48 hours, newest first"},"suggestions":{"type":"array","items":{"$ref":"#/components/schemas/InboxItem"},"description":"Your agent's open suggestions from the last 7 days"},"inbox":{"type":"array","items":{"$ref":"#/components/schemas/InboxItem"},"description":"Unread finished tasks, alerts and notices"},"conversations":{"type":"array","items":{"$ref":"#/components/schemas/Conversation"}}},"required":["agentName","following","digest","running","pending","pendingCount","unread","briefs","suggestions","inbox","conversations"]},"Inbox":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/InboxItem"}},"nextCursor":{"description":"Pass as ?cursor= to get the next page; null when done","type":["string","null"]},"pending":{"type":"array","items":{"$ref":"#/components/schemas/Action"},"description":"Actions waiting for your decision (first page only)"}},"required":["items","nextCursor","pending"]},"InboxItem":{"type":"object","properties":{"id":{"type":"string"},"kind":{"$ref":"#/components/schemas/InboxKind"},"title":{"type":"string"},"body":{"type":"string"},"refKind":{"type":["string","null"],"enum":["issue","task","action","watch","media","clip","doc",null]},"refId":{"type":["string","null"]},"spaceId":{"type":["string","null"]},"action":{"type":["object","null"],"additionalProperties":{},"description":"What opening it does, e.g. {\"type\":\"open\",\"href\":\"/docs/…\"}"},"status":{"type":"string","enum":["unread","read","done","dismissed"]},"createdAt":{"type":"integer","description":"Unix time in milliseconds"}},"required":["id","kind","title","body","refKind","refId","spaceId","action","status","createdAt"]},"InboxKind":{"type":"string","enum":["brief","alert","task","approval","suggestion","notice"]},"IssueSummary":{"type":"object","properties":{"id":{"type":"string"},"editionDate":{"type":"string"},"lead":{"type":"string"},"entryCount":{"type":"number"}},"required":["id","editionDate","lead","entryCount"]},"Knowledge":{"type":"object","properties":{"weekly":{"type":["object","null"],"properties":{"weekStart":{"type":"string"},"body":{"type":"string"}},"required":["weekStart","body"]},"timeline":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"headline":{"type":"string"},"url":{"type":"string"}},"required":["date","headline","url"]}}},"required":["weekly","timeline"]},"LibraryItem":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["entry","link","file","media"]},"spaceId":{"type":"string"},"spaceAuto":{"type":"boolean","description":"The agent picked the space from the content"},"url":{"type":"string","description":"The original page, or /files/<id> for uploaded files"},"title":{"type":"string"},"summary":{"type":"string"},"points":{"type":"array","items":{"type":"string"}},"siteName":{"type":["string","null"]},"image":{"type":["string","null"]},"note":{"type":"string"},"status":{"type":"string","enum":["pending","ready","failed"]},"error":{"type":["string","null"]},"fileId":{"type":["string","null"]},"file":{"type":["object","null"],"properties":{"name":{"type":"string"},"mime":{"type":"string"},"bytes":{"type":"number"},"textChars":{"type":"number"}},"required":["name","mime","bytes","textChars"]},"entryId":{"type":["string","null"]},"mediaId":{"type":["string","null"]},"watch":{"type":["object","null"],"properties":{"slug":{"type":"string"},"title":{"type":"string"}},"required":["slug","title"]},"createdAt":{"description":"ISO 8601 timestamp","type":"string","format":"date-time"}},"required":["id","kind","spaceId","spaceAuto","url","title","summary","points","siteName","image","note","status","error","fileId","file","entryId","mediaId","watch","createdAt"]},"LibraryText":{"type":"object","properties":{"text":{"type":"string"},"offset":{"type":"number"},"total":{"type":"number"},"next":{"description":"Offset of the next chunk; null at the end","type":["number","null"]}},"required":["text","offset","total","next"]},"LinkSaved":{"type":"object","properties":{"media":{"type":"boolean","description":"An audio or video link: nothing was saved; quote and start it with POST /media instead"},"clipId":{"description":"The saved item; null when media is true","type":["string","null"]},"created":{"type":"boolean","description":"False when the link was already in your library"},"spaceId":{"description":"The space it was filed into; null when media is true","type":["string","null"]}},"required":["media","clipId","created","spaceId"]},"Locale":{"type":"string","enum":["zh","en"]},"MarkInboxRequest":{"type":"object","properties":{"status":{"type":"string","enum":["read","done","dismissed"]}},"required":["status"]},"Me":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"emailVerified":{"type":"boolean"}},"required":["id","email","name","emailVerified"]},"plan":{"type":"string","enum":["free","personal","pro"]},"paid":{"type":"boolean"},"trialing":{"type":"boolean"},"trialDaysLeft":{"type":"number"},"credits":{"type":"object","properties":{"daily":{"type":"number"},"period":{"type":"number"},"gift":{"type":"number"},"purchase":{"type":"number"},"total":{"type":"number"},"nextExpiry":{"type":["object","null"],"properties":{"at":{"description":"ISO 8601 timestamp","type":"string","format":"date-time"},"credits":{"type":"number"}},"required":["at","credits"]}},"required":["daily","period","gift","purchase","total","nextExpiry"]},"limits":{"type":"object","properties":{"follows":{"type":"number"},"watchesPerMonth":{"type":"number"},"privateWatches":{"type":"boolean"},"mediaMinutes":{"type":"number"},"storageBytes":{"type":"number"}},"required":["follows","watchesPerMonth","privateWatches","mediaMinutes","storageBytes"]}},"required":["user","plan","paid","trialing","trialDaysLeft","credits","limits"]},"MediaCard":{"type":"object","properties":{"id":{"type":"string"},"platform":{"type":"string","enum":["youtube","bilibili","audio","web","upload"]},"url":{"type":"string"},"title":{"type":"string"},"uploader":{"type":["string","null"]},"thumbnail":{"type":["string","null"]},"durationS":{"type":["number","null"]},"publishedAt":{"type":["string","null"]},"status":{"type":"string","enum":["processing","ready","failed"]},"error":{"type":["string","null"]},"language":{"type":["string","null"]},"isUpload":{"type":"boolean"},"createdAt":{"type":"integer","description":"Unix time in milliseconds"}},"required":["id","platform","url","title","uploader","thumbnail","durationS","publishedAt","status","error","language","isUpload","createdAt"]},"MediaItem":{"type":"object","properties":{"id":{"type":"string"},"platform":{"type":"string","enum":["youtube","bilibili","audio","web","upload"]},"url":{"type":"string"},"title":{"type":"string"},"uploader":{"type":["string","null"]},"thumbnail":{"type":["string","null"]},"durationS":{"type":["number","null"]},"publishedAt":{"type":["string","null"]},"status":{"type":"string","enum":["processing","ready","failed"]},"error":{"type":["string","null"]},"language":{"type":["string","null"]},"isUpload":{"type":"boolean"},"createdAt":{"type":"integer","description":"Unix time in milliseconds"},"savedAt":{"type":"integer","description":"Unix time in milliseconds"},"spaceId":{"type":"string"}},"required":["id","platform","url","title","uploader","thumbnail","durationS","publishedAt","status","error","language","isUpload","createdAt","savedAt","spaceId"]},"MediaPage":{"type":"object","properties":{"media":{"$ref":"#/components/schemas/MediaCard"},"saved":{"type":["object","null"],"properties":{"spaceId":{"type":"string"},"credits":{"type":"number"}},"required":["spaceId","credits"]},"step":{"type":["string","null"],"enum":["fetch","transcribe","summarize",null],"description":"Current step while processing: fetching the content, turning it into text, writing the summary"},"summary":{"type":["object","null"],"properties":{"lang":{"type":"string","enum":["zh","en"]},"overview":{"type":"string"},"points":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"refs":{"type":"array","items":{"type":"number"}}},"required":["text","refs"]}},"chapters":{"type":"array","items":{"type":"object","properties":{"idx":{"type":"number"},"title":{"type":"string"},"summary":{"type":"string"}},"required":["idx","title","summary"]}}},"required":["lang","overview","points","chapters"]},"segments":{"type":"array","items":{"type":"object","properties":{"idx":{"type":"number"},"start":{"type":"number"},"end":{"type":"number"},"text":{"type":"string"},"raw":{"type":["string","null"]}},"required":["idx","start","end","text","raw"]}},"rev":{"type":"number"},"progress":{"type":["object","null"],"properties":{"done":{"type":"number"},"total":{"type":"number"},"polished":{"type":"number"}},"required":["done","total","polished"]},"summarizing":{"type":"boolean"},"summaryFailed":{"type":"boolean"}},"required":["media","saved","step","summary","segments","rev","progress","summarizing","summaryFailed"]},"MediaQuote":{"type":"object","properties":{"state":{"type":"string","enum":["ready","processing","new"]},"mediaId":{"type":"string"},"title":{"type":"string"},"uploader":{"type":["string","null"]},"thumbnail":{"type":["string","null"]},"durationS":{"type":"number"},"minutes":{"type":"number","description":"Billed minutes (each started minute counts)"},"credits":{"type":"number","description":"Credits this will cost: one price per minute, transcript, summary and translation included; 0 when reused"},"remaining":{"type":"number"},"maxMinutes":{"type":"number"}},"required":["state","title","uploader","thumbnail","durationS","minutes","credits","remaining","maxMinutes"]},"MediaStarted":{"type":"object","properties":{"mediaId":{"type":"string"},"reused":{"type":"boolean"}},"required":["mediaId","reused"]},"Messages":{"type":"object","properties":{"conversation":{"$ref":"#/components/schemas/Conversation"},"messages":{"type":"array","items":{"$ref":"#/components/schemas/ChatMessage"},"description":"Oldest first"}},"required":["conversation","messages"]},"Milestone":{"type":"object","properties":{"seq":{"type":"number"},"kind":{"$ref":"#/components/schemas/TaskMilestoneKind"},"key":{"type":"string"},"label":{"type":"string"},"status":{"type":"string","enum":["running","done","failed","skipped"]},"detail":{"type":"object","additionalProperties":{}},"createdAt":{"type":"integer","description":"Unix time in milliseconds"}},"required":["seq","kind","key","label","status","detail","createdAt"]},"PageContext":{"type":"object","properties":{"kind":{"type":"string","enum":["today","discover","space","library","watch","issue","knowledge","doc","docs","media","settings","other"]},"path":{"type":"string","maxLength":300},"title":{"type":"string","maxLength":200},"spaceId":{"type":"string","maxLength":40},"watchId":{"type":"string","maxLength":40},"issueDate":{"type":"string","maxLength":10},"entryId":{"type":"string","maxLength":40},"docId":{"type":"string","maxLength":40},"mediaId":{"type":"string","maxLength":40},"selection":{"type":"string","maxLength":4000}},"required":["kind","path"]},"QuoteMediaRequest":{"type":"object","properties":{"url":{"type":"string","maxLength":2048,"format":"uri"}},"required":["url"]},"Revision":{"type":"object","properties":{"revision":{"type":"number"}},"required":["revision"]},"RevisionConflict":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","const":"REVISION_CONFLICT"},"message":{"type":"string"}},"required":["code","message"]},"latest":{"type":"object","properties":{"revision":{"type":"number"},"title":{"type":"string"},"markdown":{"type":"string"}},"required":["revision","title","markdown"]}},"required":["error","latest"]},"SaveLinkRequest":{"type":"object","properties":{"url":{"type":"string","maxLength":2048,"format":"uri"},"spaceId":{"type":["string","null"],"minLength":1,"maxLength":80,"description":"Leave out to let the agent pick a space from the content"},"title":{"type":"string","maxLength":300},"note":{"type":"string","maxLength":2000},"lang":{"description":"Content language; defaults to your content language setting","$ref":"#/components/schemas/Locale"}},"required":["url"]},"SendMessageRequest":{"type":"object","properties":{"conversationId":{"type":["string","null"],"minLength":1,"maxLength":80,"description":"Leave out to start a new conversation"},"text":{"type":"string","minLength":1,"maxLength":8000},"context":{"default":{"kind":"other","path":"/api"},"$ref":"#/components/schemas/PageContext"},"refs":{"default":[],"maxItems":5,"type":"array","items":{"$ref":"#/components/schemas/ContextRef"}}},"required":["text"]},"Space":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"icon":{"type":["string","null"]},"description":{"type":"string"},"isDefault":{"type":"boolean"},"position":{"type":"number"}},"required":["id","name","icon","description","isDefault","position"]},"StartMediaRequest":{"type":"object","properties":{"url":{"type":"string","maxLength":2048,"format":"uri"},"lang":{"description":"Content language; defaults to your content language setting","$ref":"#/components/schemas/Locale"},"spaceId":{"type":["string","null"],"minLength":1,"maxLength":80}},"required":["url"]},"Task":{"type":"object","properties":{"id":{"type":"string"},"kind":{"$ref":"#/components/schemas/TaskKind"},"title":{"type":"string","description":"The output's title once the task succeeds; the request (or plan name) before that"},"request":{"type":"string","description":"The user's original request; empty for scheduled runs"},"status":{"$ref":"#/components/schemas/TaskStatus"},"statusText":{"type":"string"},"spaceId":{"type":["string","null"]},"conversationId":{"type":["string","null"]},"output":{"$ref":"#/components/schemas/TaskOutput","description":"What the task produced: a document, watch, media item or link"},"error":{"type":["string","null"]},"quotedCredits":{"type":"number"},"credits":{"type":"number"},"createdAt":{"type":"integer","description":"Unix time in milliseconds"},"updatedAt":{"type":"integer","description":"Unix time in milliseconds"}},"required":["id","kind","title","request","status","statusText","spaceId","conversationId","error","quotedCredits","credits","createdAt","updatedAt"]},"TaskDetail":{"type":"object","properties":{"task":{"$ref":"#/components/schemas/Task"},"milestones":{"type":"array","items":{"$ref":"#/components/schemas/Milestone"},"description":"Plan, steps, choices, output, notes and errors, in order"},"pending":{"type":"array","items":{"$ref":"#/components/schemas/Action"},"description":"This task's actions waiting for your decision"}},"required":["task","milestones","pending"]},"TaskKind":{"type":"string","enum":["watch_create","research","media","import","mail_reply","schedule","recipe"]},"TaskMilestoneKind":{"type":"string","enum":["plan","step","choice","output","note","error"]},"TaskOutput":{"type":"object","properties":{"title":{"type":"string"},"docId":{"type":"string"},"watchId":{"type":"string"},"clipIds":{"type":"array","items":{"type":"string"}},"mediaId":{"type":"string"},"href":{"type":"string"},"summary":{"type":"string"}}},"TaskStatus":{"type":"string","enum":["queued","running","waiting","succeeded","failed","cancelled"]},"ToolRisk":{"type":"string","enum":["read","write","send","spend","delete"]},"Transcript":{"type":"object","properties":{"title":{"type":"string"},"status":{"type":"string"},"markdown":{"description":"null while the media is still processing","type":["string","null"]}},"required":["title","status","markdown"]},"TurnStarted":{"type":"object","properties":{"conversationId":{"type":"string"},"messageId":{"type":"string","description":"Id of the agent's reply; it appears in GET /conversations/{id}/messages when the turn ends"}},"required":["conversationId","messageId"]},"UpdateAgentRequest":{"type":"object","properties":{"name":{"type":"string","maxLength":40},"memory":{"type":"string","maxLength":6000}}},"UpdateDocRequest":{"type":"object","properties":{"baseRevision":{"type":"integer","minimum":1,"description":"The revision you read; a newer one returns 409 with the latest"},"title":{"type":"string","maxLength":200},"markdown":{"type":"string","maxLength":500000}},"required":["baseRevision"]},"UpdateLibraryItemRequest":{"type":"object","properties":{"note":{"type":"string","maxLength":2000},"spaceId":{"type":"string","minLength":1,"maxLength":80}}},"UpdateSpaceRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"icon":{"type":["string","null"],"maxLength":16},"description":{"type":"string","maxLength":300},"position":{"type":"integer","minimum":0,"maximum":10000}}},"WatchCard":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"kind":{"type":"string","enum":["official","community","private"]},"language":{"$ref":"#/components/schemas/Locale"},"title":{"type":"string"},"summary":{"type":"string"},"followerCount":{"type":"number"},"latest":{"type":["object","null"],"properties":{"editionDate":{"type":"string"},"lead":{"type":"string"},"entryCount":{"type":"number"}},"required":["editionDate","lead","entryCount"]},"following":{"type":"boolean"}},"required":["id","slug","kind","language","title","summary","followerCount","latest","following"]},"WatchCreated":{"type":"object","properties":{"taskId":{"type":"string","description":"Follow progress with GET /tasks/{taskId}"},"slug":{"type":"string"},"watchId":{"type":"string"}},"required":["taskId","slug","watchId"]},"WatchPage":{"type":"object","properties":{"watch":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"kind":{"type":"string"},"status":{"type":"string"},"language":{"$ref":"#/components/schemas/Locale"},"title":{"type":"string"},"summary":{"type":"string"},"followerCount":{"type":"number"},"type":{"type":"string","enum":["topic","sources","pages"]},"cadence":{"type":"string","enum":["daily","weekly","off"]},"alerts":{"type":"array","items":{"type":"string"}},"visibility":{"type":"string","enum":["public","unlisted","private"]}},"required":["id","slug","kind","status","language","title","summary","followerCount","type","cadence","alerts","visibility"]},"following":{"type":"boolean"},"spaceId":{"type":["string","null"]},"isOwner":{"type":"boolean"},"contentLanguage":{"$ref":"#/components/schemas/Locale"},"issue":{"type":["object","null"],"properties":{"id":{"type":"string"},"editionDate":{"type":"string"},"lead":{"type":"string"},"coverageFrom":{"description":"ISO 8601 timestamp","type":"string","format":"date-time"},"coverageTo":{"description":"ISO 8601 timestamp","type":"string","format":"date-time"}},"required":["id","editionDate","lead","coverageFrom","coverageTo"]},"entries":{"type":"array","items":{"$ref":"#/components/schemas/BriefEntry"}},"archive":{"type":"array","items":{"type":"object","properties":{"editionDate":{"type":"string"},"entryCount":{"type":"number"}},"required":["editionDate","entryCount"]}},"method":{"type":["object","null"],"properties":{"include":{"type":"array","items":{"type":"string"}},"exclude":{"type":"array","items":{"type":"string"}},"sources":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"url":{"type":["string","null"]},"kind":{"type":"string"},"health":{"type":"string"},"replaced":{"type":"boolean"}},"required":["title","url","kind","health","replaced"]}}},"required":["include","exclude","sources"]}},"required":["watch","following","spaceId","isOwner","contentLanguage","issue","entries","archive","method"]},"WatchSettingsRequest":{"type":"object","properties":{"cadence":{"type":"string","enum":["daily","weekly","off"]},"alerts":{"maxItems":5,"type":"array","items":{"type":"string","minLength":2,"maxLength":200}}}}},"responses":{"BadRequest":{"description":"Invalid input: INVALID_INPUT (with issues), INVALID_JSON, INVALID_CURSOR or INVALID_IDEMPOTENCY_KEY","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"UNAUTHORIZED: no token, or the token is invalid, revoked or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Not found, or not visible to you (e.g. WATCH_NOT_FOUND, DOC_NOT_FOUND)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"IdempotencyInProgress":{"description":"IDEMPOTENCY_IN_PROGRESS: a request with this Idempotency-Key is still running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"IdempotencyMismatch":{"description":"IDEMPOTENCY_MISMATCH: this Idempotency-Key was used with a different request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"RATE_LIMITED: more than 60 requests in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Error":{"description":"Unexpected error: INTERNAL","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}
