Repository navigation
docs(api): v2 detail error object, FILE_NOT_FOUND, total vs row_count, 400/422 and async create codes (OSS-138, ENG-5709) - #414
Conversation
… row_count, and 400/422 + 200 create (OSS-138, ENG-5709) Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: adityamishra-hydradb <[email protected]>
|
@hydra-mira-review review |
|
/devin review |
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
Mira score 5/5 · 🟢 Good to merge
API users get clearer documentation for errors, record counts, and asynchronous database operations. This PR updates four documentation pages without changing API behavior. How this PR works · 5 changes, 5 low riskAPI readers need accurate guidance on error fields, source counts, and asynchronous response codes. This PR documents existing v2 responses and corrects the deletion retry status. It changes documentation only; API behavior and response codes remain unchanged. 1. Document the deprecated error copy and API version · 🟢 low risk ·
|
✅ Mintlify HygieneNo issues found. |
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: adityamishra-hydradb <[email protected]>
|
@hydra-mira-review review |
|
/devin review |
Signed-off-by: adityamishra-hydradb <[email protected]>
For humans
Fixes OSS-138 and closes ENG-5709: docs only, codes unchanged (user decision).
The v2 docs now match what prod returns today:
detailerror object. Every v2 error has a top-leveldetailobject. It is a deprecated copy oferror(error_code,message,success: false). The v2 error page now shows it in the example and in a table, and tells readers to useerror. The page also listsmeta.api_version, which every error carries.FILE_NOT_FOUND. Added to the ingestion codes table on the error page.GET /context/statusreturns it for an ID that is not in the database and collection. The status iserrored, but no indexing failed.row_countvstotal.database-statsalready said thatrow_countcounts chunks.list-contextnow says thattotalcounts sources, sorow_countcan be larger.400 INVALID_INPUT.GET /context/statusis the exception:422 VALIDATION_ERRORfor a missingdatabaseor ID. The source-status page already said this.POST /databasesreturns200withstatus: "accepted". Ingest and delete return202. The create page now says this. The delete page said a repeat delete "returns200again". Prod returns202, so the page now says202.No API change. The OpenAPI spec already had
200for create and422for status.For agents
api-reference/v2/error-responses.mdx,api-reference/v2/endpoint/list-context.mdx,api-reference/v2/endpoint/create-database.mdx,api-reference/v2/endpoint/delete-database.mdx.vale-spellcheckis neutral ondelete-database.mdx:70("deregistration"). That line is unchanged by this PR, and the word is correct.main:database-stats.mdx("row_countcounts chunks, not sources") andsource-status.mdx(FILE_NOT_FOUNDrow,422for a missing database or ID). The ticket said these were missing. They were not.detail: option A from the ticket (document it as deprecated). This matches the app source:application/internal/api/handler/errors.gocallsdetail"the deprecated legacy error object".row_countandtypeto/databases/stats, and fixes the double count on unified databases. It is open and not deployed, so this PR does not document it.422row in the status table still says "Well-formed request that failed validation". This PR does not reword it, because 411 changes the next line. The new paragraph under the code table gives the exact rule.Proof
A = base
main@efa6f55/ B = this PR @3a1ba84(final head). Docs only. The API is the same for A and B. Prod (test org) was checked on 2026-12-04 between 18:31 and 18:53 UTC. The throwaway databasesdogfood-oss138-rcanddogfood-oss138-createwere deleted after the runs.1. A/B on the real repro: the docs against prod
detail= copy oferror,success: false: 404DATABASE_NOT_FOUND(a27e7c12-ada3-4e18-b4c9-43cb5dbf2930), 401UNAUTHORIZED(3bc3fe40-f10b-4074-ac24-cc0418a0c3a8), 422VALIDATION_ERROR(db0e0e39-2baa-42f7-8aa3-ef98d40099f4), 400INVALID_INPUT(9d5cf09c-afbd-4d06-81b0-f6825878b54c)detail.error_code0 mentionserror"metahasapi_version: "2.0.1"(same 4 requests)GET /context/statusunknown ID -> 200,errored,FILE_NOT_FOUND,message: "ID not found"(cdf7031f-8d2a-4358-a338-09c2f8e87d0a)row_countknowledge 41 / memory 1 (5d517e97-9689-4b0e-818a-d586b05155d3);/context/listtotalknowledge 2 (88bacafd-605d-40bd-a379-8e3e8ac27130) / memory 1 (62f84d3a-1354-45f2-9bdd-0c1527d0df23)totaltotalcounts sources, not chunks"GET /context/statusno ID -> 422 (d559c526-52bb-4a70-8e78-307465558593); nodatabase-> 422 (17e888f1-45a5-4711-adb5-6b20490216d9). Missing field on/query,/context/list,/context/ingest,/databases/stats,POST /databases-> 400INVALID_INPUT(1f1d4369-…,9b03931f-…,954774e3-…,c86ae4b7-…,83e855be-…,e5a24a38-…)400;/context/statusreturns422"POST /databases-> 200accepted(d2bb98d3-aedf-4679-ad2f-0a8f652724d3)200… ingest and delete return202"DELETE /databases-> 202deletion_scheduled, repeat call -> 202 again (121e301a-497c-4121-b15c-de1346dfaa5c,755baec1-80a9-4d79-9aeb-2178ba2e9602)200again" (wrong)202… returns202again"Text check (
git show <sha>:<file> | grep -c):detail.error_codeon the error pageFILE_NOT_FOUNDon the error pageapi_versionon the error page200"200" (wrong)Rendered pages (A = docs.hydradb.com, B = this PR's Mintlify preview):
2. Regression (the CI docs gates, run locally on B, Python 3.12)
.github/verify_v2_public_contract.pydetailvalidates against the schema)scripts/test_docs_consistency.pyunittest discover -s scriptsverify_agents_endpoints.pygenerate_llms_index.py --check3. Smoke
The Mintlify preview renders both new sections, and the "On this page" list shows "The detail object" (images above).
4. Stress
N/A — docs only.
5. Edge cases
detailon 4 status classes (400, 401, 404, 422): same 3 fields each time.row_count1 =total1, so the "can be larger" wording holds for both stores.Raw outputs:
~/hydradb/dogfood/docs-sdk/proof/oss138/(errors-run1.txt,rowcount-run1.txt,rowcount-run2.txt,validation-run1.txt,cleanup-and-create.txt,docs-grep-ab.txt).🤖 Generated with Claude Code