Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

3998 lines
107KB

  1. {
  2. "openapi": "3.0.3",
  3. "info": {
  4. "title": "Agent Memory API",
  5. "version": "1.0.0-phase3",
  6. "description": "Universal AI Agent Memory platform, phases 1-3: memories with revisions and verification, sessions with checkpoints, Markdown/text document ingestion with chunk locators, lexical search and recall, health. Authenticate with `Authorization: Bearer <api key>`; the tenant is derived from the key. Anything the caller cannot see is reported as 404. Phase 3: POST /context assembles a budgeted task briefing. Retrieval is hybrid (lexical + embeddings via a local Ollama model and a Qdrant index) and degrades to lexical with a warning. Relevance scores are ranking signals: negated bm25 when lexical, reciprocal-rank-fusion values when hybrid. Learning loop: experiences (POST /sessions/{id}/events), candidates proposed with POST /learn and reviewed by another principal (POST /candidates/{id}/review), evidence (GET /memories/{id}/sources) and feedback on retrieval results (POST /feedback, using the query_id of recall/search/context)."
  7. },
  8. "servers": [
  9. {
  10. "url": "/api/v1"
  11. }
  12. ],
  13. "components": {
  14. "securitySchemes": {
  15. "bearerAuth": {
  16. "type": "http",
  17. "scheme": "bearer"
  18. }
  19. },
  20. "schemas": {
  21. "Error": {
  22. "type": "object",
  23. "properties": {
  24. "error": {
  25. "type": "object",
  26. "properties": {
  27. "code": {
  28. "type": "string"
  29. },
  30. "message": {
  31. "type": "string"
  32. },
  33. "details": {
  34. "type": "array",
  35. "items": {
  36. "type": "string"
  37. }
  38. },
  39. "request_id": {
  40. "type": "string"
  41. }
  42. }
  43. }
  44. }
  45. },
  46. "RememberRequest": {
  47. "type": "object",
  48. "required": [
  49. "namespace_id",
  50. "type",
  51. "title",
  52. "content"
  53. ],
  54. "properties": {
  55. "namespace_id": {
  56. "type": "string",
  57. "format": "uuid"
  58. },
  59. "type": {
  60. "type": "string",
  61. "enum": [
  62. "working",
  63. "episodic",
  64. "semantic",
  65. "procedural",
  66. "preference",
  67. "decision",
  68. "constraint",
  69. "lesson",
  70. "hypothesis",
  71. "goal",
  72. "solution"
  73. ]
  74. },
  75. "title": {
  76. "type": "string",
  77. "maxLength": 200
  78. },
  79. "content": {
  80. "type": "string",
  81. "maxLength": 100000
  82. },
  83. "summary": {
  84. "type": "string",
  85. "maxLength": 2000,
  86. "nullable": true
  87. },
  88. "tags": {
  89. "type": "array",
  90. "items": {
  91. "type": "string",
  92. "maxLength": 64
  93. },
  94. "maxItems": 32
  95. },
  96. "attributes": {
  97. "type": "object",
  98. "description": "Free-form JSON object, max 16 KB"
  99. },
  100. "confidence": {
  101. "type": "number",
  102. "minimum": 0,
  103. "maximum": 1
  104. },
  105. "importance": {
  106. "type": "number",
  107. "minimum": 0,
  108. "maximum": 1
  109. }
  110. }
  111. },
  112. "RememberResponse": {
  113. "type": "object",
  114. "properties": {
  115. "id": {
  116. "type": "string",
  117. "format": "uuid"
  118. },
  119. "revision": {
  120. "type": "integer"
  121. },
  122. "status": {
  123. "type": "string"
  124. },
  125. "verification_status": {
  126. "type": "string"
  127. },
  128. "indexing_status": {
  129. "type": "string",
  130. "example": "not_indexed"
  131. },
  132. "duplicate": {
  133. "type": "boolean",
  134. "description": "true when an identical active memory already existed (HTTP 200)"
  135. }
  136. }
  137. },
  138. "Memory": {
  139. "type": "object",
  140. "properties": {
  141. "id": {
  142. "type": "string"
  143. },
  144. "namespace_id": {
  145. "type": "string"
  146. },
  147. "type": {
  148. "type": "string"
  149. },
  150. "status": {
  151. "type": "string",
  152. "enum": [
  153. "active",
  154. "retired",
  155. "superseded"
  156. ]
  157. },
  158. "current_revision": {
  159. "type": "integer"
  160. },
  161. "revision": {
  162. "type": "integer"
  163. },
  164. "verification_status": {
  165. "type": "string",
  166. "enum": [
  167. "unverified",
  168. "verified",
  169. "disputed",
  170. "rejected"
  171. ]
  172. },
  173. "title": {
  174. "type": "string"
  175. },
  176. "summary": {
  177. "type": "string",
  178. "nullable": true
  179. },
  180. "content": {
  181. "type": "string"
  182. },
  183. "attributes": {
  184. "type": "object",
  185. "nullable": true
  186. },
  187. "tags": {
  188. "type": "array",
  189. "items": {
  190. "type": "string"
  191. }
  192. },
  193. "confidence": {
  194. "type": "number",
  195. "nullable": true
  196. },
  197. "importance": {
  198. "type": "number",
  199. "nullable": true
  200. },
  201. "change_reason": {
  202. "type": "string",
  203. "nullable": true
  204. },
  205. "created_by": {
  206. "type": "string"
  207. },
  208. "created_at": {
  209. "type": "string"
  210. },
  211. "updated_at": {
  212. "type": "string"
  213. }
  214. }
  215. },
  216. "IngestRequest": {
  217. "type": "object",
  218. "required": [
  219. "namespace_id",
  220. "title",
  221. "content"
  222. ],
  223. "properties": {
  224. "namespace_id": {
  225. "type": "string",
  226. "format": "uuid"
  227. },
  228. "title": {
  229. "type": "string",
  230. "maxLength": 200
  231. },
  232. "content": {
  233. "type": "string",
  234. "maxLength": 262144
  235. },
  236. "format": {
  237. "type": "string",
  238. "enum": [
  239. "markdown",
  240. "text"
  241. ],
  242. "default": "markdown"
  243. },
  244. "source_uri": {
  245. "type": "string",
  246. "maxLength": 500,
  247. "description": "Identifier only; never fetched. The same source_uri in a namespace is one document."
  248. },
  249. "async": {
  250. "type": "boolean",
  251. "default": false,
  252. "description": "true: store the job and answer 202 at once; the worker processes it (poll GET /jobs/{id}). false: processed inside the request (201 new revision, 200 unchanged)."
  253. }
  254. }
  255. },
  256. "JobQueued": {
  257. "type": "object",
  258. "properties": {
  259. "job": {
  260. "type": "object",
  261. "properties": {
  262. "id": {
  263. "type": "string",
  264. "format": "uuid"
  265. },
  266. "type": {
  267. "type": "string"
  268. },
  269. "state": {
  270. "type": "string",
  271. "enum": [
  272. "queued"
  273. ]
  274. }
  275. }
  276. },
  277. "status_url": {
  278. "type": "string"
  279. }
  280. }
  281. },
  282. "Job": {
  283. "type": "object",
  284. "properties": {
  285. "id": {
  286. "type": "string",
  287. "format": "uuid"
  288. },
  289. "type": {
  290. "type": "string",
  291. "enum": [
  292. "ingest"
  293. ]
  294. },
  295. "state": {
  296. "type": "string",
  297. "enum": [
  298. "queued",
  299. "running",
  300. "succeeded",
  301. "failed"
  302. ]
  303. },
  304. "attempts": {
  305. "type": "integer"
  306. },
  307. "max_attempts": {
  308. "type": "integer"
  309. },
  310. "auto_retry": {
  311. "type": "boolean",
  312. "description": "true when the worker will retry this failed job by itself"
  313. },
  314. "document_id": {
  315. "type": "string",
  316. "nullable": true
  317. },
  318. "error_code": {
  319. "type": "string",
  320. "nullable": true,
  321. "description": "internal_error (retried automatically), invalid_payload, namespace_not_found, forbidden, interrupted"
  322. },
  323. "error_message": {
  324. "type": "string",
  325. "nullable": true
  326. },
  327. "created_at": {
  328. "type": "string"
  329. },
  330. "updated_at": {
  331. "type": "string"
  332. }
  333. }
  334. },
  335. "IngestResponse": {
  336. "type": "object",
  337. "properties": {
  338. "job": {
  339. "type": "object",
  340. "properties": {
  341. "id": {
  342. "type": "string"
  343. },
  344. "type": {
  345. "type": "string"
  346. },
  347. "state": {
  348. "type": "string"
  349. }
  350. }
  351. },
  352. "document_id": {
  353. "type": "string"
  354. },
  355. "revision": {
  356. "type": "integer"
  357. },
  358. "chunk_count": {
  359. "type": "integer"
  360. },
  361. "unchanged": {
  362. "type": "boolean",
  363. "description": "true when identical text was already the current revision (no new chunks)"
  364. },
  365. "indexing_status": {
  366. "type": "string",
  367. "example": "lexical_indexed"
  368. }
  369. }
  370. },
  371. "SearchRequest": {
  372. "type": "object",
  373. "required": [
  374. "query"
  375. ],
  376. "properties": {
  377. "query": {
  378. "type": "string",
  379. "maxLength": 1000
  380. },
  381. "namespace_ids": {
  382. "type": "array",
  383. "items": {
  384. "type": "string",
  385. "format": "uuid"
  386. }
  387. },
  388. "max_results": {
  389. "type": "integer",
  390. "minimum": 1,
  391. "maximum": 50
  392. },
  393. "detail_level": {
  394. "type": "string",
  395. "enum": [
  396. "full",
  397. "snippet"
  398. ]
  399. }
  400. }
  401. },
  402. "RecallRequest": {
  403. "type": "object",
  404. "required": [
  405. "query"
  406. ],
  407. "properties": {
  408. "query": {
  409. "type": "string",
  410. "maxLength": 1000
  411. },
  412. "namespace_ids": {
  413. "type": "array",
  414. "items": {
  415. "type": "string",
  416. "format": "uuid"
  417. }
  418. },
  419. "types": {
  420. "type": "array",
  421. "items": {
  422. "type": "string"
  423. }
  424. },
  425. "tags": {
  426. "type": "array",
  427. "items": {
  428. "type": "string"
  429. }
  430. },
  431. "max_results": {
  432. "type": "integer"
  433. },
  434. "detail_level": {
  435. "type": "string",
  436. "enum": [
  437. "full",
  438. "summary"
  439. ]
  440. },
  441. "verification_filter": {
  442. "type": "string",
  443. "enum": [
  444. "verified_only",
  445. "include_unverified"
  446. ],
  447. "default": "verified_only"
  448. }
  449. }
  450. },
  451. "VerifyRequest": {
  452. "type": "object",
  453. "required": [
  454. "result",
  455. "method",
  456. "revision"
  457. ],
  458. "properties": {
  459. "result": {
  460. "type": "string",
  461. "enum": [
  462. "verified",
  463. "disputed",
  464. "rejected"
  465. ]
  466. },
  467. "method": {
  468. "type": "string",
  469. "maxLength": 200
  470. },
  471. "notes": {
  472. "type": "string",
  473. "maxLength": 2000
  474. },
  475. "revision": {
  476. "type": "integer",
  477. "description": "Must be the current revision"
  478. }
  479. }
  480. },
  481. "SaveStateRequest": {
  482. "type": "object",
  483. "required": [
  484. "state"
  485. ],
  486. "properties": {
  487. "state": {
  488. "type": "object",
  489. "description": "Structured working state, max 64 KB"
  490. },
  491. "expected_revision": {
  492. "type": "integer"
  493. }
  494. }
  495. },
  496. "ContextRequest": {
  497. "type": "object",
  498. "required": [
  499. "task"
  500. ],
  501. "properties": {
  502. "task": {
  503. "type": "string",
  504. "maxLength": 2000,
  505. "description": "What the agent is about to do; used as the lexical query for decisions, lessons, knowledge and references."
  506. },
  507. "namespace_ids": {
  508. "type": "array",
  509. "items": {
  510. "type": "string"
  511. },
  512. "description": "Restrict to these namespaces (intersected with what the caller can read)."
  513. },
  514. "session_id": {
  515. "type": "string",
  516. "description": "Include the session's latest checkpoint as working_state. 404 when the session is not visible."
  517. },
  518. "include": {
  519. "type": "array",
  520. "items": {
  521. "type": "string",
  522. "enum": [
  523. "constraints",
  524. "preferences",
  525. "decisions",
  526. "lessons",
  527. "knowledge",
  528. "references",
  529. "working_state"
  530. ]
  531. },
  532. "description": "Sections to assemble (default all). Constraints and conflicts are always included."
  533. },
  534. "verification_filter": {
  535. "type": "string",
  536. "enum": [
  537. "verified_only",
  538. "include_unverified"
  539. ],
  540. "default": "verified_only"
  541. },
  542. "detail_level": {
  543. "type": "string",
  544. "enum": [
  545. "full",
  546. "summary"
  547. ],
  548. "default": "full",
  549. "description": "summary returns the stored summary (or first 240 characters); constraints are always full."
  550. },
  551. "max_context_tokens": {
  552. "type": "integer",
  553. "minimum": 100,
  554. "maximum": 32000,
  555. "default": 4000
  556. },
  557. "max_items": {
  558. "type": "integer",
  559. "minimum": 1,
  560. "maximum": 50,
  561. "default": 10,
  562. "description": "Per-section cap for conflicts, decisions, lessons, knowledge and unverified (preferences: 50)."
  563. },
  564. "max_references": {
  565. "type": "integer",
  566. "minimum": 0,
  567. "maximum": 20,
  568. "default": 5
  569. },
  570. "format": {
  571. "type": "string",
  572. "enum": [
  573. "structured"
  574. ],
  575. "default": "structured"
  576. }
  577. },
  578. "example": {
  579. "task": "Implement a customer repository",
  580. "session_id": "<session id>",
  581. "include": [
  582. "constraints",
  583. "decisions",
  584. "preferences",
  585. "lessons",
  586. "references",
  587. "working_state"
  588. ],
  589. "max_context_tokens": 4000
  590. }
  591. },
  592. "ContextResponse": {
  593. "type": "object",
  594. "description": "Sections in budget priority order: constraints (required), working_state, preferences, conflicts, decisions, lessons, knowledge, references, unverified. Memory items carry id, revision, type, namespace_id, title, content|summary, verification_status, content_trust (verified_memory|unverified_memory|disputed_memory), authority (policy for verified constraints), tags, confidence, importance, relevance_score (lexical matches), valid_until, provenance {created_by, updated_at} and token_estimate. References carry chunk/document ids, locator, content and content_trust untrusted_reference.",
  595. "properties": {
  596. "context_id": {
  597. "type": "string"
  598. },
  599. "task": {
  600. "type": "string"
  601. },
  602. "strategy": {
  603. "type": "string",
  604. "enum": [
  605. "hybrid",
  606. "lexical"
  607. ],
  608. "description": "hybrid when semantic retrieval ran for every section; lexical (with a warning) when it is not configured or unavailable"
  609. },
  610. "budget": {
  611. "type": "object",
  612. "properties": {
  613. "max_context_tokens": {
  614. "type": "integer"
  615. },
  616. "used_tokens": {
  617. "type": "integer"
  618. },
  619. "counting_method": {
  620. "type": "string",
  621. "example": "estimate_chars_div_4"
  622. },
  623. "complete": {
  624. "type": "boolean",
  625. "description": "False when not every applicable constraint/preference could be considered; do not treat the briefing as complete."
  626. },
  627. "truncated": {
  628. "type": "boolean",
  629. "description": "True when items were left out to fit the budget."
  630. }
  631. }
  632. },
  633. "omitted": {
  634. "type": "object",
  635. "properties": {
  636. "over_budget": {
  637. "type": "integer"
  638. },
  639. "over_limit": {
  640. "type": "integer"
  641. },
  642. "duplicates": {
  643. "type": "integer"
  644. },
  645. "unverified_excluded": {
  646. "type": "integer"
  647. }
  648. }
  649. },
  650. "constraints": {
  651. "type": "array",
  652. "items": {
  653. "type": "object"
  654. }
  655. },
  656. "working_state": {
  657. "type": "object",
  658. "nullable": true
  659. },
  660. "preferences": {
  661. "type": "array",
  662. "items": {
  663. "type": "object"
  664. }
  665. },
  666. "conflicts": {
  667. "type": "array",
  668. "items": {
  669. "type": "object"
  670. }
  671. },
  672. "decisions": {
  673. "type": "array",
  674. "items": {
  675. "type": "object"
  676. }
  677. },
  678. "lessons": {
  679. "type": "array",
  680. "items": {
  681. "type": "object"
  682. }
  683. },
  684. "knowledge": {
  685. "type": "array",
  686. "items": {
  687. "type": "object"
  688. }
  689. },
  690. "references": {
  691. "type": "array",
  692. "items": {
  693. "type": "object"
  694. }
  695. },
  696. "unverified": {
  697. "type": "array",
  698. "items": {
  699. "type": "object"
  700. },
  701. "description": "Only with verification_filter include_unverified."
  702. },
  703. "warnings": {
  704. "type": "array",
  705. "items": {
  706. "type": "string"
  707. }
  708. },
  709. "query_id": {
  710. "type": "string",
  711. "description": "Pass to POST /feedback to rate an included memory or reference"
  712. }
  713. }
  714. },
  715. "EvidenceInput": {
  716. "type": "object",
  717. "required": [
  718. "kind",
  719. "id"
  720. ],
  721. "properties": {
  722. "kind": {
  723. "type": "string",
  724. "enum": [
  725. "experience",
  726. "chunk",
  727. "memory",
  728. "document"
  729. ]
  730. },
  731. "id": {
  732. "type": "string",
  733. "format": "uuid"
  734. },
  735. "role": {
  736. "type": "string",
  737. "enum": [
  738. "supports",
  739. "contradicts",
  740. "context"
  741. ],
  742. "default": "supports"
  743. },
  744. "excerpt": {
  745. "type": "string",
  746. "maxLength": 2000
  747. }
  748. }
  749. },
  750. "ExperienceRequest": {
  751. "type": "object",
  752. "required": [
  753. "task",
  754. "outcome"
  755. ],
  756. "properties": {
  757. "task": {
  758. "type": "string",
  759. "maxLength": 2000
  760. },
  761. "outcome": {
  762. "type": "string",
  763. "enum": [
  764. "success",
  765. "failure",
  766. "partial",
  767. "unknown"
  768. ]
  769. },
  770. "problem": {
  771. "type": "string",
  772. "maxLength": 4000
  773. },
  774. "action": {
  775. "type": "string",
  776. "maxLength": 4000
  777. },
  778. "result": {
  779. "type": "string",
  780. "maxLength": 4000
  781. },
  782. "environment": {
  783. "type": "object",
  784. "description": "Free-form JSON object, max 16 KB"
  785. }
  786. }
  787. },
  788. "Experience": {
  789. "type": "object",
  790. "properties": {
  791. "id": {
  792. "type": "string"
  793. },
  794. "task": {
  795. "type": "string"
  796. },
  797. "problem": {
  798. "type": "string"
  799. },
  800. "action": {
  801. "type": "string"
  802. },
  803. "result": {
  804. "type": "string"
  805. },
  806. "outcome": {
  807. "type": "string"
  808. },
  809. "recorded_by": {
  810. "type": "string"
  811. },
  812. "created_at": {
  813. "type": "string"
  814. },
  815. "environment": {
  816. "type": "object",
  817. "nullable": true
  818. }
  819. }
  820. },
  821. "LearnRequest": {
  822. "type": "object",
  823. "required": [
  824. "namespace_id",
  825. "type",
  826. "title",
  827. "content"
  828. ],
  829. "properties": {
  830. "namespace_id": {
  831. "type": "string",
  832. "format": "uuid"
  833. },
  834. "type": {
  835. "type": "string"
  836. },
  837. "title": {
  838. "type": "string",
  839. "maxLength": 200
  840. },
  841. "content": {
  842. "type": "string",
  843. "maxLength": 100000
  844. },
  845. "summary": {
  846. "type": "string",
  847. "maxLength": 2000
  848. },
  849. "tags": {
  850. "type": "array",
  851. "items": {
  852. "type": "string"
  853. },
  854. "maxItems": 32
  855. },
  856. "confidence": {
  857. "type": "number",
  858. "minimum": 0,
  859. "maximum": 1
  860. },
  861. "target_memory_id": {
  862. "type": "string",
  863. "format": "uuid",
  864. "description": "Propose a new revision of this memory (same namespace and type)"
  865. },
  866. "base_revision": {
  867. "type": "integer",
  868. "description": "Required with target_memory_id: the revision the proposal is based on"
  869. },
  870. "evidence": {
  871. "type": "array",
  872. "maxItems": 20,
  873. "items": {
  874. "$ref": "#/components/schemas/EvidenceInput"
  875. }
  876. }
  877. }
  878. },
  879. "Candidate": {
  880. "type": "object",
  881. "properties": {
  882. "id": {
  883. "type": "string"
  884. },
  885. "namespace_id": {
  886. "type": "string"
  887. },
  888. "type": {
  889. "type": "string"
  890. },
  891. "title": {
  892. "type": "string"
  893. },
  894. "summary": {
  895. "type": "string",
  896. "nullable": true
  897. },
  898. "content": {
  899. "type": "string",
  900. "description": "Detail only"
  901. },
  902. "tags": {
  903. "type": "array",
  904. "items": {
  905. "type": "string"
  906. }
  907. },
  908. "confidence": {
  909. "type": "number",
  910. "nullable": true
  911. },
  912. "target_memory_id": {
  913. "type": "string",
  914. "nullable": true
  915. },
  916. "base_revision": {
  917. "type": "integer",
  918. "nullable": true
  919. },
  920. "state": {
  921. "type": "string",
  922. "enum": [
  923. "proposed",
  924. "accepted",
  925. "rejected"
  926. ]
  927. },
  928. "author": {
  929. "type": "string"
  930. },
  931. "reviewer": {
  932. "type": "string",
  933. "nullable": true
  934. },
  935. "review_notes": {
  936. "type": "string",
  937. "nullable": true
  938. },
  939. "resulting_memory_id": {
  940. "type": "string",
  941. "nullable": true
  942. },
  943. "resulting_revision": {
  944. "type": "integer",
  945. "nullable": true
  946. },
  947. "created_at": {
  948. "type": "string"
  949. },
  950. "reviewed_at": {
  951. "type": "string",
  952. "nullable": true
  953. },
  954. "content_trust": {
  955. "type": "string",
  956. "enum": [
  957. "proposed_knowledge"
  958. ]
  959. },
  960. "evidence": {
  961. "type": "array",
  962. "items": {
  963. "$ref": "#/components/schemas/EvidenceItem"
  964. },
  965. "description": "Detail only"
  966. }
  967. }
  968. },
  969. "EvidenceItem": {
  970. "type": "object",
  971. "properties": {
  972. "kind": {
  973. "type": "string"
  974. },
  975. "id": {
  976. "type": "string",
  977. "description": "Omitted when available is false"
  978. },
  979. "revision": {
  980. "type": "integer",
  981. "nullable": true,
  982. "description": "Target revision pinned when the link was made"
  983. },
  984. "available": {
  985. "type": "boolean",
  986. "description": "False when the target is gone or the caller cannot read it"
  987. },
  988. "role": {
  989. "type": "string"
  990. },
  991. "excerpt": {
  992. "type": "string",
  993. "nullable": true
  994. },
  995. "content_trust": {
  996. "type": "string",
  997. "enum": [
  998. "evidence",
  999. "untrusted_reference"
  1000. ]
  1001. }
  1002. }
  1003. },
  1004. "ReviewRequest": {
  1005. "type": "object",
  1006. "required": [
  1007. "decision"
  1008. ],
  1009. "properties": {
  1010. "decision": {
  1011. "type": "string",
  1012. "enum": [
  1013. "accept",
  1014. "reject"
  1015. ]
  1016. },
  1017. "notes": {
  1018. "type": "string",
  1019. "maxLength": 2000
  1020. },
  1021. "verify": {
  1022. "type": "boolean",
  1023. "default": false,
  1024. "description": "Accept as verified (records a verification by the reviewer)"
  1025. }
  1026. }
  1027. },
  1028. "Sources": {
  1029. "type": "object",
  1030. "properties": {
  1031. "memory_id": {
  1032. "type": "string"
  1033. },
  1034. "revision": {
  1035. "type": "integer"
  1036. },
  1037. "current_revision": {
  1038. "type": "integer"
  1039. },
  1040. "from_candidate": {
  1041. "type": "string",
  1042. "nullable": true
  1043. },
  1044. "evidence": {
  1045. "type": "array",
  1046. "items": {
  1047. "$ref": "#/components/schemas/EvidenceItem"
  1048. }
  1049. },
  1050. "verifications": {
  1051. "type": "array",
  1052. "items": {
  1053. "type": "object",
  1054. "properties": {
  1055. "method": {
  1056. "type": "string"
  1057. },
  1058. "result": {
  1059. "type": "string"
  1060. },
  1061. "notes": {
  1062. "type": "string"
  1063. },
  1064. "reviewer": {
  1065. "type": "string"
  1066. },
  1067. "created_at": {
  1068. "type": "string"
  1069. }
  1070. }
  1071. }
  1072. }
  1073. }
  1074. },
  1075. "FeedbackRequest": {
  1076. "type": "object",
  1077. "required": [
  1078. "query_id",
  1079. "result_id",
  1080. "usefulness"
  1081. ],
  1082. "properties": {
  1083. "query_id": {
  1084. "type": "string",
  1085. "description": "query_id returned by recall, search or context"
  1086. },
  1087. "result_id": {
  1088. "type": "string",
  1089. "format": "uuid",
  1090. "description": "Memory id or chunk id from that response"
  1091. },
  1092. "usefulness": {
  1093. "type": "string",
  1094. "enum": [
  1095. "useful",
  1096. "not_useful",
  1097. "incorrect",
  1098. "harmful"
  1099. ]
  1100. },
  1101. "comment": {
  1102. "type": "string",
  1103. "maxLength": 2000
  1104. }
  1105. }
  1106. },
  1107. "Feedback": {
  1108. "type": "object",
  1109. "properties": {
  1110. "id": {
  1111. "type": "string"
  1112. },
  1113. "query_id": {
  1114. "type": "string"
  1115. },
  1116. "target_kind": {
  1117. "type": "string",
  1118. "enum": [
  1119. "memory",
  1120. "chunk"
  1121. ]
  1122. },
  1123. "target_id": {
  1124. "type": "string"
  1125. },
  1126. "target_revision": {
  1127. "type": "integer"
  1128. },
  1129. "usefulness": {
  1130. "type": "string"
  1131. }
  1132. }
  1133. },
  1134. "ExportRequest": {
  1135. "type": "object",
  1136. "properties": {
  1137. "namespace_ids": {
  1138. "type": "array",
  1139. "items": {
  1140. "type": "string",
  1141. "format": "uuid"
  1142. },
  1143. "description": "Limit the export to these namespaces (unreadable ones are skipped silently). Default: all readable namespaces."
  1144. }
  1145. }
  1146. },
  1147. "Export": {
  1148. "type": "object",
  1149. "required": [
  1150. "format",
  1151. "schema_version",
  1152. "data",
  1153. "integrity"
  1154. ],
  1155. "properties": {
  1156. "format": {
  1157. "type": "string",
  1158. "enum": [
  1159. "agent-memory-export"
  1160. ]
  1161. },
  1162. "schema_version": {
  1163. "type": "integer",
  1164. "enum": [
  1165. 1
  1166. ]
  1167. },
  1168. "exported_at": {
  1169. "type": "string"
  1170. },
  1171. "data": {
  1172. "type": "object",
  1173. "description": "namespaces [{path}], memories [{id, namespace, type, lifecycle_status, valid_from, valid_until, created_by, created_at, updated_at, current_revision, revisions[], verifications[]}], documents [{id, namespace, source_uri, format, title, current_revision, created_by, created_at, updated_at, revisions[{..., chunks[]}]}], evidence_links [{id, owner_kind, owner_id, owner_revision, target_kind, target_id, target_revision, role, excerpt, created_by, created_at}]. Not in version 1: sessions, experiences, candidates, feedback, retrieval telemetry, audit events.",
  1174. "properties": {
  1175. "namespaces": {
  1176. "type": "array",
  1177. "items": {
  1178. "type": "object"
  1179. }
  1180. },
  1181. "memories": {
  1182. "type": "array",
  1183. "items": {
  1184. "type": "object"
  1185. }
  1186. },
  1187. "documents": {
  1188. "type": "array",
  1189. "items": {
  1190. "type": "object"
  1191. }
  1192. },
  1193. "evidence_links": {
  1194. "type": "array",
  1195. "items": {
  1196. "type": "object"
  1197. }
  1198. }
  1199. }
  1200. },
  1201. "counts": {
  1202. "type": "object",
  1203. "additionalProperties": {
  1204. "type": "integer"
  1205. },
  1206. "description": "namespaces, memories, memory_revisions, verifications, documents, document_revisions, chunks, evidence_links, evidence_links_omitted"
  1207. },
  1208. "integrity": {
  1209. "type": "object",
  1210. "properties": {
  1211. "algorithm": {
  1212. "type": "string",
  1213. "enum": [
  1214. "sha256"
  1215. ]
  1216. },
  1217. "digest": {
  1218. "type": "string",
  1219. "description": "Hex SHA-256 of the exact UTF-8 text of the data value as it appears in the document; any reformatting breaks it."
  1220. }
  1221. }
  1222. }
  1223. }
  1224. },
  1225. "ImportResult": {
  1226. "type": "object",
  1227. "properties": {
  1228. "imported": {
  1229. "type": "object",
  1230. "additionalProperties": {
  1231. "type": "integer"
  1232. },
  1233. "description": "namespaces, memories, memory_revisions, verifications, documents, document_revisions, chunks, evidence_links"
  1234. },
  1235. "indexing": {
  1236. "type": "object",
  1237. "properties": {
  1238. "lexical": {
  1239. "type": "string"
  1240. },
  1241. "semantic": {
  1242. "type": "string"
  1243. }
  1244. }
  1245. }
  1246. }
  1247. }
  1248. }
  1249. },
  1250. "paths": {
  1251. "/remember": {
  1252. "post": {
  1253. "summary": "Create a memory",
  1254. "security": [
  1255. {
  1256. "bearerAuth": []
  1257. }
  1258. ],
  1259. "parameters": [
  1260. {
  1261. "name": "Idempotency-Key",
  1262. "in": "header",
  1263. "required": false,
  1264. "description": "Replays the stored response for an identical body; a different body with the same key is 409.",
  1265. "schema": {
  1266. "type": "string",
  1267. "maxLength": 200
  1268. }
  1269. }
  1270. ],
  1271. "requestBody": {
  1272. "required": true,
  1273. "content": {
  1274. "application/json": {
  1275. "schema": {
  1276. "$ref": "#/components/schemas/RememberRequest"
  1277. }
  1278. }
  1279. }
  1280. },
  1281. "responses": {
  1282. "201": {
  1283. "description": "Created",
  1284. "content": {
  1285. "application/json": {
  1286. "schema": {
  1287. "$ref": "#/components/schemas/RememberResponse"
  1288. }
  1289. }
  1290. }
  1291. },
  1292. "200": {
  1293. "description": "Exact duplicate (or idempotent replay of a 200)",
  1294. "content": {
  1295. "application/json": {
  1296. "schema": {
  1297. "$ref": "#/components/schemas/RememberResponse"
  1298. }
  1299. }
  1300. }
  1301. },
  1302. "400": {
  1303. "description": "Invalid JSON / body",
  1304. "content": {
  1305. "application/json": {
  1306. "schema": {
  1307. "$ref": "#/components/schemas/Error"
  1308. }
  1309. }
  1310. }
  1311. },
  1312. "409": {
  1313. "description": "Idempotency-Key reused with a different body",
  1314. "content": {
  1315. "application/json": {
  1316. "schema": {
  1317. "$ref": "#/components/schemas/Error"
  1318. }
  1319. }
  1320. }
  1321. },
  1322. "422": {
  1323. "description": "Validation failed",
  1324. "content": {
  1325. "application/json": {
  1326. "schema": {
  1327. "$ref": "#/components/schemas/Error"
  1328. }
  1329. }
  1330. }
  1331. },
  1332. "401": {
  1333. "description": "Missing, invalid, revoked or expired API key",
  1334. "content": {
  1335. "application/json": {
  1336. "schema": {
  1337. "$ref": "#/components/schemas/Error"
  1338. }
  1339. }
  1340. }
  1341. },
  1342. "404": {
  1343. "description": "Not found or not visible to the caller",
  1344. "content": {
  1345. "application/json": {
  1346. "schema": {
  1347. "$ref": "#/components/schemas/Error"
  1348. }
  1349. }
  1350. }
  1351. },
  1352. "500": {
  1353. "description": "Internal error",
  1354. "content": {
  1355. "application/json": {
  1356. "schema": {
  1357. "$ref": "#/components/schemas/Error"
  1358. }
  1359. }
  1360. }
  1361. }
  1362. }
  1363. }
  1364. },
  1365. "/memories": {
  1366. "get": {
  1367. "summary": "List memories (newest first)",
  1368. "security": [
  1369. {
  1370. "bearerAuth": []
  1371. }
  1372. ],
  1373. "parameters": [
  1374. {
  1375. "name": "namespace_id",
  1376. "in": "query",
  1377. "schema": {
  1378. "type": "string",
  1379. "format": "uuid"
  1380. }
  1381. },
  1382. {
  1383. "name": "type",
  1384. "in": "query",
  1385. "schema": {
  1386. "type": "string"
  1387. }
  1388. },
  1389. {
  1390. "name": "status",
  1391. "in": "query",
  1392. "schema": {
  1393. "type": "string",
  1394. "enum": [
  1395. "active",
  1396. "retired",
  1397. "superseded",
  1398. "all"
  1399. ],
  1400. "default": "active"
  1401. }
  1402. },
  1403. {
  1404. "name": "verification_status",
  1405. "in": "query",
  1406. "schema": {
  1407. "type": "string",
  1408. "enum": [
  1409. "unverified",
  1410. "verified",
  1411. "disputed",
  1412. "rejected"
  1413. ]
  1414. }
  1415. },
  1416. {
  1417. "name": "limit",
  1418. "in": "query",
  1419. "schema": {
  1420. "type": "integer",
  1421. "minimum": 1,
  1422. "maximum": 100,
  1423. "default": 20
  1424. }
  1425. },
  1426. {
  1427. "name": "cursor",
  1428. "in": "query",
  1429. "description": "next_cursor from the previous page",
  1430. "schema": {
  1431. "type": "string"
  1432. }
  1433. }
  1434. ],
  1435. "responses": {
  1436. "200": {
  1437. "description": "Page of memories",
  1438. "content": {
  1439. "application/json": {
  1440. "schema": {
  1441. "type": "object",
  1442. "properties": {
  1443. "data": {
  1444. "type": "array",
  1445. "items": {
  1446. "$ref": "#/components/schemas/Memory"
  1447. }
  1448. },
  1449. "next_cursor": {
  1450. "type": "string",
  1451. "nullable": true
  1452. }
  1453. }
  1454. }
  1455. }
  1456. }
  1457. },
  1458. "400": {
  1459. "description": "Invalid cursor",
  1460. "content": {
  1461. "application/json": {
  1462. "schema": {
  1463. "$ref": "#/components/schemas/Error"
  1464. }
  1465. }
  1466. }
  1467. },
  1468. "422": {
  1469. "description": "Invalid filter",
  1470. "content": {
  1471. "application/json": {
  1472. "schema": {
  1473. "$ref": "#/components/schemas/Error"
  1474. }
  1475. }
  1476. }
  1477. },
  1478. "401": {
  1479. "description": "Missing, invalid, revoked or expired API key",
  1480. "content": {
  1481. "application/json": {
  1482. "schema": {
  1483. "$ref": "#/components/schemas/Error"
  1484. }
  1485. }
  1486. }
  1487. },
  1488. "404": {
  1489. "description": "Not found or not visible to the caller",
  1490. "content": {
  1491. "application/json": {
  1492. "schema": {
  1493. "$ref": "#/components/schemas/Error"
  1494. }
  1495. }
  1496. }
  1497. },
  1498. "500": {
  1499. "description": "Internal error",
  1500. "content": {
  1501. "application/json": {
  1502. "schema": {
  1503. "$ref": "#/components/schemas/Error"
  1504. }
  1505. }
  1506. }
  1507. }
  1508. }
  1509. }
  1510. },
  1511. "/memories/{id}": {
  1512. "get": {
  1513. "summary": "Get a memory (optionally an older revision)",
  1514. "security": [
  1515. {
  1516. "bearerAuth": []
  1517. }
  1518. ],
  1519. "parameters": [
  1520. {
  1521. "name": "id",
  1522. "in": "path",
  1523. "required": true,
  1524. "schema": {
  1525. "type": "string",
  1526. "format": "uuid"
  1527. }
  1528. },
  1529. {
  1530. "name": "revision",
  1531. "in": "query",
  1532. "schema": {
  1533. "type": "integer"
  1534. }
  1535. }
  1536. ],
  1537. "responses": {
  1538. "200": {
  1539. "description": "The memory",
  1540. "content": {
  1541. "application/json": {
  1542. "schema": {
  1543. "type": "object",
  1544. "properties": {
  1545. "data": {
  1546. "$ref": "#/components/schemas/Memory"
  1547. }
  1548. }
  1549. }
  1550. }
  1551. }
  1552. },
  1553. "401": {
  1554. "description": "Missing, invalid, revoked or expired API key",
  1555. "content": {
  1556. "application/json": {
  1557. "schema": {
  1558. "$ref": "#/components/schemas/Error"
  1559. }
  1560. }
  1561. }
  1562. },
  1563. "404": {
  1564. "description": "Not found or not visible to the caller",
  1565. "content": {
  1566. "application/json": {
  1567. "schema": {
  1568. "$ref": "#/components/schemas/Error"
  1569. }
  1570. }
  1571. }
  1572. },
  1573. "500": {
  1574. "description": "Internal error",
  1575. "content": {
  1576. "application/json": {
  1577. "schema": {
  1578. "$ref": "#/components/schemas/Error"
  1579. }
  1580. }
  1581. }
  1582. }
  1583. }
  1584. },
  1585. "patch": {
  1586. "summary": "Correct a memory: creates the next revision, unverified",
  1587. "security": [
  1588. {
  1589. "bearerAuth": []
  1590. }
  1591. ],
  1592. "parameters": [
  1593. {
  1594. "name": "id",
  1595. "in": "path",
  1596. "required": true,
  1597. "schema": {
  1598. "type": "string",
  1599. "format": "uuid"
  1600. }
  1601. },
  1602. {
  1603. "name": "If-Match",
  1604. "in": "header",
  1605. "required": false,
  1606. "description": "Current revision number (quoted ETag form accepted). Required unless expected_revision is in the body.",
  1607. "schema": {
  1608. "type": "string"
  1609. }
  1610. }
  1611. ],
  1612. "requestBody": {
  1613. "required": true,
  1614. "content": {
  1615. "application/json": {
  1616. "schema": {
  1617. "type": "object",
  1618. "properties": {
  1619. "title": {
  1620. "type": "string"
  1621. },
  1622. "summary": {
  1623. "type": "string"
  1624. },
  1625. "content": {
  1626. "type": "string"
  1627. },
  1628. "tags": {
  1629. "type": "array",
  1630. "items": {
  1631. "type": "string"
  1632. }
  1633. },
  1634. "attributes": {
  1635. "type": "object"
  1636. },
  1637. "confidence": {
  1638. "type": "number"
  1639. },
  1640. "importance": {
  1641. "type": "number"
  1642. },
  1643. "change_reason": {
  1644. "type": "string"
  1645. },
  1646. "expected_revision": {
  1647. "type": "integer"
  1648. }
  1649. }
  1650. }
  1651. }
  1652. }
  1653. },
  1654. "responses": {
  1655. "200": {
  1656. "description": "New revision",
  1657. "content": {
  1658. "application/json": {
  1659. "schema": {
  1660. "$ref": "#/components/schemas/RememberResponse"
  1661. }
  1662. }
  1663. }
  1664. },
  1665. "400": {
  1666. "description": "Bad body / revision",
  1667. "content": {
  1668. "application/json": {
  1669. "schema": {
  1670. "$ref": "#/components/schemas/Error"
  1671. }
  1672. }
  1673. }
  1674. },
  1675. "409": {
  1676. "description": "Memory is not active",
  1677. "content": {
  1678. "application/json": {
  1679. "schema": {
  1680. "$ref": "#/components/schemas/Error"
  1681. }
  1682. }
  1683. }
  1684. },
  1685. "412": {
  1686. "description": "Stale revision (ETag header carries the current one)",
  1687. "content": {
  1688. "application/json": {
  1689. "schema": {
  1690. "$ref": "#/components/schemas/Error"
  1691. }
  1692. }
  1693. }
  1694. },
  1695. "422": {
  1696. "description": "Validation failed",
  1697. "content": {
  1698. "application/json": {
  1699. "schema": {
  1700. "$ref": "#/components/schemas/Error"
  1701. }
  1702. }
  1703. }
  1704. },
  1705. "428": {
  1706. "description": "If-Match missing",
  1707. "content": {
  1708. "application/json": {
  1709. "schema": {
  1710. "$ref": "#/components/schemas/Error"
  1711. }
  1712. }
  1713. }
  1714. },
  1715. "401": {
  1716. "description": "Missing, invalid, revoked or expired API key",
  1717. "content": {
  1718. "application/json": {
  1719. "schema": {
  1720. "$ref": "#/components/schemas/Error"
  1721. }
  1722. }
  1723. }
  1724. },
  1725. "404": {
  1726. "description": "Not found or not visible to the caller",
  1727. "content": {
  1728. "application/json": {
  1729. "schema": {
  1730. "$ref": "#/components/schemas/Error"
  1731. }
  1732. }
  1733. }
  1734. },
  1735. "500": {
  1736. "description": "Internal error",
  1737. "content": {
  1738. "application/json": {
  1739. "schema": {
  1740. "$ref": "#/components/schemas/Error"
  1741. }
  1742. }
  1743. }
  1744. }
  1745. }
  1746. },
  1747. "delete": {
  1748. "summary": "Forget: permanently delete the memory and its revisions (needs delete permission)",
  1749. "security": [
  1750. {
  1751. "bearerAuth": []
  1752. }
  1753. ],
  1754. "parameters": [
  1755. {
  1756. "name": "id",
  1757. "in": "path",
  1758. "required": true,
  1759. "schema": {
  1760. "type": "string",
  1761. "format": "uuid"
  1762. }
  1763. }
  1764. ],
  1765. "responses": {
  1766. "200": {
  1767. "description": "Deleted"
  1768. },
  1769. "401": {
  1770. "description": "Missing, invalid, revoked or expired API key",
  1771. "content": {
  1772. "application/json": {
  1773. "schema": {
  1774. "$ref": "#/components/schemas/Error"
  1775. }
  1776. }
  1777. }
  1778. },
  1779. "404": {
  1780. "description": "Not found or not visible to the caller",
  1781. "content": {
  1782. "application/json": {
  1783. "schema": {
  1784. "$ref": "#/components/schemas/Error"
  1785. }
  1786. }
  1787. }
  1788. },
  1789. "500": {
  1790. "description": "Internal error",
  1791. "content": {
  1792. "application/json": {
  1793. "schema": {
  1794. "$ref": "#/components/schemas/Error"
  1795. }
  1796. }
  1797. }
  1798. }
  1799. }
  1800. }
  1801. },
  1802. "/memories/{id}/retire": {
  1803. "post": {
  1804. "summary": "Retire: exclude from ordinary listing",
  1805. "security": [
  1806. {
  1807. "bearerAuth": []
  1808. }
  1809. ],
  1810. "parameters": [
  1811. {
  1812. "name": "id",
  1813. "in": "path",
  1814. "required": true,
  1815. "schema": {
  1816. "type": "string",
  1817. "format": "uuid"
  1818. }
  1819. }
  1820. ],
  1821. "responses": {
  1822. "200": {
  1823. "description": "Retired"
  1824. },
  1825. "401": {
  1826. "description": "Missing, invalid, revoked or expired API key",
  1827. "content": {
  1828. "application/json": {
  1829. "schema": {
  1830. "$ref": "#/components/schemas/Error"
  1831. }
  1832. }
  1833. }
  1834. },
  1835. "404": {
  1836. "description": "Not found or not visible to the caller",
  1837. "content": {
  1838. "application/json": {
  1839. "schema": {
  1840. "$ref": "#/components/schemas/Error"
  1841. }
  1842. }
  1843. }
  1844. },
  1845. "500": {
  1846. "description": "Internal error",
  1847. "content": {
  1848. "application/json": {
  1849. "schema": {
  1850. "$ref": "#/components/schemas/Error"
  1851. }
  1852. }
  1853. }
  1854. }
  1855. }
  1856. }
  1857. },
  1858. "/memories/{id}/versions": {
  1859. "get": {
  1860. "summary": "Revision history, newest first",
  1861. "security": [
  1862. {
  1863. "bearerAuth": []
  1864. }
  1865. ],
  1866. "parameters": [
  1867. {
  1868. "name": "id",
  1869. "in": "path",
  1870. "required": true,
  1871. "schema": {
  1872. "type": "string",
  1873. "format": "uuid"
  1874. }
  1875. }
  1876. ],
  1877. "responses": {
  1878. "200": {
  1879. "description": "Revisions"
  1880. },
  1881. "401": {
  1882. "description": "Missing, invalid, revoked or expired API key",
  1883. "content": {
  1884. "application/json": {
  1885. "schema": {
  1886. "$ref": "#/components/schemas/Error"
  1887. }
  1888. }
  1889. }
  1890. },
  1891. "404": {
  1892. "description": "Not found or not visible to the caller",
  1893. "content": {
  1894. "application/json": {
  1895. "schema": {
  1896. "$ref": "#/components/schemas/Error"
  1897. }
  1898. }
  1899. }
  1900. },
  1901. "500": {
  1902. "description": "Internal error",
  1903. "content": {
  1904. "application/json": {
  1905. "schema": {
  1906. "$ref": "#/components/schemas/Error"
  1907. }
  1908. }
  1909. }
  1910. }
  1911. }
  1912. }
  1913. },
  1914. "/sessions": {
  1915. "post": {
  1916. "summary": "Start a session",
  1917. "security": [
  1918. {
  1919. "bearerAuth": []
  1920. }
  1921. ],
  1922. "parameters": [
  1923. {
  1924. "name": "Idempotency-Key",
  1925. "in": "header",
  1926. "required": false,
  1927. "description": "Replays the stored response for an identical body; a different body with the same key is 409.",
  1928. "schema": {
  1929. "type": "string",
  1930. "maxLength": 200
  1931. }
  1932. }
  1933. ],
  1934. "requestBody": {
  1935. "required": true,
  1936. "content": {
  1937. "application/json": {
  1938. "schema": {
  1939. "type": "object",
  1940. "required": [
  1941. "namespace_id",
  1942. "objective"
  1943. ],
  1944. "properties": {
  1945. "namespace_id": {
  1946. "type": "string",
  1947. "format": "uuid"
  1948. },
  1949. "objective": {
  1950. "type": "string",
  1951. "maxLength": 2000
  1952. }
  1953. }
  1954. }
  1955. }
  1956. }
  1957. },
  1958. "responses": {
  1959. "201": {
  1960. "description": "Started"
  1961. },
  1962. "422": {
  1963. "description": "Validation failed",
  1964. "content": {
  1965. "application/json": {
  1966. "schema": {
  1967. "$ref": "#/components/schemas/Error"
  1968. }
  1969. }
  1970. }
  1971. },
  1972. "409": {
  1973. "description": "Idempotency conflict",
  1974. "content": {
  1975. "application/json": {
  1976. "schema": {
  1977. "$ref": "#/components/schemas/Error"
  1978. }
  1979. }
  1980. }
  1981. },
  1982. "401": {
  1983. "description": "Missing, invalid, revoked or expired API key",
  1984. "content": {
  1985. "application/json": {
  1986. "schema": {
  1987. "$ref": "#/components/schemas/Error"
  1988. }
  1989. }
  1990. }
  1991. },
  1992. "404": {
  1993. "description": "Not found or not visible to the caller",
  1994. "content": {
  1995. "application/json": {
  1996. "schema": {
  1997. "$ref": "#/components/schemas/Error"
  1998. }
  1999. }
  2000. }
  2001. },
  2002. "500": {
  2003. "description": "Internal error",
  2004. "content": {
  2005. "application/json": {
  2006. "schema": {
  2007. "$ref": "#/components/schemas/Error"
  2008. }
  2009. }
  2010. }
  2011. }
  2012. }
  2013. }
  2014. },
  2015. "/sessions/{id}/state": {
  2016. "get": {
  2017. "summary": "Restore the latest checkpoint (revision 0 / state null when none)",
  2018. "security": [
  2019. {
  2020. "bearerAuth": []
  2021. }
  2022. ],
  2023. "parameters": [
  2024. {
  2025. "name": "id",
  2026. "in": "path",
  2027. "required": true,
  2028. "schema": {
  2029. "type": "string",
  2030. "format": "uuid"
  2031. }
  2032. }
  2033. ],
  2034. "responses": {
  2035. "200": {
  2036. "description": "Checkpoint; ETag = revision"
  2037. },
  2038. "401": {
  2039. "description": "Missing, invalid, revoked or expired API key",
  2040. "content": {
  2041. "application/json": {
  2042. "schema": {
  2043. "$ref": "#/components/schemas/Error"
  2044. }
  2045. }
  2046. }
  2047. },
  2048. "404": {
  2049. "description": "Not found or not visible to the caller",
  2050. "content": {
  2051. "application/json": {
  2052. "schema": {
  2053. "$ref": "#/components/schemas/Error"
  2054. }
  2055. }
  2056. }
  2057. },
  2058. "500": {
  2059. "description": "Internal error",
  2060. "content": {
  2061. "application/json": {
  2062. "schema": {
  2063. "$ref": "#/components/schemas/Error"
  2064. }
  2065. }
  2066. }
  2067. }
  2068. }
  2069. },
  2070. "put": {
  2071. "summary": "Save a checkpoint (If-Match = current checkpoint revision, 0 for the first)",
  2072. "security": [
  2073. {
  2074. "bearerAuth": []
  2075. }
  2076. ],
  2077. "parameters": [
  2078. {
  2079. "name": "id",
  2080. "in": "path",
  2081. "required": true,
  2082. "schema": {
  2083. "type": "string",
  2084. "format": "uuid"
  2085. }
  2086. },
  2087. {
  2088. "name": "If-Match",
  2089. "in": "header",
  2090. "required": false,
  2091. "description": "Current revision number (quoted ETag form accepted). Required unless expected_revision is in the body.",
  2092. "schema": {
  2093. "type": "string"
  2094. }
  2095. }
  2096. ],
  2097. "requestBody": {
  2098. "required": true,
  2099. "content": {
  2100. "application/json": {
  2101. "schema": {
  2102. "$ref": "#/components/schemas/SaveStateRequest"
  2103. }
  2104. }
  2105. }
  2106. },
  2107. "responses": {
  2108. "200": {
  2109. "description": "Saved; ETag = new revision"
  2110. },
  2111. "409": {
  2112. "description": "Session closed",
  2113. "content": {
  2114. "application/json": {
  2115. "schema": {
  2116. "$ref": "#/components/schemas/Error"
  2117. }
  2118. }
  2119. }
  2120. },
  2121. "412": {
  2122. "description": "Stale revision",
  2123. "content": {
  2124. "application/json": {
  2125. "schema": {
  2126. "$ref": "#/components/schemas/Error"
  2127. }
  2128. }
  2129. }
  2130. },
  2131. "422": {
  2132. "description": "Validation failed",
  2133. "content": {
  2134. "application/json": {
  2135. "schema": {
  2136. "$ref": "#/components/schemas/Error"
  2137. }
  2138. }
  2139. }
  2140. },
  2141. "428": {
  2142. "description": "If-Match missing",
  2143. "content": {
  2144. "application/json": {
  2145. "schema": {
  2146. "$ref": "#/components/schemas/Error"
  2147. }
  2148. }
  2149. }
  2150. },
  2151. "401": {
  2152. "description": "Missing, invalid, revoked or expired API key",
  2153. "content": {
  2154. "application/json": {
  2155. "schema": {
  2156. "$ref": "#/components/schemas/Error"
  2157. }
  2158. }
  2159. }
  2160. },
  2161. "404": {
  2162. "description": "Not found or not visible to the caller",
  2163. "content": {
  2164. "application/json": {
  2165. "schema": {
  2166. "$ref": "#/components/schemas/Error"
  2167. }
  2168. }
  2169. }
  2170. },
  2171. "500": {
  2172. "description": "Internal error",
  2173. "content": {
  2174. "application/json": {
  2175. "schema": {
  2176. "$ref": "#/components/schemas/Error"
  2177. }
  2178. }
  2179. }
  2180. }
  2181. }
  2182. }
  2183. },
  2184. "/sessions/{id}/complete": {
  2185. "post": {
  2186. "summary": "Complete a session",
  2187. "security": [
  2188. {
  2189. "bearerAuth": []
  2190. }
  2191. ],
  2192. "parameters": [
  2193. {
  2194. "name": "id",
  2195. "in": "path",
  2196. "required": true,
  2197. "schema": {
  2198. "type": "string",
  2199. "format": "uuid"
  2200. }
  2201. }
  2202. ],
  2203. "requestBody": {
  2204. "required": false,
  2205. "content": {
  2206. "application/json": {
  2207. "schema": {
  2208. "type": "object",
  2209. "properties": {
  2210. "outcome": {
  2211. "type": "string",
  2212. "maxLength": 4000
  2213. }
  2214. }
  2215. }
  2216. }
  2217. }
  2218. },
  2219. "responses": {
  2220. "200": {
  2221. "description": "Completed"
  2222. },
  2223. "409": {
  2224. "description": "Already closed",
  2225. "content": {
  2226. "application/json": {
  2227. "schema": {
  2228. "$ref": "#/components/schemas/Error"
  2229. }
  2230. }
  2231. }
  2232. },
  2233. "401": {
  2234. "description": "Missing, invalid, revoked or expired API key",
  2235. "content": {
  2236. "application/json": {
  2237. "schema": {
  2238. "$ref": "#/components/schemas/Error"
  2239. }
  2240. }
  2241. }
  2242. },
  2243. "404": {
  2244. "description": "Not found or not visible to the caller",
  2245. "content": {
  2246. "application/json": {
  2247. "schema": {
  2248. "$ref": "#/components/schemas/Error"
  2249. }
  2250. }
  2251. }
  2252. },
  2253. "500": {
  2254. "description": "Internal error",
  2255. "content": {
  2256. "application/json": {
  2257. "schema": {
  2258. "$ref": "#/components/schemas/Error"
  2259. }
  2260. }
  2261. }
  2262. }
  2263. }
  2264. }
  2265. },
  2266. "/memories/{id}/verifications": {
  2267. "post": {
  2268. "summary": "Record a verification of the current revision (needs the verify permission)",
  2269. "security": [
  2270. {
  2271. "bearerAuth": []
  2272. }
  2273. ],
  2274. "parameters": [
  2275. {
  2276. "name": "id",
  2277. "in": "path",
  2278. "required": true,
  2279. "schema": {
  2280. "type": "string",
  2281. "format": "uuid"
  2282. }
  2283. }
  2284. ],
  2285. "requestBody": {
  2286. "required": true,
  2287. "content": {
  2288. "application/json": {
  2289. "schema": {
  2290. "$ref": "#/components/schemas/VerifyRequest"
  2291. }
  2292. }
  2293. }
  2294. },
  2295. "responses": {
  2296. "200": {
  2297. "description": "Recorded; returns the new verification_status"
  2298. },
  2299. "409": {
  2300. "description": "Not the current revision",
  2301. "content": {
  2302. "application/json": {
  2303. "schema": {
  2304. "$ref": "#/components/schemas/Error"
  2305. }
  2306. }
  2307. }
  2308. },
  2309. "422": {
  2310. "description": "Validation failed",
  2311. "content": {
  2312. "application/json": {
  2313. "schema": {
  2314. "$ref": "#/components/schemas/Error"
  2315. }
  2316. }
  2317. }
  2318. },
  2319. "401": {
  2320. "description": "Missing, invalid, revoked or expired API key",
  2321. "content": {
  2322. "application/json": {
  2323. "schema": {
  2324. "$ref": "#/components/schemas/Error"
  2325. }
  2326. }
  2327. }
  2328. },
  2329. "404": {
  2330. "description": "Not found or not visible to the caller",
  2331. "content": {
  2332. "application/json": {
  2333. "schema": {
  2334. "$ref": "#/components/schemas/Error"
  2335. }
  2336. }
  2337. }
  2338. },
  2339. "500": {
  2340. "description": "Internal error",
  2341. "content": {
  2342. "application/json": {
  2343. "schema": {
  2344. "$ref": "#/components/schemas/Error"
  2345. }
  2346. }
  2347. }
  2348. }
  2349. }
  2350. }
  2351. },
  2352. "/recall": {
  2353. "post": {
  2354. "summary": "Hybrid recall over active memories (FTS5/bm25 fused with vector similarity by reciprocal rank fusion; lexical only, with a warning, when the embedding provider is off or down). Unverified memories are hidden unless verification_filter=include_unverified",
  2355. "security": [
  2356. {
  2357. "bearerAuth": []
  2358. }
  2359. ],
  2360. "requestBody": {
  2361. "required": true,
  2362. "content": {
  2363. "application/json": {
  2364. "schema": {
  2365. "$ref": "#/components/schemas/RecallRequest"
  2366. }
  2367. }
  2368. }
  2369. },
  2370. "responses": {
  2371. "200": {
  2372. "description": "Ranked results with warnings"
  2373. },
  2374. "422": {
  2375. "description": "Validation failed",
  2376. "content": {
  2377. "application/json": {
  2378. "schema": {
  2379. "$ref": "#/components/schemas/Error"
  2380. }
  2381. }
  2382. }
  2383. },
  2384. "401": {
  2385. "description": "Missing, invalid, revoked or expired API key",
  2386. "content": {
  2387. "application/json": {
  2388. "schema": {
  2389. "$ref": "#/components/schemas/Error"
  2390. }
  2391. }
  2392. }
  2393. },
  2394. "404": {
  2395. "description": "Not found or not visible to the caller",
  2396. "content": {
  2397. "application/json": {
  2398. "schema": {
  2399. "$ref": "#/components/schemas/Error"
  2400. }
  2401. }
  2402. }
  2403. },
  2404. "500": {
  2405. "description": "Internal error",
  2406. "content": {
  2407. "application/json": {
  2408. "schema": {
  2409. "$ref": "#/components/schemas/Error"
  2410. }
  2411. }
  2412. }
  2413. }
  2414. },
  2415. "description": " Feedback (POST /feedback) on a result's current revision adjusts its rank; such results carry feedback {useful, not_useful, incorrect_or_harmful} and demoted results are named in warnings."
  2416. }
  2417. },
  2418. "/ingestion/jobs": {
  2419. "post": {
  2420. "summary": "Ingest a Markdown/text document (chunked, indexed) Ingestion is a durable job: the input is stored first, so an interrupted or failed job is retried by the worker (at most 3 attempts) without duplicate chunks.",
  2421. "security": [
  2422. {
  2423. "bearerAuth": []
  2424. }
  2425. ],
  2426. "parameters": [
  2427. {
  2428. "name": "Idempotency-Key",
  2429. "in": "header",
  2430. "required": false,
  2431. "description": "Replays the stored response for an identical body; a different body with the same key is 409.",
  2432. "schema": {
  2433. "type": "string",
  2434. "maxLength": 200
  2435. }
  2436. }
  2437. ],
  2438. "requestBody": {
  2439. "required": true,
  2440. "content": {
  2441. "application/json": {
  2442. "schema": {
  2443. "$ref": "#/components/schemas/IngestRequest"
  2444. }
  2445. }
  2446. }
  2447. },
  2448. "responses": {
  2449. "201": {
  2450. "description": "Ingested (new document or new revision)",
  2451. "content": {
  2452. "application/json": {
  2453. "schema": {
  2454. "$ref": "#/components/schemas/IngestResponse"
  2455. }
  2456. }
  2457. }
  2458. },
  2459. "200": {
  2460. "description": "Unchanged or idempotent replay",
  2461. "content": {
  2462. "application/json": {
  2463. "schema": {
  2464. "$ref": "#/components/schemas/IngestResponse"
  2465. }
  2466. }
  2467. }
  2468. },
  2469. "400": {
  2470. "description": "Invalid JSON",
  2471. "content": {
  2472. "application/json": {
  2473. "schema": {
  2474. "$ref": "#/components/schemas/Error"
  2475. }
  2476. }
  2477. }
  2478. },
  2479. "409": {
  2480. "description": "Idempotency-Key reused with a different body",
  2481. "content": {
  2482. "application/json": {
  2483. "schema": {
  2484. "$ref": "#/components/schemas/Error"
  2485. }
  2486. }
  2487. }
  2488. },
  2489. "422": {
  2490. "description": "Validation failed",
  2491. "content": {
  2492. "application/json": {
  2493. "schema": {
  2494. "$ref": "#/components/schemas/Error"
  2495. }
  2496. }
  2497. }
  2498. },
  2499. "401": {
  2500. "description": "Missing, invalid, revoked or expired API key",
  2501. "content": {
  2502. "application/json": {
  2503. "schema": {
  2504. "$ref": "#/components/schemas/Error"
  2505. }
  2506. }
  2507. }
  2508. },
  2509. "404": {
  2510. "description": "Not found or not visible to the caller",
  2511. "content": {
  2512. "application/json": {
  2513. "schema": {
  2514. "$ref": "#/components/schemas/Error"
  2515. }
  2516. }
  2517. }
  2518. },
  2519. "500": {
  2520. "description": "Internal error. When the job was already stored, its input is kept and the worker retries it (Location: the job)",
  2521. "content": {
  2522. "application/json": {
  2523. "schema": {
  2524. "$ref": "#/components/schemas/Error"
  2525. }
  2526. }
  2527. }
  2528. },
  2529. "202": {
  2530. "description": "Queued (async): job reference; the worker publishes the revision",
  2531. "content": {
  2532. "application/json": {
  2533. "schema": {
  2534. "$ref": "#/components/schemas/JobQueued"
  2535. }
  2536. }
  2537. }
  2538. }
  2539. }
  2540. }
  2541. },
  2542. "/jobs/{id}": {
  2543. "get": {
  2544. "summary": "Ingestion job state",
  2545. "security": [
  2546. {
  2547. "bearerAuth": []
  2548. }
  2549. ],
  2550. "parameters": [
  2551. {
  2552. "name": "id",
  2553. "in": "path",
  2554. "required": true,
  2555. "schema": {
  2556. "type": "string",
  2557. "format": "uuid"
  2558. }
  2559. }
  2560. ],
  2561. "responses": {
  2562. "200": {
  2563. "description": "Job",
  2564. "content": {
  2565. "application/json": {
  2566. "schema": {
  2567. "$ref": "#/components/schemas/Job"
  2568. }
  2569. }
  2570. }
  2571. },
  2572. "401": {
  2573. "description": "Missing, invalid, revoked or expired API key",
  2574. "content": {
  2575. "application/json": {
  2576. "schema": {
  2577. "$ref": "#/components/schemas/Error"
  2578. }
  2579. }
  2580. }
  2581. },
  2582. "404": {
  2583. "description": "Not found or not visible to the caller",
  2584. "content": {
  2585. "application/json": {
  2586. "schema": {
  2587. "$ref": "#/components/schemas/Error"
  2588. }
  2589. }
  2590. }
  2591. },
  2592. "500": {
  2593. "description": "Internal error",
  2594. "content": {
  2595. "application/json": {
  2596. "schema": {
  2597. "$ref": "#/components/schemas/Error"
  2598. }
  2599. }
  2600. }
  2601. }
  2602. }
  2603. }
  2604. },
  2605. "/jobs/{id}/retry": {
  2606. "post": {
  2607. "summary": "Requeue a failed job (attempts reset). Needs write permission on the job's namespace. Automatic retries cover internal errors only; use this after fixing the cause of another failure.",
  2608. "security": [
  2609. {
  2610. "bearerAuth": []
  2611. }
  2612. ],
  2613. "parameters": [
  2614. {
  2615. "name": "id",
  2616. "in": "path",
  2617. "required": true,
  2618. "schema": {
  2619. "type": "string",
  2620. "format": "uuid"
  2621. }
  2622. }
  2623. ],
  2624. "responses": {
  2625. "202": {
  2626. "description": "Queued",
  2627. "content": {
  2628. "application/json": {
  2629. "schema": {
  2630. "$ref": "#/components/schemas/JobQueued"
  2631. }
  2632. }
  2633. }
  2634. },
  2635. "401": {
  2636. "description": "Missing, invalid, revoked or expired API key",
  2637. "content": {
  2638. "application/json": {
  2639. "schema": {
  2640. "$ref": "#/components/schemas/Error"
  2641. }
  2642. }
  2643. }
  2644. },
  2645. "404": {
  2646. "description": "Not found, or no write permission on the job's namespace",
  2647. "content": {
  2648. "application/json": {
  2649. "schema": {
  2650. "$ref": "#/components/schemas/Error"
  2651. }
  2652. }
  2653. }
  2654. },
  2655. "409": {
  2656. "description": "job_not_retryable: the job is not failed, or its input is no longer stored",
  2657. "content": {
  2658. "application/json": {
  2659. "schema": {
  2660. "$ref": "#/components/schemas/Error"
  2661. }
  2662. }
  2663. }
  2664. },
  2665. "500": {
  2666. "description": "Internal error",
  2667. "content": {
  2668. "application/json": {
  2669. "schema": {
  2670. "$ref": "#/components/schemas/Error"
  2671. }
  2672. }
  2673. }
  2674. }
  2675. }
  2676. }
  2677. },
  2678. "/documents/{id}": {
  2679. "get": {
  2680. "summary": "Document metadata (?include_content=true adds the normalized text)",
  2681. "security": [
  2682. {
  2683. "bearerAuth": []
  2684. }
  2685. ],
  2686. "parameters": [
  2687. {
  2688. "name": "id",
  2689. "in": "path",
  2690. "required": true,
  2691. "schema": {
  2692. "type": "string",
  2693. "format": "uuid"
  2694. }
  2695. },
  2696. {
  2697. "name": "include_content",
  2698. "in": "query",
  2699. "schema": {
  2700. "type": "boolean"
  2701. }
  2702. }
  2703. ],
  2704. "responses": {
  2705. "200": {
  2706. "description": "Document"
  2707. },
  2708. "401": {
  2709. "description": "Missing, invalid, revoked or expired API key",
  2710. "content": {
  2711. "application/json": {
  2712. "schema": {
  2713. "$ref": "#/components/schemas/Error"
  2714. }
  2715. }
  2716. }
  2717. },
  2718. "404": {
  2719. "description": "Not found or not visible to the caller",
  2720. "content": {
  2721. "application/json": {
  2722. "schema": {
  2723. "$ref": "#/components/schemas/Error"
  2724. }
  2725. }
  2726. }
  2727. },
  2728. "500": {
  2729. "description": "Internal error",
  2730. "content": {
  2731. "application/json": {
  2732. "schema": {
  2733. "$ref": "#/components/schemas/Error"
  2734. }
  2735. }
  2736. }
  2737. }
  2738. }
  2739. }
  2740. },
  2741. "/chunks/{id}": {
  2742. "get": {
  2743. "summary": "One chunk with heading path and source locator (character offsets into the normalized document text)",
  2744. "security": [
  2745. {
  2746. "bearerAuth": []
  2747. }
  2748. ],
  2749. "parameters": [
  2750. {
  2751. "name": "id",
  2752. "in": "path",
  2753. "required": true,
  2754. "schema": {
  2755. "type": "string",
  2756. "format": "uuid"
  2757. }
  2758. }
  2759. ],
  2760. "responses": {
  2761. "200": {
  2762. "description": "Chunk"
  2763. },
  2764. "401": {
  2765. "description": "Missing, invalid, revoked or expired API key",
  2766. "content": {
  2767. "application/json": {
  2768. "schema": {
  2769. "$ref": "#/components/schemas/Error"
  2770. }
  2771. }
  2772. }
  2773. },
  2774. "404": {
  2775. "description": "Not found or not visible to the caller",
  2776. "content": {
  2777. "application/json": {
  2778. "schema": {
  2779. "$ref": "#/components/schemas/Error"
  2780. }
  2781. }
  2782. }
  2783. },
  2784. "500": {
  2785. "description": "Internal error",
  2786. "content": {
  2787. "application/json": {
  2788. "schema": {
  2789. "$ref": "#/components/schemas/Error"
  2790. }
  2791. }
  2792. }
  2793. }
  2794. }
  2795. }
  2796. },
  2797. "/search": {
  2798. "post": {
  2799. "summary": "Hybrid search over current document chunks (lexical fused with vector similarity; lexical only, with a warning, when the embedding provider is off or down). Results are untrusted reference content",
  2800. "security": [
  2801. {
  2802. "bearerAuth": []
  2803. }
  2804. ],
  2805. "requestBody": {
  2806. "required": true,
  2807. "content": {
  2808. "application/json": {
  2809. "schema": {
  2810. "$ref": "#/components/schemas/SearchRequest"
  2811. }
  2812. }
  2813. }
  2814. },
  2815. "responses": {
  2816. "200": {
  2817. "description": "Ranked chunks with locators and content_trust"
  2818. },
  2819. "422": {
  2820. "description": "Validation failed",
  2821. "content": {
  2822. "application/json": {
  2823. "schema": {
  2824. "$ref": "#/components/schemas/Error"
  2825. }
  2826. }
  2827. }
  2828. },
  2829. "401": {
  2830. "description": "Missing, invalid, revoked or expired API key",
  2831. "content": {
  2832. "application/json": {
  2833. "schema": {
  2834. "$ref": "#/components/schemas/Error"
  2835. }
  2836. }
  2837. }
  2838. },
  2839. "404": {
  2840. "description": "Not found or not visible to the caller",
  2841. "content": {
  2842. "application/json": {
  2843. "schema": {
  2844. "$ref": "#/components/schemas/Error"
  2845. }
  2846. }
  2847. }
  2848. },
  2849. "500": {
  2850. "description": "Internal error",
  2851. "content": {
  2852. "application/json": {
  2853. "schema": {
  2854. "$ref": "#/components/schemas/Error"
  2855. }
  2856. }
  2857. }
  2858. }
  2859. },
  2860. "description": " Feedback (POST /feedback) on a result's current revision adjusts its rank; such results carry feedback {useful, not_useful, incorrect_or_harmful} and demoted results are named in warnings."
  2861. }
  2862. },
  2863. "/health/live": {
  2864. "get": {
  2865. "summary": "Liveness",
  2866. "responses": {
  2867. "200": {
  2868. "description": "Live"
  2869. }
  2870. }
  2871. }
  2872. },
  2873. "/health/ready": {
  2874. "get": {
  2875. "summary": "Readiness (database reachable)",
  2876. "responses": {
  2877. "200": {
  2878. "description": "Ready"
  2879. },
  2880. "503": {
  2881. "description": "Unavailable"
  2882. }
  2883. }
  2884. }
  2885. },
  2886. "/metrics": {
  2887. "get": {
  2888. "summary": "Prometheus text metrics: API request counters and latency histogram per controller action (since process start), plus installation-wide counts (memories, candidates, jobs, embedding index, retrieval calls, feedback). Counts only. Enabled when the container has AMK_METRICS_TOKEN (16+ characters); send it as a bearer token. API keys are not accepted.",
  2889. "tags": [
  2890. "health"
  2891. ],
  2892. "responses": {
  2893. "200": {
  2894. "description": "Metrics",
  2895. "content": {
  2896. "text/plain": {
  2897. "schema": {
  2898. "type": "string"
  2899. }
  2900. }
  2901. }
  2902. },
  2903. "401": {
  2904. "description": "Missing or wrong metrics token",
  2905. "content": {
  2906. "application/json": {
  2907. "schema": {
  2908. "$ref": "#/components/schemas/Error"
  2909. }
  2910. }
  2911. }
  2912. },
  2913. "404": {
  2914. "description": "Metrics are disabled (no AMK_METRICS_TOKEN)",
  2915. "content": {
  2916. "application/json": {
  2917. "schema": {
  2918. "$ref": "#/components/schemas/Error"
  2919. }
  2920. }
  2921. }
  2922. }
  2923. }
  2924. }
  2925. },
  2926. "/context": {
  2927. "post": {
  2928. "summary": "Assemble a token-budgeted task briefing: constraints by scope, working state, preferences, conflicts, hybrid matches and reference passages",
  2929. "security": [
  2930. {
  2931. "bearerAuth": []
  2932. }
  2933. ],
  2934. "requestBody": {
  2935. "required": true,
  2936. "content": {
  2937. "application/json": {
  2938. "schema": {
  2939. "$ref": "#/components/schemas/ContextRequest"
  2940. }
  2941. }
  2942. }
  2943. },
  2944. "responses": {
  2945. "200": {
  2946. "description": "Briefing",
  2947. "content": {
  2948. "application/json": {
  2949. "schema": {
  2950. "$ref": "#/components/schemas/ContextResponse"
  2951. }
  2952. }
  2953. }
  2954. },
  2955. "400": {
  2956. "description": "Empty body or invalid JSON",
  2957. "content": {
  2958. "application/json": {
  2959. "schema": {
  2960. "$ref": "#/components/schemas/Error"
  2961. }
  2962. }
  2963. }
  2964. },
  2965. "401": {
  2966. "description": "Missing, invalid, revoked or expired API key",
  2967. "content": {
  2968. "application/json": {
  2969. "schema": {
  2970. "$ref": "#/components/schemas/Error"
  2971. }
  2972. }
  2973. }
  2974. },
  2975. "404": {
  2976. "description": "session_id not found or not visible to the caller",
  2977. "content": {
  2978. "application/json": {
  2979. "schema": {
  2980. "$ref": "#/components/schemas/Error"
  2981. }
  2982. }
  2983. }
  2984. },
  2985. "422": {
  2986. "description": "Validation failed, unsupported_character (code points above U+FFFF), or context_budget_exceeded (the applicable constraints do not fit max_context_tokens; the error also carries required_tokens)",
  2987. "content": {
  2988. "application/json": {
  2989. "schema": {
  2990. "$ref": "#/components/schemas/Error"
  2991. }
  2992. }
  2993. }
  2994. },
  2995. "500": {
  2996. "description": "Internal error",
  2997. "content": {
  2998. "application/json": {
  2999. "schema": {
  3000. "$ref": "#/components/schemas/Error"
  3001. }
  3002. }
  3003. }
  3004. }
  3005. }
  3006. }
  3007. },
  3008. "/sessions/{id}/events": {
  3009. "post": {
  3010. "summary": "Record an experience (task, problem, action, result, outcome) in an active session",
  3011. "tags": [
  3012. "learning"
  3013. ],
  3014. "security": [
  3015. {
  3016. "bearerAuth": []
  3017. }
  3018. ],
  3019. "parameters": [
  3020. {
  3021. "name": "id",
  3022. "in": "path",
  3023. "required": true,
  3024. "schema": {
  3025. "type": "string",
  3026. "format": "uuid"
  3027. }
  3028. },
  3029. {
  3030. "name": "Idempotency-Key",
  3031. "in": "header",
  3032. "required": false,
  3033. "schema": {
  3034. "type": "string",
  3035. "maxLength": 200
  3036. },
  3037. "description": "Replays the stored response for a repeated request; 409 if reused with a different body."
  3038. }
  3039. ],
  3040. "requestBody": {
  3041. "required": true,
  3042. "content": {
  3043. "application/json": {
  3044. "schema": {
  3045. "$ref": "#/components/schemas/ExperienceRequest"
  3046. }
  3047. }
  3048. }
  3049. },
  3050. "responses": {
  3051. "201": {
  3052. "description": "Recorded",
  3053. "content": {
  3054. "application/json": {
  3055. "schema": {
  3056. "type": "object",
  3057. "properties": {
  3058. "id": {
  3059. "type": "string"
  3060. },
  3061. "session_id": {
  3062. "type": "string"
  3063. },
  3064. "outcome": {
  3065. "type": "string"
  3066. },
  3067. "created_at": {
  3068. "type": "string"
  3069. }
  3070. }
  3071. }
  3072. }
  3073. }
  3074. },
  3075. "400": {
  3076. "description": "Empty body, invalid JSON or invalid Idempotency-Key",
  3077. "content": {
  3078. "application/json": {
  3079. "schema": {
  3080. "$ref": "#/components/schemas/Error"
  3081. }
  3082. }
  3083. }
  3084. },
  3085. "401": {
  3086. "description": "Missing, invalid, revoked or expired API key",
  3087. "content": {
  3088. "application/json": {
  3089. "schema": {
  3090. "$ref": "#/components/schemas/Error"
  3091. }
  3092. }
  3093. }
  3094. },
  3095. "404": {
  3096. "description": "Session not found, or no write permission on its namespace",
  3097. "content": {
  3098. "application/json": {
  3099. "schema": {
  3100. "$ref": "#/components/schemas/Error"
  3101. }
  3102. }
  3103. }
  3104. },
  3105. "409": {
  3106. "description": "session_not_active (completed session) or idempotency_conflict",
  3107. "content": {
  3108. "application/json": {
  3109. "schema": {
  3110. "$ref": "#/components/schemas/Error"
  3111. }
  3112. }
  3113. }
  3114. },
  3115. "422": {
  3116. "description": "Validation failed or unsupported_character",
  3117. "content": {
  3118. "application/json": {
  3119. "schema": {
  3120. "$ref": "#/components/schemas/Error"
  3121. }
  3122. }
  3123. }
  3124. },
  3125. "500": {
  3126. "description": "Internal error",
  3127. "content": {
  3128. "application/json": {
  3129. "schema": {
  3130. "$ref": "#/components/schemas/Error"
  3131. }
  3132. }
  3133. }
  3134. }
  3135. }
  3136. },
  3137. "get": {
  3138. "summary": "List the experiences of a session, oldest first (max 200)",
  3139. "tags": [
  3140. "learning"
  3141. ],
  3142. "security": [
  3143. {
  3144. "bearerAuth": []
  3145. }
  3146. ],
  3147. "parameters": [
  3148. {
  3149. "name": "id",
  3150. "in": "path",
  3151. "required": true,
  3152. "schema": {
  3153. "type": "string",
  3154. "format": "uuid"
  3155. }
  3156. }
  3157. ],
  3158. "responses": {
  3159. "200": {
  3160. "description": "Experiences",
  3161. "content": {
  3162. "application/json": {
  3163. "schema": {
  3164. "type": "object",
  3165. "properties": {
  3166. "session_id": {
  3167. "type": "string"
  3168. },
  3169. "data": {
  3170. "type": "array",
  3171. "items": {
  3172. "$ref": "#/components/schemas/Experience"
  3173. }
  3174. }
  3175. }
  3176. }
  3177. }
  3178. }
  3179. },
  3180. "401": {
  3181. "description": "Missing, invalid, revoked or expired API key",
  3182. "content": {
  3183. "application/json": {
  3184. "schema": {
  3185. "$ref": "#/components/schemas/Error"
  3186. }
  3187. }
  3188. }
  3189. },
  3190. "404": {
  3191. "description": "Session not found or not readable",
  3192. "content": {
  3193. "application/json": {
  3194. "schema": {
  3195. "$ref": "#/components/schemas/Error"
  3196. }
  3197. }
  3198. }
  3199. },
  3200. "500": {
  3201. "description": "Internal error",
  3202. "content": {
  3203. "application/json": {
  3204. "schema": {
  3205. "$ref": "#/components/schemas/Error"
  3206. }
  3207. }
  3208. }
  3209. }
  3210. }
  3211. }
  3212. },
  3213. "/learn": {
  3214. "post": {
  3215. "summary": "Propose knowledge as a learning candidate (a new memory, or a new revision of target_memory_id at base_revision), with evidence",
  3216. "tags": [
  3217. "learning"
  3218. ],
  3219. "security": [
  3220. {
  3221. "bearerAuth": []
  3222. }
  3223. ],
  3224. "parameters": [
  3225. {
  3226. "name": "Idempotency-Key",
  3227. "in": "header",
  3228. "required": false,
  3229. "schema": {
  3230. "type": "string",
  3231. "maxLength": 200
  3232. },
  3233. "description": "Replays the stored response for a repeated request; 409 if reused with a different body."
  3234. }
  3235. ],
  3236. "requestBody": {
  3237. "required": true,
  3238. "content": {
  3239. "application/json": {
  3240. "schema": {
  3241. "$ref": "#/components/schemas/LearnRequest"
  3242. }
  3243. }
  3244. }
  3245. },
  3246. "responses": {
  3247. "201": {
  3248. "description": "Candidate proposed",
  3249. "content": {
  3250. "application/json": {
  3251. "schema": {
  3252. "type": "object",
  3253. "properties": {
  3254. "id": {
  3255. "type": "string"
  3256. },
  3257. "state": {
  3258. "type": "string",
  3259. "enum": [
  3260. "proposed"
  3261. ]
  3262. },
  3263. "namespace_id": {
  3264. "type": "string"
  3265. },
  3266. "type": {
  3267. "type": "string"
  3268. },
  3269. "evidence_count": {
  3270. "type": "integer"
  3271. }
  3272. }
  3273. }
  3274. }
  3275. }
  3276. },
  3277. "400": {
  3278. "description": "Empty body, invalid JSON or invalid Idempotency-Key",
  3279. "content": {
  3280. "application/json": {
  3281. "schema": {
  3282. "$ref": "#/components/schemas/Error"
  3283. }
  3284. }
  3285. }
  3286. },
  3287. "401": {
  3288. "description": "Missing, invalid, revoked or expired API key",
  3289. "content": {
  3290. "application/json": {
  3291. "schema": {
  3292. "$ref": "#/components/schemas/Error"
  3293. }
  3294. }
  3295. }
  3296. },
  3297. "404": {
  3298. "description": "Namespace not found or no write permission",
  3299. "content": {
  3300. "application/json": {
  3301. "schema": {
  3302. "$ref": "#/components/schemas/Error"
  3303. }
  3304. }
  3305. }
  3306. },
  3307. "409": {
  3308. "description": "idempotency_conflict",
  3309. "content": {
  3310. "application/json": {
  3311. "schema": {
  3312. "$ref": "#/components/schemas/Error"
  3313. }
  3314. }
  3315. }
  3316. },
  3317. "422": {
  3318. "description": "Validation failed (unknown type, bad target/base_revision, evidence that is unknown, in another tenant or not readable by the caller) or unsupported_character",
  3319. "content": {
  3320. "application/json": {
  3321. "schema": {
  3322. "$ref": "#/components/schemas/Error"
  3323. }
  3324. }
  3325. }
  3326. },
  3327. "500": {
  3328. "description": "Internal error",
  3329. "content": {
  3330. "application/json": {
  3331. "schema": {
  3332. "$ref": "#/components/schemas/Error"
  3333. }
  3334. }
  3335. }
  3336. }
  3337. }
  3338. }
  3339. },
  3340. "/candidates": {
  3341. "get": {
  3342. "summary": "List learning candidates in namespaces the caller can read, newest first",
  3343. "tags": [
  3344. "learning"
  3345. ],
  3346. "security": [
  3347. {
  3348. "bearerAuth": []
  3349. }
  3350. ],
  3351. "parameters": [
  3352. {
  3353. "name": "namespace_id",
  3354. "in": "query",
  3355. "schema": {
  3356. "type": "string",
  3357. "format": "uuid"
  3358. }
  3359. },
  3360. {
  3361. "name": "state",
  3362. "in": "query",
  3363. "schema": {
  3364. "type": "string",
  3365. "enum": [
  3366. "proposed",
  3367. "accepted",
  3368. "rejected"
  3369. ]
  3370. }
  3371. },
  3372. {
  3373. "name": "limit",
  3374. "in": "query",
  3375. "schema": {
  3376. "type": "integer",
  3377. "minimum": 1,
  3378. "maximum": 200,
  3379. "default": 50
  3380. }
  3381. }
  3382. ],
  3383. "responses": {
  3384. "200": {
  3385. "description": "Candidates (without content)",
  3386. "content": {
  3387. "application/json": {
  3388. "schema": {
  3389. "type": "object",
  3390. "properties": {
  3391. "data": {
  3392. "type": "array",
  3393. "items": {
  3394. "$ref": "#/components/schemas/Candidate"
  3395. }
  3396. }
  3397. }
  3398. }
  3399. }
  3400. }
  3401. },
  3402. "401": {
  3403. "description": "Missing, invalid, revoked or expired API key",
  3404. "content": {
  3405. "application/json": {
  3406. "schema": {
  3407. "$ref": "#/components/schemas/Error"
  3408. }
  3409. }
  3410. }
  3411. },
  3412. "422": {
  3413. "description": "Bad state or namespace_id",
  3414. "content": {
  3415. "application/json": {
  3416. "schema": {
  3417. "$ref": "#/components/schemas/Error"
  3418. }
  3419. }
  3420. }
  3421. },
  3422. "500": {
  3423. "description": "Internal error",
  3424. "content": {
  3425. "application/json": {
  3426. "schema": {
  3427. "$ref": "#/components/schemas/Error"
  3428. }
  3429. }
  3430. }
  3431. }
  3432. }
  3433. }
  3434. },
  3435. "/candidates/{id}": {
  3436. "get": {
  3437. "summary": "One candidate with content and evidence",
  3438. "tags": [
  3439. "learning"
  3440. ],
  3441. "security": [
  3442. {
  3443. "bearerAuth": []
  3444. }
  3445. ],
  3446. "parameters": [
  3447. {
  3448. "name": "id",
  3449. "in": "path",
  3450. "required": true,
  3451. "schema": {
  3452. "type": "string",
  3453. "format": "uuid"
  3454. }
  3455. }
  3456. ],
  3457. "responses": {
  3458. "200": {
  3459. "description": "Candidate",
  3460. "content": {
  3461. "application/json": {
  3462. "schema": {
  3463. "type": "object",
  3464. "properties": {
  3465. "data": {
  3466. "$ref": "#/components/schemas/Candidate"
  3467. }
  3468. }
  3469. }
  3470. }
  3471. }
  3472. },
  3473. "401": {
  3474. "description": "Missing, invalid, revoked or expired API key",
  3475. "content": {
  3476. "application/json": {
  3477. "schema": {
  3478. "$ref": "#/components/schemas/Error"
  3479. }
  3480. }
  3481. }
  3482. },
  3483. "404": {
  3484. "description": "Not found or not readable",
  3485. "content": {
  3486. "application/json": {
  3487. "schema": {
  3488. "$ref": "#/components/schemas/Error"
  3489. }
  3490. }
  3491. }
  3492. },
  3493. "500": {
  3494. "description": "Internal error",
  3495. "content": {
  3496. "application/json": {
  3497. "schema": {
  3498. "$ref": "#/components/schemas/Error"
  3499. }
  3500. }
  3501. }
  3502. }
  3503. }
  3504. }
  3505. },
  3506. "/candidates/{id}/review": {
  3507. "post": {
  3508. "summary": "Accept or reject a proposed candidate. Needs verify permission; the author cannot review its own candidate without admin. Accepting creates the memory (an identical active memory is reused) or a new revision of the target, copies the evidence and, with verify true, records a verification by the reviewer.",
  3509. "tags": [
  3510. "learning"
  3511. ],
  3512. "security": [
  3513. {
  3514. "bearerAuth": []
  3515. }
  3516. ],
  3517. "parameters": [
  3518. {
  3519. "name": "id",
  3520. "in": "path",
  3521. "required": true,
  3522. "schema": {
  3523. "type": "string",
  3524. "format": "uuid"
  3525. }
  3526. }
  3527. ],
  3528. "requestBody": {
  3529. "required": true,
  3530. "content": {
  3531. "application/json": {
  3532. "schema": {
  3533. "$ref": "#/components/schemas/ReviewRequest"
  3534. }
  3535. }
  3536. }
  3537. },
  3538. "responses": {
  3539. "200": {
  3540. "description": "Reviewed",
  3541. "content": {
  3542. "application/json": {
  3543. "schema": {
  3544. "type": "object",
  3545. "properties": {
  3546. "id": {
  3547. "type": "string"
  3548. },
  3549. "state": {
  3550. "type": "string",
  3551. "enum": [
  3552. "accepted",
  3553. "rejected"
  3554. ]
  3555. },
  3556. "resulting_memory_id": {
  3557. "type": "string"
  3558. },
  3559. "resulting_revision": {
  3560. "type": "integer"
  3561. },
  3562. "verification_status": {
  3563. "type": "string"
  3564. },
  3565. "duplicate": {
  3566. "type": "boolean"
  3567. }
  3568. }
  3569. }
  3570. }
  3571. }
  3572. },
  3573. "400": {
  3574. "description": "Empty body or invalid JSON",
  3575. "content": {
  3576. "application/json": {
  3577. "schema": {
  3578. "$ref": "#/components/schemas/Error"
  3579. }
  3580. }
  3581. }
  3582. },
  3583. "401": {
  3584. "description": "Missing, invalid, revoked or expired API key",
  3585. "content": {
  3586. "application/json": {
  3587. "schema": {
  3588. "$ref": "#/components/schemas/Error"
  3589. }
  3590. }
  3591. }
  3592. },
  3593. "403": {
  3594. "description": "self_review_not_allowed",
  3595. "content": {
  3596. "application/json": {
  3597. "schema": {
  3598. "$ref": "#/components/schemas/Error"
  3599. }
  3600. }
  3601. }
  3602. },
  3603. "404": {
  3604. "description": "Candidate not found or no verify permission",
  3605. "content": {
  3606. "application/json": {
  3607. "schema": {
  3608. "$ref": "#/components/schemas/Error"
  3609. }
  3610. }
  3611. }
  3612. },
  3613. "409": {
  3614. "description": "candidate_already_reviewed, stale_candidate (target memory changed since base_revision), target_memory_missing or target_memory_not_active",
  3615. "content": {
  3616. "application/json": {
  3617. "schema": {
  3618. "$ref": "#/components/schemas/Error"
  3619. }
  3620. }
  3621. }
  3622. },
  3623. "422": {
  3624. "description": "Validation failed",
  3625. "content": {
  3626. "application/json": {
  3627. "schema": {
  3628. "$ref": "#/components/schemas/Error"
  3629. }
  3630. }
  3631. }
  3632. },
  3633. "500": {
  3634. "description": "Internal error",
  3635. "content": {
  3636. "application/json": {
  3637. "schema": {
  3638. "$ref": "#/components/schemas/Error"
  3639. }
  3640. }
  3641. }
  3642. }
  3643. }
  3644. }
  3645. },
  3646. "/memories/{id}/sources": {
  3647. "get": {
  3648. "summary": "Evidence and verifications behind a memory revision. Evidence the caller cannot read is listed with available false and no id.",
  3649. "tags": [
  3650. "learning"
  3651. ],
  3652. "security": [
  3653. {
  3654. "bearerAuth": []
  3655. }
  3656. ],
  3657. "parameters": [
  3658. {
  3659. "name": "id",
  3660. "in": "path",
  3661. "required": true,
  3662. "schema": {
  3663. "type": "string",
  3664. "format": "uuid"
  3665. }
  3666. },
  3667. {
  3668. "name": "revision",
  3669. "in": "query",
  3670. "schema": {
  3671. "type": "integer",
  3672. "minimum": 1
  3673. },
  3674. "description": "Default: current revision"
  3675. }
  3676. ],
  3677. "responses": {
  3678. "200": {
  3679. "description": "Sources",
  3680. "content": {
  3681. "application/json": {
  3682. "schema": {
  3683. "$ref": "#/components/schemas/Sources"
  3684. }
  3685. }
  3686. }
  3687. },
  3688. "401": {
  3689. "description": "Missing, invalid, revoked or expired API key",
  3690. "content": {
  3691. "application/json": {
  3692. "schema": {
  3693. "$ref": "#/components/schemas/Error"
  3694. }
  3695. }
  3696. }
  3697. },
  3698. "404": {
  3699. "description": "Memory not found or not readable",
  3700. "content": {
  3701. "application/json": {
  3702. "schema": {
  3703. "$ref": "#/components/schemas/Error"
  3704. }
  3705. }
  3706. }
  3707. },
  3708. "422": {
  3709. "description": "revision out of range",
  3710. "content": {
  3711. "application/json": {
  3712. "schema": {
  3713. "$ref": "#/components/schemas/Error"
  3714. }
  3715. }
  3716. }
  3717. },
  3718. "500": {
  3719. "description": "Internal error",
  3720. "content": {
  3721. "application/json": {
  3722. "schema": {
  3723. "$ref": "#/components/schemas/Error"
  3724. }
  3725. }
  3726. }
  3727. }
  3728. }
  3729. }
  3730. },
  3731. "/feedback": {
  3732. "post": {
  3733. "summary": "Rate one result of a recall, search or context call (by its query_id). One rating per principal, query and result; a new rating replaces the earlier one (200). Pinned to the revision that was returned.",
  3734. "tags": [
  3735. "learning"
  3736. ],
  3737. "security": [
  3738. {
  3739. "bearerAuth": []
  3740. }
  3741. ],
  3742. "requestBody": {
  3743. "required": true,
  3744. "content": {
  3745. "application/json": {
  3746. "schema": {
  3747. "$ref": "#/components/schemas/FeedbackRequest"
  3748. }
  3749. }
  3750. }
  3751. },
  3752. "responses": {
  3753. "200": {
  3754. "description": "Updated",
  3755. "content": {
  3756. "application/json": {
  3757. "schema": {
  3758. "$ref": "#/components/schemas/Feedback"
  3759. }
  3760. }
  3761. }
  3762. },
  3763. "201": {
  3764. "description": "Recorded",
  3765. "content": {
  3766. "application/json": {
  3767. "schema": {
  3768. "$ref": "#/components/schemas/Feedback"
  3769. }
  3770. }
  3771. }
  3772. },
  3773. "400": {
  3774. "description": "Empty body or invalid JSON",
  3775. "content": {
  3776. "application/json": {
  3777. "schema": {
  3778. "$ref": "#/components/schemas/Error"
  3779. }
  3780. }
  3781. }
  3782. },
  3783. "401": {
  3784. "description": "Missing, invalid, revoked or expired API key",
  3785. "content": {
  3786. "application/json": {
  3787. "schema": {
  3788. "$ref": "#/components/schemas/Error"
  3789. }
  3790. }
  3791. }
  3792. },
  3793. "404": {
  3794. "description": "result_not_found: the result was not returned by that query, is gone, or is not readable",
  3795. "content": {
  3796. "application/json": {
  3797. "schema": {
  3798. "$ref": "#/components/schemas/Error"
  3799. }
  3800. }
  3801. }
  3802. },
  3803. "422": {
  3804. "description": "Validation failed",
  3805. "content": {
  3806. "application/json": {
  3807. "schema": {
  3808. "$ref": "#/components/schemas/Error"
  3809. }
  3810. }
  3811. }
  3812. },
  3813. "500": {
  3814. "description": "Internal error",
  3815. "content": {
  3816. "application/json": {
  3817. "schema": {
  3818. "$ref": "#/components/schemas/Error"
  3819. }
  3820. }
  3821. }
  3822. }
  3823. }
  3824. }
  3825. },
  3826. "/exports": {
  3827. "post": {
  3828. "summary": "Export every namespace the caller can read (or the namespace_ids given) as one canonical, integrity-protected JSON document. Evidence whose target the caller cannot read is left out and counted in counts.evidence_links_omitted. Sent as an attachment.",
  3829. "tags": [
  3830. "portability"
  3831. ],
  3832. "security": [
  3833. {
  3834. "bearerAuth": []
  3835. }
  3836. ],
  3837. "requestBody": {
  3838. "required": false,
  3839. "content": {
  3840. "application/json": {
  3841. "schema": {
  3842. "$ref": "#/components/schemas/ExportRequest"
  3843. }
  3844. }
  3845. }
  3846. },
  3847. "responses": {
  3848. "200": {
  3849. "description": "The export document",
  3850. "content": {
  3851. "application/json": {
  3852. "schema": {
  3853. "$ref": "#/components/schemas/Export"
  3854. }
  3855. }
  3856. }
  3857. },
  3858. "400": {
  3859. "description": "Invalid JSON",
  3860. "content": {
  3861. "application/json": {
  3862. "schema": {
  3863. "$ref": "#/components/schemas/Error"
  3864. }
  3865. }
  3866. }
  3867. },
  3868. "401": {
  3869. "description": "Missing, invalid, revoked or expired API key",
  3870. "content": {
  3871. "application/json": {
  3872. "schema": {
  3873. "$ref": "#/components/schemas/Error"
  3874. }
  3875. }
  3876. }
  3877. },
  3878. "422": {
  3879. "description": "Validation failed (namespace_ids is not an array of ids)",
  3880. "content": {
  3881. "application/json": {
  3882. "schema": {
  3883. "$ref": "#/components/schemas/Error"
  3884. }
  3885. }
  3886. }
  3887. },
  3888. "500": {
  3889. "description": "Internal error",
  3890. "content": {
  3891. "application/json": {
  3892. "schema": {
  3893. "$ref": "#/components/schemas/Error"
  3894. }
  3895. }
  3896. }
  3897. }
  3898. }
  3899. }
  3900. },
  3901. "/imports": {
  3902. "post": {
  3903. "summary": "Import a document produced by POST /exports, unchanged (max 8 MiB). Needs admin on every target namespace, matched by path in the caller's tenant (they must exist). Ids, revisions, timestamps and principal ids are kept; content hashes and the lexical index are rebuilt and embeddings are queued. All or nothing.",
  3904. "tags": [
  3905. "portability"
  3906. ],
  3907. "security": [
  3908. {
  3909. "bearerAuth": []
  3910. }
  3911. ],
  3912. "requestBody": {
  3913. "required": true,
  3914. "content": {
  3915. "application/json": {
  3916. "schema": {
  3917. "$ref": "#/components/schemas/Export"
  3918. }
  3919. }
  3920. }
  3921. },
  3922. "responses": {
  3923. "201": {
  3924. "description": "Imported",
  3925. "content": {
  3926. "application/json": {
  3927. "schema": {
  3928. "$ref": "#/components/schemas/ImportResult"
  3929. }
  3930. }
  3931. }
  3932. },
  3933. "400": {
  3934. "description": "Empty body or invalid JSON",
  3935. "content": {
  3936. "application/json": {
  3937. "schema": {
  3938. "$ref": "#/components/schemas/Error"
  3939. }
  3940. }
  3941. }
  3942. },
  3943. "401": {
  3944. "description": "Missing, invalid, revoked or expired API key",
  3945. "content": {
  3946. "application/json": {
  3947. "schema": {
  3948. "$ref": "#/components/schemas/Error"
  3949. }
  3950. }
  3951. }
  3952. },
  3953. "409": {
  3954. "description": "import_conflict: an id in the document already exists; nothing was imported",
  3955. "content": {
  3956. "application/json": {
  3957. "schema": {
  3958. "$ref": "#/components/schemas/Error"
  3959. }
  3960. }
  3961. }
  3962. },
  3963. "413": {
  3964. "description": "body_too_large: more than 8 MiB",
  3965. "content": {
  3966. "application/json": {
  3967. "schema": {
  3968. "$ref": "#/components/schemas/Error"
  3969. }
  3970. }
  3971. }
  3972. },
  3973. "422": {
  3974. "description": "Validation failed: wrong format, unsupported_schema_version, integrity_mismatch, a missing target namespace, no admin permission on it, or an invalid item; nothing was imported",
  3975. "content": {
  3976. "application/json": {
  3977. "schema": {
  3978. "$ref": "#/components/schemas/Error"
  3979. }
  3980. }
  3981. }
  3982. },
  3983. "500": {
  3984. "description": "Internal error; nothing was imported",
  3985. "content": {
  3986. "application/json": {
  3987. "schema": {
  3988. "$ref": "#/components/schemas/Error"
  3989. }
  3990. }
  3991. }
  3992. }
  3993. }
  3994. }
  3995. }
  3996. }
  3997. }

Powered by TurnKey Linux.