{ "success": false, "data": null, "error": { "code": "INTERNAL_ERROR", "message": "Schema conflict: field \"region\" already exists in the schema with a different definition. Resubmitting a field with its existing definition is accepted as a no-op, but an existing field cannot be modified. See https://docs.hydradb.com/api-reference/v2/endpoint/patch-metadata-schema for usage details. Re-send the field with its existing definition to make this a no-op, or use a different field name." }, "meta": { "request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d", "latency_ms": 4.8 }}
Databases
Update Metadata Schema
Add new database metadata schema fields after database creation.
{ "success": false, "data": null, "error": { "code": "INTERNAL_ERROR", "message": "Schema conflict: field \"region\" already exists in the schema with a different definition. Resubmitting a field with its existing definition is accepted as a no-op, but an existing field cannot be modified. See https://docs.hydradb.com/api-reference/v2/endpoint/patch-metadata-schema for usage details. Re-send the field with its existing definition to make this a no-op, or use a different field name." }, "meta": { "request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d", "latency_ms": 4.8 }}
Adds fields to a database’s metadata schema after creation. The call is additive only: it cannot delete or rename fields, change the type or flags of an existing field, or add dense or sparse search fields. Get Metadata Schema returns the current schema in the same field shape.
{ "success": false, "data": null, "error": { "code": "INTERNAL_ERROR", "message": "Schema conflict: field \"region\" already exists in the schema with a different definition. Resubmitting a field with its existing definition is accepted as a no-op, but an existing field cannot be modified. See https://docs.hydradb.com/api-reference/v2/endpoint/patch-metadata-schema for usage details. Re-send the field with its existing definition to make this a no-op, or use a different field name." }, "meta": { "request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d", "latency_ms": 4.8 }}
Request body
Name
Description
New metadata schema fields to append. Must contain at least one field. A field that already exists with an identical definition is skipped, so you can resend your full field list.
Each add_fields[] item uses the same field shape as database_metadata_schema on Create Database:
Field
Description
New metadata key. Must start with a letter, contain only letters, numbers, and underscores (up to 255 characters), and not be a reserved system name.
VARCHAR, BOOL, INT8, INT16, INT32, INT64, FLOAT, DOUBLE, JSON, or friendly aliases such as string, integer, float, boolean, object. Defaults to VARCHAR. ARRAY is not supported and is rejected with 400; for multi-value fields declare VARCHAR and store the values comma-joined.
Max length for VARCHAR. Default 1024; maximum 65535.
Rejected with 400 on a new field. Dense semantic-search fields can only be declared at database creation.
Rejected with 400 on a new field. Sparse keyword-search fields can only be declared at database creation.
Rules
Conflicts: An existing field name cannot be reused with a different definition, case-insensitively. A field that differs from the existing one in type, max_length, or flags returns 409, as does one name declared twice in a request with different definitions.
Resending: A field resent with its identical definition is a no-op, including an existing field that already has dense or sparse flags.
Field limit: A database can have at most 32 custom metadata fields. Skipped fields do not count toward the new total.
Reserved names: Names such as source_id, chunk_id, metadata, and document_metadata are rejected.
Response
A success returns database, the deprecated tenant_id, and added_fields directly, without the success/data envelope. added_fields lists only the fields this call added, so an empty list means the database already had everything you sent. Errors use the standard error envelope.
Errors
Status
When it happens
400
Invalid request body (INVALID_INPUT), empty add_fields, invalid field name or type, ARRAY, too many fields, or an embedding flag on a new field.
404
Database not found (DATABASE_NOT_FOUND).
409
A field conflicts with an existing field or with another entry in the same request, or the database changed during the request (retry this last case).
500
Saving the schema failed. Retry.
Apart from a malformed body and a missing database, this endpoint currently returns error.code: "INTERNAL_ERROR" for 400, 409, and 500 alike. Branch on the HTTP status and read error.message, which names the field and the rule it broke.
Names of the metadata schema fields successfully added.
Example:
["region", "summary_label"]
database
string
required
Owning database. Formerly tenant_id; the tenant_id alias is still accepted (deprecated).
Example:
"acme_corp"
tenant_id
string
deprecated
Deprecated: use database.
Example:
"acme_corp"
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"HydraDB","colors":{"primary":"#FF571A","light":"#FF8A54","dark":"#CC4515"},"logo":{"light":"https://mintcdn.com/cortex-e852fafe/BS0KyNLwX-6ZV20u/logo/logo.png?fit=max\u0026auto=format\u0026n=BS0KyNLwX-6ZV20u\u0026q=85\u0026s=8344dc832de70bde023451b8be681c27","dark":"https://mintcdn.com/cortex-e852fafe/BS0KyNLwX-6ZV20u/logo/logo.png?fit=max\u0026auto=format\u0026n=BS0KyNLwX-6ZV20u\u0026q=85\u0026s=8344dc832de70bde023451b8be681c27"},"favicon":"https://mintcdn.com/cortex-e852fafe/s0NUEinSIEJq1NNf/favicon.png?fit=max\u0026auto=format\u0026n=s0NUEinSIEJq1NNf\u0026q=85\u0026s=e7babf84979b4a4cfdba698292f0160a","api":{"examples":{"languages":["python","javascript","curl"]}},"appearance":{"default":"dark"},"background":{"decoration":"grid","color":{"light":"#FFFFFF","dark":"#000000"}},"navbar":{"links":[{"href":"mailto:[email protected]","label":"Support"}],"primary":{"type":"button","label":"Website","href":"https://hydradb.com"}},"styling":{"codeblocks":"dark","latex":true},"integrations":{"posthog":{"apiKey":"phc_qH6psLVjkWQFAGSmTJoKkpVG9Tj5KUqzULfAn9mYdg79","apiHost":"https://us.i.posthog.com","sessionRecording":true}},"contextual":{"options":["copy","download-spec","chatgpt","claude"],"display":"header"},"markdown":{"instructions":"AGENTS.md is HydraDB's maintained agent guide. Read https://docs.hydradb.com/AGENTS.md once, then use its content. /llms.txt and /llms-full.txt redirect to the same guide; they are not separate documentation indexes. If the guide is already loaded, continue with it instead of fetching either alias or reloading the guide."},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"cortex-e852fafe","hasAudioNarration":false,"actualSubdomain":"cortex-e852fafe","customDomains":["docs.hydradb.com"],"gitSource":{"type":"github","owner":"hydra-db","repo":"mintlify-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"feedback":{"agentFeedback":true,"thumbs":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6b081dd8f3da7f068e3ed54f","clientVersion":"0.0.4347","searchFilterCounts":[{"language":"default","tag":"API Reference","count":69},{"language":"default","tag":"Guides","count":27},{"language":"default","tag":"Cookbooks","count":14},{"language":"default","tag":"Essentials","count":12},{"language":"default","tag":"Databases","count":10},{"language":"default","tag":"Webhooks","count":10},{"language":"default","tag":"Connectors","count":9},{"language":"default","tag":"Context","count":9},{"language":"default","tag":"Knowledge \u0026 Memories","count":7},{"language":"default","tag":"Tenants","count":7}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":":where(.mt-8.lg\\:mt-0.flex.flex-col.gap-6.xl\\:hidden.max-h-\\[30rem\\]),:where([class*=\"mt-8\"][class*=\"lg:mt-0\"][class*=\"flex\"][class*=\"flex-col\"][class*=\"gap-6\"][class*=\"xl:hidden\"][class*=\"max-h-[30rem]\"]){display:none!important;visibility:hidden!important;opacity:0!important;height:0!important;width:0!important;padding:0!important;margin:0!important;position:absolute!important;clip:rect(0, 0, 0, 0)!important;overflow:hidden!important}.mdx-content:has(.api-before-related-resources){display:flex;flex-direction:column}.api-before-related-resources{display:none}.mdx-content span[id]:empty{scroll-margin-top:9.5rem}.mdx-content:has(.api-before-related-resources)>div:has(>.api-section){order:1}.mdx-content:has(.api-before-related-resources) .api-before-related-resources~*{order:2}.field-req{color:#ef4444;font-weight:bold;cursor:default}.field-rec{color:#eab308;font-size:0.6em;vertical-align:middle;cursor:default}.field-wrap{display:inline-block;outline:none}.field-name-row{display:inline-block}.field-type{display:inline-block;margin-left:0.35rem;color:#475569;font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace;font-size:0.78rem;font-weight:700;line-height:1.25;overflow-wrap:anywhere}.dark .field-type,[data-theme=\"dark\"] .field-type{color:#cbd5e1}.field-type::before{content:\"(\"}.field-type::after{content:\")\"}.field-tip{position:absolute;bottom:calc(100% + 4px);left:0;z-index:50;display:none;padding:2px 8px;border:1px solid rgba(255,255,255,0.1);border-radius:4px;background:#1f2937;box-shadow:0 2px 8px rgba(0,0,0,0.3);color:#e5e7eb;font-size:0.7rem;font-weight:500;line-height:1.2;pointer-events:none;white-space:nowrap}.has-field-tip:hover .field-tip,.has-field-tip:focus .field-tip,.has-field-tip:focus-within .field-tip{display:inline-block}.peer.is-not-custom.is-not-center~[class~=\"peer-[.is-not-custom]:peer-[.is-not-center]:max-w-8xl\"]{max-width:104rem!important}"},{"filePath":"footer/footer.css","content":"@font-face{font-family:\"Geist Pixel Square\";src:url(\"/footer/fonts/GeistPixelSquare.woff2\") format(\"woff2\");font-weight:400;font-style:normal;font-display:swap}@font-face{font-family:\"Geist Pixel\";src:url(\"/footer/fonts/GeistPixel.woff2\") format(\"woff2\");font-weight:400;font-style:normal;font-display:swap}.hdb-footer{--hdb-bg: #000;--hdb-border: rgb(53, 53, 53);--hdb-grid: rgb(32, 32, 32);--hdb-fg: #fff;--hdb-fg-66: rgba(255, 255, 255, 0.66);--hdb-fg-60: rgba(255, 255, 255, 0.6);--hdb-accent: #ff571a;--hdb-ease: cubic-bezier(0.44, 0, 0.56, 1);position:relative;width:100%;box-sizing:border-box;margin:0;padding:80px 0;background:var(--hdb-bg);color:var(--hdb-fg);overflow:hidden;isolation:isolate;font-family:\"Geist Pixel Square\", ui-sans-serif, system-ui, -apple-system, sans-serif;font-size:16px;line-height:1.2;text-transform:capitalize;text-align:left;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.hdb-footer *,.hdb-footer *::before,.hdb-footer *::after{box-sizing:border-box}.hdb-footer p,.hdb-footer ul,.hdb-footer nav{margin:0;padding:0}.hdb-footer ul{list-style:none}.hdb-footer a{text-decoration:none}.hdb-footer img,.hdb-footer video{display:block}.hdb-footer__grid{position:absolute;inset:0;z-index:0;pointer-events:none;background-image:repeating-linear-gradient(\n 90deg, var(--hdb-grid) 0, var(--hdb-grid) 1px, transparent 1px, transparent 32px\n );background-size:32px 100%;background-position:center}.hdb-footer::before,.hdb-footer::after{content:\"\";position:absolute;left:0;right:0;height:1px;background:var(--hdb-border);z-index:2;pointer-events:none}.hdb-footer::before{top:80px}.hdb-footer::after{bottom:80px}.hdb-footer__card{position:relative;z-index:1;width:87%;margin:0 auto;display:flex;align-items:stretch;background:var(--hdb-bg)}.hdb-footer__card::after{content:\"\";position:absolute;inset:0;border:1px solid var(--hdb-border);pointer-events:none;z-index:4}.hdb-footer__left{flex:1 1 auto;min-width:0;display:flex;flex-direction:column}.hdb-footer__brand{position:relative;padding:32px}.hdb-footer__brand::after{content:\"\";position:absolute;left:0;right:0;bottom:0;height:1px;background:var(--hdb-border);z-index:3}.hdb-footer__brand-inner{display:flex;flex-direction:column;gap:24px;max-width:400px}.hdb-footer__logo{display:inline-block;width:180px;height:33px}.hdb-footer__logo img{width:180px;height:33px;object-fit:cover}.hdb-footer__tagline{font-family:\"Geist Pixel Square\", ui-sans-serif, system-ui, sans-serif;font-size:20px;line-height:1.1;letter-spacing:-0.01em;color:var(--hdb-fg)}.hdb-footer__cols{flex:1 1 auto;display:flex;flex-direction:column;justify-content:space-between;gap:24px;padding:32px}.hdb-footer__cols-row{display:flex;flex-direction:row;gap:24px}.hdb-footer__col{display:flex;flex-direction:column;gap:12px}.hdb-footer__col:nth-child(1){width:151px}.hdb-footer__col:nth-child(2){width:174px}.hdb-footer__col:nth-child(3){width:175px}.hdb-footer__col:nth-child(4){width:174px}.hdb-footer__list{display:flex;flex-direction:column;gap:12px}.hdb-footer__head{display:block;font-family:\"Geist Pixel Square\", ui-sans-serif, system-ui, sans-serif;font-size:18px;line-height:1.2;letter-spacing:-0.01em;color:var(--hdb-fg-60);transition:color 0.4s var(--hdb-ease)}.hdb-footer__link{display:block;font-family:\"Geist Pixel\", ui-sans-serif, system-ui, sans-serif;font-size:14px;line-height:1.2;letter-spacing:-0.01em;color:var(--hdb-fg-60);transition:color 0.4s var(--hdb-ease)}.hdb-footer__head:hover,.hdb-footer__link:hover{color:var(--hdb-fg);text-decoration:underline;text-underline-offset:2px}.hdb-footer__col:nth-child(2) .hdb-footer__head,.hdb-footer__col:nth-child(3) .hdb-footer__head,.hdb-footer__col:nth-child(2) .hdb-footer__link,.hdb-footer__col:nth-child(3) .hdb-footer__list li:last-child .hdb-footer__link{letter-spacing:normal}.hdb-footer__badges{display:flex;flex-direction:row;gap:16px}.hdb-footer__badge{width:52px;height:52px;border-radius:50%;object-fit:cover}.hdb-footer__right{position:relative;flex:0 0 33%;min-width:0;display:flex;flex-direction:column}.hdb-footer__right::before{content:\"\";position:absolute;top:0;bottom:0;left:0;width:1px;background:var(--hdb-border);z-index:3}.hdb-footer__social{position:relative;display:flex;flex-direction:row;align-items:center;justify-content:space-between;padding:14px 32px}.hdb-footer__social::after{content:\"\";position:absolute;left:0;right:0;bottom:0;height:1px;background:var(--hdb-border);z-index:3}.hdb-footer__social-link{display:inline-flex;flex-direction:row;align-items:center;justify-content:flex-end;gap:4px;color:var(--hdb-fg-66);transition:color 0.4s var(--hdb-ease)}.hdb-footer__social-label{font-family:\"Geist Pixel Square\", ui-sans-serif, system-ui, sans-serif;font-size:16px;line-height:1.1;letter-spacing:-0.01em;color:var(--hdb-fg-66);white-space:nowrap;transition:color 0.4s var(--hdb-ease)}.hdb-footer__social-link:hover .hdb-footer__social-label{color:var(--hdb-fg)}.hdb-footer__icon{width:24px;height:24px;color:var(--hdb-fg);flex:none}.hdb-footer__video{position:relative;width:100%;height:396px;overflow:hidden}.hdb-footer__video::after{content:\"\";position:absolute;left:0;right:0;bottom:0;height:1px;background:var(--hdb-border);z-index:3}.hdb-footer__video-el{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}.hdb-footer__copy{display:flex;flex-direction:column;justify-content:center;padding:18px 32px;opacity:0.66}.hdb-footer__copy p{font-family:\"Geist Pixel Square\", ui-sans-serif, system-ui, sans-serif;font-size:16px;line-height:1.1;letter-spacing:-0.01em;color:var(--hdb-fg)}.hdb-footer a:focus-visible{outline:2px solid var(--hdb-accent);outline-offset:2px;border-radius:2px}@media (min-width: 1200px) and (max-width: 1439.98px){.hdb-footer__card{width:calc((100% - 80px) * 0.87)}.hdb-footer__social-label{display:none}}@media (min-width: 810px) and (max-width: 1199.98px){.hdb-footer__card{width:calc((100% - 80px) * 0.87);flex-direction:column}.hdb-footer__right{flex:1 1 auto;width:100%}.hdb-footer__right::before{top:0;bottom:auto;left:0;right:0;width:auto;height:1px}.hdb-footer__cols{display:block;padding:32px}.hdb-footer__cols-row{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:auto auto;grid-auto-flow:column;gap:24px;align-items:start}.hdb-footer__col{width:auto!important}.hdb-footer__badges{margin-top:58px}.hdb-footer__video{height:360px}}@media (max-width: 809.98px){.hdb-footer__card{width:87%;flex-direction:column;padding:0 20px}.hdb-footer__right{flex:1 1 auto;width:100%}.hdb-footer__right::before{top:0;bottom:auto;left:0;right:0;width:auto;height:1px}.hdb-footer__brand{padding:20px}.hdb-footer__cols{display:flex;flex-direction:column;gap:24px;padding:20px}.hdb-footer__cols-row{display:flex;flex-direction:column;gap:24px}.hdb-footer__col{width:auto!important}.hdb-footer__badges{margin-top:0}.hdb-footer__social{padding:14px 20px}.hdb-footer__social-label{display:none}.hdb-footer__video{height:442px}.hdb-footer__copy{padding:18px 20px}}"}]}
{"page":{"pagePath":"api-reference/v2/endpoint/update-metadata-schema","slug":"/api-reference/v2/endpoint/update-metadata-schema","pageMetadata":{"title":"Update Metadata Schema","description":"Add new database metadata schema fields after database creation.","openapi":"api-reference/v2/openapi.json PATCH /databases/{database}/metadata-schema","href":"/api-reference/v2/endpoint/update-metadata-schema"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Add new database metadata schema fields after database creation.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];const Field=({name,type,required,recommended})=>{const label=required?`required`:recommended?`recommended`:null;const typeLabel=typeof type===`string`?type:null;const ariaParts=[name,typeLabel\u0026\u0026`${typeLabel}`,label].filter(Boolean);return _jsxs(`span`,{\"aria-label\":ariaParts.join(`, `),className:label?`field-wrap has-field-tip`:`field-wrap`,style:{position:`relative`,cursor:label?`default`:undefined},tabIndex:label?0:undefined,children:[_jsxs(`span`,{className:`field-name-row`,children:[_jsx(`code`,{children:name}),required\u0026\u0026_jsx(`span`,{className:`field-req`,children:` *`}),recommended\u0026\u0026_jsx(`span`,{className:`field-rec`,children:` ●`})]}),type\u0026\u0026_jsx(`span`,{className:`field-type`,children:type}),label\u0026\u0026_jsx(`span`,{className:`field-tip`,role:`tooltip`,children:label})]})};function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{Heading,Table,_MdxComponentBoundary}=_components;if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!_MdxComponentBoundary)_missingMdxReference(`_MdxComponentBoundary`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Adds fields to a database’s metadata schema after creation. The call is additive only: it cannot delete or rename fields, change the type or flags of an existing field, or add dense or sparse search fields. `,_jsx(_components.a,{href:`/api-reference/v2/endpoint/get-metadata-schema`,children:`Get Metadata Schema`}),` returns the current schema in the same field shape.`]}),`\n`,`\n`,`\n`,_jsx(Heading,{level:`2`,id:`request-body`,children:`Request body`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Name`}),_jsx(_components.th,{children:`Description`})]})}),_jsx(_components.tbody,{children:_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_MdxComponentBoundary,{name:`Field`,children:_jsx(Field,{name:`add_fields`,type:`array`,required:true})})}),_jsx(_components.td,{children:`New metadata schema fields to append. Must contain at least one field. A field that already exists with an identical definition is skipped, so you can resend your full field list.`})]})})]}),`\n`,_jsxs(_components.p,{children:[`Each `,_jsx(_components.code,{children:`add_fields[]`}),` item uses the same field shape as `,_jsx(_components.code,{children:`database_metadata_schema`}),` on `,_jsx(_components.a,{href:`/api-reference/v2/endpoint/create-database`,children:`Create Database`}),`:`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_MdxComponentBoundary,{name:`Field`,children:_jsx(Field,{name:`name`,type:`string`,required:true})})}),_jsx(_components.td,{children:`New metadata key. Must start with a letter, contain only letters, numbers, and underscores (up to 255 characters), and not be a reserved system name.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_MdxComponentBoundary,{name:`Field`,children:_jsx(Field,{name:`data_type`,type:`string`})})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`VARCHAR`}),`, `,_jsx(_components.code,{children:`BOOL`}),`, `,_jsx(_components.code,{children:`INT8`}),`, `,_jsx(_components.code,{children:`INT16`}),`, `,_jsx(_components.code,{children:`INT32`}),`, `,_jsx(_components.code,{children:`INT64`}),`, `,_jsx(_components.code,{children:`FLOAT`}),`, `,_jsx(_components.code,{children:`DOUBLE`}),`, `,_jsx(_components.code,{children:`JSON`}),`, or friendly aliases such as `,_jsx(_components.code,{children:`string`}),`, `,_jsx(_components.code,{children:`integer`}),`, `,_jsx(_components.code,{children:`float`}),`, `,_jsx(_components.code,{children:`boolean`}),`, `,_jsx(_components.code,{children:`object`}),`. Defaults to `,_jsx(_components.code,{children:`VARCHAR`}),`. `,_jsx(_components.code,{children:`ARRAY`}),` is not supported and is rejected with `,_jsx(_components.code,{children:`400`}),`; for multi-value fields declare `,_jsx(_components.code,{children:`VARCHAR`}),` and store the values comma-joined.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_MdxComponentBoundary,{name:`Field`,children:_jsx(Field,{name:`max_length`,type:`integer`})})}),_jsxs(_components.td,{children:[`Max length for `,_jsx(_components.code,{children:`VARCHAR`}),`. Default `,_jsx(_components.code,{children:`1024`}),`; maximum `,_jsx(_components.code,{children:`65535`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_MdxComponentBoundary,{name:`Field`,children:_jsx(Field,{name:`enable_dense_embedding`,type:`boolean`})})}),_jsxs(_components.td,{children:[`Rejected with `,_jsx(_components.code,{children:`400`}),` on a new field. Dense semantic-search fields can only be declared at `,_jsx(_components.a,{href:`/api-reference/v2/endpoint/create-database`,children:`database creation`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_MdxComponentBoundary,{name:`Field`,children:_jsx(Field,{name:`enable_sparse_embedding`,type:`boolean`})})}),_jsxs(_components.td,{children:[`Rejected with `,_jsx(_components.code,{children:`400`}),` on a new field. Sparse keyword-search fields can only be declared at database creation.`]})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`rules`,children:`Rules`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Conflicts:`}),` An existing field name cannot be reused with a different definition, case-insensitively. A field that differs from the existing one in type, `,_jsx(_components.code,{children:`max_length`}),`, or flags returns `,_jsx(_components.code,{children:`409`}),`, as does one name declared twice in a request with different definitions.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Resending:`}),` A field resent with its identical definition is a no-op, including an existing field that already has dense or sparse flags.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Field limit:`}),` A database can have at most 32 custom metadata fields. Skipped fields do not count toward the new total.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Reserved names:`}),` Names such as `,_jsx(_components.code,{children:`source_id`}),`, `,_jsx(_components.code,{children:`chunk_id`}),`, `,_jsx(_components.code,{children:`metadata`}),`, and `,_jsx(_components.code,{children:`document_metadata`}),` are rejected.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`response`,children:`Response`}),`\n`,_jsxs(_components.p,{children:[`A success returns `,_jsx(_components.code,{children:`database`}),`, the deprecated `,_jsx(_components.code,{children:`tenant_id`}),`, and `,_jsx(_components.code,{children:`added_fields`}),` directly, without the `,_jsx(_components.code,{children:`success`}),`/`,_jsx(_components.code,{children:`data`}),` envelope. `,_jsx(_components.code,{children:`added_fields`}),` lists only the fields this call added, so an empty list means the database already had everything you sent. Errors use the standard `,_jsx(_components.a,{href:`/api-reference/v2/error-responses`,children:`error envelope`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`errors`,children:`Errors`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Status`}),_jsx(_components.th,{children:`When it happens`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`400`})}),_jsxs(_components.td,{children:[`Invalid request body (`,_jsx(_components.code,{children:`INVALID_INPUT`}),`), empty `,_jsx(_components.code,{children:`add_fields`}),`, invalid field name or type, `,_jsx(_components.code,{children:`ARRAY`}),`, too many fields, or an embedding flag on a new field.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`404`})}),_jsxs(_components.td,{children:[`Database not found (`,_jsx(_components.code,{children:`DATABASE_NOT_FOUND`}),`).`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`409`})}),_jsx(_components.td,{children:`A field conflicts with an existing field or with another entry in the same request, or the database changed during the request (retry this last case).`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`500`})}),_jsx(_components.td,{children:`Saving the schema failed. Retry.`})]})]})]}),`\n`,_jsxs(_components.p,{children:[`Apart from a malformed body and a missing database, this endpoint currently returns `,_jsx(_components.code,{children:`error.code: \"INTERNAL_ERROR\"`}),` for `,_jsx(_components.code,{children:`400`}),`, `,_jsx(_components.code,{children:`409`}),`, and `,_jsx(_components.code,{children:`500`}),` alike. Branch on the HTTP status and read `,_jsx(_components.code,{children:`error.message`}),`, which names the field and the rule it broke.`]}),`\n`,_jsx(`div`,{className:`api-before-related-resources`}),`\n`,_jsx(Heading,{level:`2`,id:`related-resources`,children:`Related resources`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Before this:`}),` `,_jsx(_components.a,{href:`/api-reference/v2/endpoint/get-metadata-schema`,children:`Get Metadata Schema`}),`: read the current fields`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Before this:`}),` `,_jsx(_components.a,{href:`/api-reference/v2/endpoint/create-database`,children:`Create Database`}),`: declare the initial schema, including dense and sparse search fields`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`After this:`}),` `,_jsx(_components.a,{href:`/api-reference/v2/endpoint/ingest-context`,children:`Ingest Context`}),`: send values for the new fields in `,_jsx(_components.code,{children:`metadata`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`After this:`}),` `,_jsx(_components.a,{href:`/api-reference/v2/endpoint/query`,children:`Query`}),`: filter on the new fields with `,_jsx(_components.code,{children:`metadata_filters`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Guide:`}),` `,_jsx(_components.a,{href:`/essentials/v2/metadata`,children:`Metadata Filters`})]}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{Field,default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"codeStyling":"dark","config":{},"pageMetadata":{"title":"Update Metadata Schema","description":"Add new database metadata schema fields after database creation.","openapi":"api-reference/v2/openapi.json PATCH /databases/{database}/metadata-schema","href":"/api-reference/v2/endpoint/update-metadata-schema"}}},"mdxSourceWithNoJs":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];const Field=()=>null;function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,RequestExample,ResponseExample,Table,_MdxComponentBoundary}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!RequestExample)_missingMdxReference(`RequestExample`,true);if(!ResponseExample)_missingMdxReference(`ResponseExample`,true);if(!Table)_missingMdxReference(`Table`,true);if(!_MdxComponentBoundary)_missingMdxReference(`_MdxComponentBoundary`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Adds fields to a database’s metadata schema after creation. The call is additive only: it cannot delete or rename fields, change the type or flags of an existing field, or add dense or sparse search fields. `,_jsx(_components.a,{href:`/api-reference/v2/endpoint/get-metadata-schema`,children:`Get Metadata Schema`}),` returns the current schema in the same field shape.`]}),`\n`,_jsxs(RequestExample,{children:[_jsx(CodeBlock,{filename:`Python SDK`,numberOfLines:`7`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`7`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`response = client.databases.update_metadata_schema(`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"acme_corp\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` add_fields`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=[`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` {`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"name\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"region\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"data_type\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"VARCHAR\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` {`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"name\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"priority\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"data_type\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"INT64\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`},`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`TypeScript SDK`,numberOfLines:`7`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`7`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:` response`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` client`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`databases`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`updateMetadataSchema`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` database:`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"acme_corp\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` addFields:`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` [`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`name:`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"region\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`dataType:`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"VARCHAR\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`name:`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"priority\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`dataType:`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"INT64\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`cURL`,numberOfLines:`16`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`16`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` PATCH`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` 'https://api.hydradb.com/databases/acme_corp/metadata-schema'`}),_jsx(_components.span,{style:{color:`#D7BA7D`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`$HYDRADB_API_KEY`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#D7BA7D`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"API-Version: 2\"`}),_jsx(_components.span,{style:{color:`#D7BA7D`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#D7BA7D`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"add_fields\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"name\": \"region\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"data_type\": \"VARCHAR\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"name\": \"priority\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"data_type\": \"INT64\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` ]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})})]}),`\n`,_jsxs(ResponseExample,{children:[_jsx(CodeBlock,{filename:`Success`,numberOfLines:`5`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"database\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"acme_corp\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"tenant_id\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"acme_corp\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"added_fields\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"region\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"priority\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Conflict`,numberOfLines:`12`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`12`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"success\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`false`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"data\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`null`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"error\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"code\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"INTERNAL_ERROR\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"message\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Schema conflict: field `}),_jsx(_components.span,{style:{color:`#D7BA7D`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`region`}),_jsx(_components.span,{style:{color:`#D7BA7D`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` already exists in the schema with a different definition. Resubmitting a field with its existing definition is accepted as a no-op, but an existing field cannot be modified. See https://docs.hydradb.com/api-reference/v2/endpoint/patch-metadata-schema for usage details. Re-send the field with its existing definition to make this a no-op, or use a different field name.\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"meta\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"request_id\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"9d13aef4-02f4-4e73-8c62-4c2601d04f9d\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"latency_ms\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`4.8`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})})]}),`\n`,_jsx(Heading,{level:`2`,id:`request-body`,children:`Request body`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Name`}),_jsx(_components.th,{children:`Description`})]})}),_jsx(_components.tbody,{children:_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_MdxComponentBoundary,{name:`Field`,children:_jsx(Field,{name:`add_fields`,type:`array`,required:true})})}),_jsx(_components.td,{children:`New metadata schema fields to append. Must contain at least one field. A field that already exists with an identical definition is skipped, so you can resend your full field list.`})]})})]}),`\n`,_jsxs(_components.p,{children:[`Each `,_jsx(_components.code,{children:`add_fields[]`}),` item uses the same field shape as `,_jsx(_components.code,{children:`database_metadata_schema`}),` on `,_jsx(_components.a,{href:`/api-reference/v2/endpoint/create-database`,children:`Create Database`}),`:`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_MdxComponentBoundary,{name:`Field`,children:_jsx(Field,{name:`name`,type:`string`,required:true})})}),_jsx(_components.td,{children:`New metadata key. Must start with a letter, contain only letters, numbers, and underscores (up to 255 characters), and not be a reserved system name.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_MdxComponentBoundary,{name:`Field`,children:_jsx(Field,{name:`data_type`,type:`string`})})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`VARCHAR`}),`, `,_jsx(_components.code,{children:`BOOL`}),`, `,_jsx(_components.code,{children:`INT8`}),`, `,_jsx(_components.code,{children:`INT16`}),`, `,_jsx(_components.code,{children:`INT32`}),`, `,_jsx(_components.code,{children:`INT64`}),`, `,_jsx(_components.code,{children:`FLOAT`}),`, `,_jsx(_components.code,{children:`DOUBLE`}),`, `,_jsx(_components.code,{children:`JSON`}),`, or friendly aliases such as `,_jsx(_components.code,{children:`string`}),`, `,_jsx(_components.code,{children:`integer`}),`, `,_jsx(_components.code,{children:`float`}),`, `,_jsx(_components.code,{children:`boolean`}),`, `,_jsx(_components.code,{children:`object`}),`. Defaults to `,_jsx(_components.code,{children:`VARCHAR`}),`. `,_jsx(_components.code,{children:`ARRAY`}),` is not supported and is rejected with `,_jsx(_components.code,{children:`400`}),`; for multi-value fields declare `,_jsx(_components.code,{children:`VARCHAR`}),` and store the values comma-joined.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_MdxComponentBoundary,{name:`Field`,children:_jsx(Field,{name:`max_length`,type:`integer`})})}),_jsxs(_components.td,{children:[`Max length for `,_jsx(_components.code,{children:`VARCHAR`}),`. Default `,_jsx(_components.code,{children:`1024`}),`; maximum `,_jsx(_components.code,{children:`65535`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_MdxComponentBoundary,{name:`Field`,children:_jsx(Field,{name:`enable_dense_embedding`,type:`boolean`})})}),_jsxs(_components.td,{children:[`Rejected with `,_jsx(_components.code,{children:`400`}),` on a new field. Dense semantic-search fields can only be declared at `,_jsx(_components.a,{href:`/api-reference/v2/endpoint/create-database`,children:`database creation`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_MdxComponentBoundary,{name:`Field`,children:_jsx(Field,{name:`enable_sparse_embedding`,type:`boolean`})})}),_jsxs(_components.td,{children:[`Rejected with `,_jsx(_components.code,{children:`400`}),` on a new field. Sparse keyword-search fields can only be declared at database creation.`]})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`rules`,children:`Rules`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Conflicts:`}),` An existing field name cannot be reused with a different definition, case-insensitively. A field that differs from the existing one in type, `,_jsx(_components.code,{children:`max_length`}),`, or flags returns `,_jsx(_components.code,{children:`409`}),`, as does one name declared twice in a request with different definitions.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Resending:`}),` A field resent with its identical definition is a no-op, including an existing field that already has dense or sparse flags.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Field limit:`}),` A database can have at most 32 custom metadata fields. Skipped fields do not count toward the new total.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Reserved names:`}),` Names such as `,_jsx(_components.code,{children:`source_id`}),`, `,_jsx(_components.code,{children:`chunk_id`}),`, `,_jsx(_components.code,{children:`metadata`}),`, and `,_jsx(_components.code,{children:`document_metadata`}),` are rejected.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`response`,children:`Response`}),`\n`,_jsxs(_components.p,{children:[`A success returns `,_jsx(_components.code,{children:`database`}),`, the deprecated `,_jsx(_components.code,{children:`tenant_id`}),`, and `,_jsx(_components.code,{children:`added_fields`}),` directly, without the `,_jsx(_components.code,{children:`success`}),`/`,_jsx(_components.code,{children:`data`}),` envelope. `,_jsx(_components.code,{children:`added_fields`}),` lists only the fields this call added, so an empty list means the database already had everything you sent. Errors use the standard `,_jsx(_components.a,{href:`/api-reference/v2/error-responses`,children:`error envelope`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`errors`,children:`Errors`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Status`}),_jsx(_components.th,{children:`When it happens`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`400`})}),_jsxs(_components.td,{children:[`Invalid request body (`,_jsx(_components.code,{children:`INVALID_INPUT`}),`), empty `,_jsx(_components.code,{children:`add_fields`}),`, invalid field name or type, `,_jsx(_components.code,{children:`ARRAY`}),`, too many fields, or an embedding flag on a new field.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`404`})}),_jsxs(_components.td,{children:[`Database not found (`,_jsx(_components.code,{children:`DATABASE_NOT_FOUND`}),`).`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`409`})}),_jsx(_components.td,{children:`A field conflicts with an existing field or with another entry in the same request, or the database changed during the request (retry this last case).`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`500`})}),_jsx(_components.td,{children:`Saving the schema failed. Retry.`})]})]})]}),`\n`,_jsxs(_components.p,{children:[`Apart from a malformed body and a missing database, this endpoint currently returns `,_jsx(_components.code,{children:`error.code: \"INTERNAL_ERROR\"`}),` for `,_jsx(_components.code,{children:`400`}),`, `,_jsx(_components.code,{children:`409`}),`, and `,_jsx(_components.code,{children:`500`}),` alike. Branch on the HTTP status and read `,_jsx(_components.code,{children:`error.message`}),`, which names the field and the rule it broke.`]}),`\n`,_jsx(`div`,{className:`api-before-related-resources`}),`\n`,_jsx(Heading,{level:`2`,id:`related-resources`,children:`Related resources`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Before this:`}),` `,_jsx(_components.a,{href:`/api-reference/v2/endpoint/get-metadata-schema`,children:`Get Metadata Schema`}),`: read the current fields`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Before this:`}),` `,_jsx(_components.a,{href:`/api-reference/v2/endpoint/create-database`,children:`Create Database`}),`: declare the initial schema, including dense and sparse search fields`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`After this:`}),` `,_jsx(_components.a,{href:`/api-reference/v2/endpoint/ingest-context`,children:`Ingest Context`}),`: send values for the new fields in `,_jsx(_components.code,{children:`metadata`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`After this:`}),` `,_jsx(_components.a,{href:`/api-reference/v2/endpoint/query`,children:`Query`}),`: filter on the new fields with `,_jsx(_components.code,{children:`metadata_filters`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Guide:`}),` `,_jsx(_components.a,{href:`/essentials/v2/metadata`,children:`Metadata Filters`})]}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{Field,default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"codeStyling":"dark","config":{},"pageMetadata":{"title":"Update Metadata Schema","description":"Add new database metadata schema fields after database creation.","openapi":"api-reference/v2/openapi.json PATCH /databases/{database}/metadata-schema","href":"/api-reference/v2/endpoint/update-metadata-schema"}}}},"mdxExtracts":{"tableOfContents":[{"title":"Request body","slug":"request-body","depth":2,"children":[]},{"title":"Rules","slug":"rules","depth":2,"children":[]},{"title":"Response","slug":"response","depth":2,"children":[]},{"title":"Errors","slug":"errors","depth":2,"children":[]},{"title":"Related resources","slug":"related-resources","depth":2,"children":[]}],"codeExamples":{"request":{"type":"RequestExample","children":[{"filename":"Python SDK","html":"\u003cpre class=\"shiki shiki-themes dark-plus dark-plus\" style=\"background-color:#0B0C0E;--shiki-dark-bg:#0B0C0E;color:#D4D4D4;--shiki-dark:#D4D4D4\" language=\"python\">\u003ccode language=\"python\" numberOfLines=\"7\">\u003cspan class=\"line\">\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">response = client.databases.update_metadata_schema(\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\"> \"acme_corp\"\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#9CDCFE;--shiki-dark:#9CDCFE\"> add_fields\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">=[\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\"> {\u003c/span>\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\">\"name\"\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\">\"region\"\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\">\"data_type\"\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\">\"VARCHAR\"\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">},\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\"> {\u003c/span>\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\">\"name\"\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\">\"priority\"\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\">\"data_type\"\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\">\"INT64\"\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">},\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\"> ],\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">)\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"TypeScript SDK","html":"\u003cpre class=\"shiki shiki-themes dark-plus dark-plus\" style=\"background-color:#0B0C0E;--shiki-dark-bg:#0B0C0E;color:#D4D4D4;--shiki-dark:#D4D4D4\" language=\"typescript\">\u003ccode language=\"typescript\" numberOfLines=\"7\">\u003cspan class=\"line\">\u003cspan style=\"color:#569CD6;--shiki-dark:#569CD6\">const\u003c/span>\u003cspan style=\"color:#4FC1FF;--shiki-dark:#4FC1FF\"> response\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\"> = \u003c/span>\u003cspan style=\"color:#C586C0;--shiki-dark:#C586C0\">await\u003c/span>\u003cspan style=\"color:#9CDCFE;--shiki-dark:#9CDCFE\"> client\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#9CDCFE;--shiki-dark:#9CDCFE\">databases\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#DCDCAA;--shiki-dark:#DCDCAA\">updateMetadataSchema\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">({\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#9CDCFE;--shiki-dark:#9CDCFE\"> database:\u003c/span>\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\"> \"acme_corp\"\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#9CDCFE;--shiki-dark:#9CDCFE\"> addFields:\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\"> [\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\"> { \u003c/span>\u003cspan style=\"color:#9CDCFE;--shiki-dark:#9CDCFE\">name:\u003c/span>\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\"> \"region\"\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#9CDCFE;--shiki-dark:#9CDCFE\">dataType:\u003c/span>\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\"> \"VARCHAR\"\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\"> { \u003c/span>\u003cspan style=\"color:#9CDCFE;--shiki-dark:#9CDCFE\">name:\u003c/span>\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\"> \"priority\"\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#9CDCFE;--shiki-dark:#9CDCFE\">dataType:\u003c/span>\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\"> \"INT64\"\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\"> ],\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">});\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"cURL","html":"\u003cpre class=\"shiki shiki-themes dark-plus dark-plus\" style=\"background-color:#0B0C0E;--shiki-dark-bg:#0B0C0E;color:#D4D4D4;--shiki-dark:#D4D4D4\" language=\"shellscript\">\u003ccode language=\"shellscript\" numberOfLines=\"16\">\u003cspan class=\"line\">\u003cspan style=\"color:#DCDCAA;--shiki-dark:#DCDCAA\">curl\u003c/span>\u003cspan style=\"color:#569CD6;--shiki-dark:#569CD6\"> -X\u003c/span>\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\"> PATCH\u003c/span>\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\"> 'https://api.hydradb.com/databases/acme_corp/metadata-schema'\u003c/span>\u003cspan style=\"color:#D7BA7D;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#569CD6;--shiki-dark:#569CD6\"> -H\u003c/span>\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\"> \"Authorization: Bearer \u003c/span>\u003cspan style=\"color:#9CDCFE;--shiki-dark:#9CDCFE\">$HYDRADB_API_KEY\u003c/span>\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\">\"\u003c/span>\u003cspan style=\"color:#D7BA7D;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#569CD6;--shiki-dark:#569CD6\"> -H\u003c/span>\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\"> \"API-Version: 2\"\u003c/span>\u003cspan style=\"color:#D7BA7D;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#569CD6;--shiki-dark:#569CD6\"> -H\u003c/span>\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\"> \"Content-Type: application/json\"\u003c/span>\u003cspan style=\"color:#D7BA7D;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#569CD6;--shiki-dark:#569CD6\"> -d\u003c/span>\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\"> '{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\"> \"add_fields\": [\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\"> {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\"> \"name\": \"region\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\"> \"data_type\": \"VARCHAR\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\"> {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\"> \"name\": \"priority\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\"> \"data_type\": \"INT64\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\"> ]\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\"> }'\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]},"response":{"type":"ResponseExample","children":[{"filename":"Success","html":"\u003cpre class=\"shiki shiki-themes dark-plus dark-plus\" style=\"background-color:#0B0C0E;--shiki-dark-bg:#0B0C0E;color:#D4D4D4;--shiki-dark:#D4D4D4\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"5\">\u003cspan class=\"line\">\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#9CDCFE;--shiki-dark:#9CDCFE\"> \"database\"\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\">\"acme_corp\"\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#9CDCFE;--shiki-dark:#9CDCFE\"> \"tenant_id\"\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\">\"acme_corp\"\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#9CDCFE;--shiki-dark:#9CDCFE\"> \"added_fields\"\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">: [\u003c/span>\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\">\"region\"\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\">\"priority\"\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">]\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"Conflict","html":"\u003cpre class=\"shiki shiki-themes dark-plus dark-plus\" style=\"background-color:#0B0C0E;--shiki-dark-bg:#0B0C0E;color:#D4D4D4;--shiki-dark:#D4D4D4\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"12\">\u003cspan class=\"line\">\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#9CDCFE;--shiki-dark:#9CDCFE\"> \"success\"\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#569CD6;--shiki-dark:#569CD6\">false\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#9CDCFE;--shiki-dark:#9CDCFE\"> \"data\"\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#569CD6;--shiki-dark:#569CD6\">null\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#9CDCFE;--shiki-dark:#9CDCFE\"> \"error\"\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">: {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#9CDCFE;--shiki-dark:#9CDCFE\"> \"code\"\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\">\"INTERNAL_ERROR\"\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#9CDCFE;--shiki-dark:#9CDCFE\"> \"message\"\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\">\"Schema conflict: field \u003c/span>\u003cspan style=\"color:#D7BA7D;--shiki-dark:#D7BA7D\">\\\"\u003c/span>\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\">region\u003c/span>\u003cspan style=\"color:#D7BA7D;--shiki-dark:#D7BA7D\">\\\"\u003c/span>\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\"> already exists in the schema with a different definition. Resubmitting a field with its existing definition is accepted as a no-op, but an existing field cannot be modified. See https://docs.hydradb.com/api-reference/v2/endpoint/patch-metadata-schema for usage details. Re-send the field with its existing definition to make this a no-op, or use a different field name.\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#9CDCFE;--shiki-dark:#9CDCFE\"> \"meta\"\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">: {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#9CDCFE;--shiki-dark:#9CDCFE\"> \"request_id\"\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\">\"9d13aef4-02f4-4e73-8c62-4c2601d04f9d\"\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#9CDCFE;--shiki-dark:#9CDCFE\"> \"latency_ms\"\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#B5CEA8;--shiki-dark:#B5CEA8\">4.8\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]}}},"jsLinks":["/_mintlify/custom/cortex-e852fafe/e7a491fa57f47ac4/reo.js","/_mintlify/custom/cortex-e852fafe/6addee7178460057/footer.js"],"openApiReferenceData":{"operation":{"description":"Add new database metadata schema fields after database creation.","parameters":["3428076f-91da-4c46-826e-d1cfd4234cce"],"requestBody":"a29bf4ab-583f-4297-8371-5a74de41c584","responses":{"200":"15d9e4db-b703-458f-956a-6a5e8632f757","400":"97f41d8f-5083-456b-a971-97963a3e7f89","404":"d50d58c7-d426-4628-8e48-529d44c9a25b","409":"82fef145-0fd3-4437-880a-66f1d29b352e","500":"a7e90e75-3a73-4227-9a62-dc7e6f2762fe"},"security":["db856e27-aef8-42cb-9497-e2ed529291f6"],"summary":"Update metadata schema","tags":["database-management"],"x-fern-sdk-group-name":"databases","x-fern-sdk-method-name":"update_metadata_schema","method":"patch","type":"path","servers":["e582ccd8-d5b8-418b-9825-737cb4a46e19"],"path":"/databases/{database}/metadata-schema","baseUrlOptions":["https://api.hydradb.com"],"title":"Update metadata schema","codeSamples":[],"requestExampleLanguages":["python","javascript","bash"],"requiredOnlyExamples":false,"requestExamples":[{"dropdown":false,"language":"python","code":{"type":"pre","key":null,"ref":null,"props":{"className":"shiki shiki-themes dark-plus dark-plus","style":{"backgroundColor":"#0B0C0E","--shiki-dark-bg":"#0B0C0E","color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"language":"python","children":{"type":"code","key":null,"ref":null,"props":{"language":"python","numberOfLines":"7","children":[{"type":"span","key":"0","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":"response = client.databases.update_metadata_schema("}}}},"\n",{"type":"span","key":"2","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#CE9178","--shiki-dark":"#CE9178"},"children":" \"acme_corp\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":","}}]}},"\n",{"type":"span","key":"4","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#9CDCFE","--shiki-dark":"#9CDCFE"},"children":" add_fields"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":"=["}}]}},"\n",{"type":"span","key":"6","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":" {"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#CE9178","--shiki-dark":"#CE9178"},"children":"\"name\""}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":": "}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#CE9178","--shiki-dark":"#CE9178"},"children":"\"region\""}},{"type":"span","key":"4","ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":", "}},{"type":"span","key":"5","ref":null,"props":{"style":{"color":"#CE9178","--shiki-dark":"#CE9178"},"children":"\"data_type\""}},{"type":"span","key":"6","ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":": "}},{"type":"span","key":"7","ref":null,"props":{"style":{"color":"#CE9178","--shiki-dark":"#CE9178"},"children":"\"VARCHAR\""}},{"type":"span","key":"8","ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":"},"}}]}},"\n",{"type":"span","key":"8","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":" {"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#CE9178","--shiki-dark":"#CE9178"},"children":"\"name\""}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":": "}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#CE9178","--shiki-dark":"#CE9178"},"children":"\"priority\""}},{"type":"span","key":"4","ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":", "}},{"type":"span","key":"5","ref":null,"props":{"style":{"color":"#CE9178","--shiki-dark":"#CE9178"},"children":"\"data_type\""}},{"type":"span","key":"6","ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":": "}},{"type":"span","key":"7","ref":null,"props":{"style":{"color":"#CE9178","--shiki-dark":"#CE9178"},"children":"\"INT64\""}},{"type":"span","key":"8","ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":"},"}}]}},"\n",{"type":"span","key":"10","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":" ],"}}}},"\n",{"type":"span","key":"12","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":")"}}}},"\n"]}}}},"filename":"Python SDK"},{"dropdown":false,"language":"typescript","code":{"type":"pre","key":null,"ref":null,"props":{"className":"shiki shiki-themes dark-plus dark-plus","style":{"backgroundColor":"#0B0C0E","--shiki-dark-bg":"#0B0C0E","color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"language":"typescript","children":{"type":"code","key":null,"ref":null,"props":{"language":"typescript","numberOfLines":"7","children":[{"type":"span","key":"0","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#569CD6","--shiki-dark":"#569CD6"},"children":"const"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#4FC1FF","--shiki-dark":"#4FC1FF"},"children":" response"}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":" = "}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#C586C0","--shiki-dark":"#C586C0"},"children":"await"}},{"type":"span","key":"4","ref":null,"props":{"style":{"color":"#9CDCFE","--shiki-dark":"#9CDCFE"},"children":" client"}},{"type":"span","key":"5","ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":"."}},{"type":"span","key":"6","ref":null,"props":{"style":{"color":"#9CDCFE","--shiki-dark":"#9CDCFE"},"children":"databases"}},{"type":"span","key":"7","ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":"."}},{"type":"span","key":"8","ref":null,"props":{"style":{"color":"#DCDCAA","--shiki-dark":"#DCDCAA"},"children":"updateMetadataSchema"}},{"type":"span","key":"9","ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":"({"}}]}},"\n",{"type":"span","key":"2","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#9CDCFE","--shiki-dark":"#9CDCFE"},"children":" database:"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#CE9178","--shiki-dark":"#CE9178"},"children":" \"acme_corp\""}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":","}}]}},"\n",{"type":"span","key":"4","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#9CDCFE","--shiki-dark":"#9CDCFE"},"children":" addFields:"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":" ["}}]}},"\n",{"type":"span","key":"6","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":" { "}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#9CDCFE","--shiki-dark":"#9CDCFE"},"children":"name:"}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#CE9178","--shiki-dark":"#CE9178"},"children":" \"region\""}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":", "}},{"type":"span","key":"4","ref":null,"props":{"style":{"color":"#9CDCFE","--shiki-dark":"#9CDCFE"},"children":"dataType:"}},{"type":"span","key":"5","ref":null,"props":{"style":{"color":"#CE9178","--shiki-dark":"#CE9178"},"children":" \"VARCHAR\""}},{"type":"span","key":"6","ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":" },"}}]}},"\n",{"type":"span","key":"8","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":" { "}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#9CDCFE","--shiki-dark":"#9CDCFE"},"children":"name:"}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#CE9178","--shiki-dark":"#CE9178"},"children":" \"priority\""}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":", "}},{"type":"span","key":"4","ref":null,"props":{"style":{"color":"#9CDCFE","--shiki-dark":"#9CDCFE"},"children":"dataType:"}},{"type":"span","key":"5","ref":null,"props":{"style":{"color":"#CE9178","--shiki-dark":"#CE9178"},"children":" \"INT64\""}},{"type":"span","key":"6","ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":" },"}}]}},"\n",{"type":"span","key":"10","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":" ],"}}}},"\n",{"type":"span","key":"12","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":"});"}}}},"\n"]}}}},"filename":"TypeScript SDK"},{"dropdown":false,"language":"shellscript","code":{"type":"pre","key":null,"ref":null,"props":{"className":"shiki shiki-themes dark-plus dark-plus","style":{"backgroundColor":"#0B0C0E","--shiki-dark-bg":"#0B0C0E","color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"language":"shellscript","children":{"type":"code","key":null,"ref":null,"props":{"language":"shellscript","numberOfLines":"16","children":[{"type":"span","key":"0","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#DCDCAA","--shiki-dark":"#DCDCAA"},"children":"curl"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#569CD6","--shiki-dark":"#569CD6"},"children":" -X"}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#CE9178","--shiki-dark":"#CE9178"},"children":" PATCH"}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#CE9178","--shiki-dark":"#CE9178"},"children":" 'https://api.hydradb.com/databases/acme_corp/metadata-schema'"}},{"type":"span","key":"4","ref":null,"props":{"style":{"color":"#D7BA7D","--shiki-dark":"#D7BA7D"},"children":" \\"}}]}},"\n",{"type":"span","key":"2","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#569CD6","--shiki-dark":"#569CD6"},"children":" -H"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#CE9178","--shiki-dark":"#CE9178"},"children":" \"Authorization: Bearer "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#9CDCFE","--shiki-dark":"#9CDCFE"},"children":"$HYDRADB_API_KEY"}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#CE9178","--shiki-dark":"#CE9178"},"children":"\""}},{"type":"span","key":"4","ref":null,"props":{"style":{"color":"#D7BA7D","--shiki-dark":"#D7BA7D"},"children":" \\"}}]}},"\n",{"type":"span","key":"4","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#569CD6","--shiki-dark":"#569CD6"},"children":" -H"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#CE9178","--shiki-dark":"#CE9178"},"children":" \"API-Version: 2\""}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#D7BA7D","--shiki-dark":"#D7BA7D"},"children":" \\"}}]}},"\n",{"type":"span","key":"6","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#569CD6","--shiki-dark":"#569CD6"},"children":" -H"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#CE9178","--shiki-dark":"#CE9178"},"children":" \"Content-Type: application/json\""}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#D7BA7D","--shiki-dark":"#D7BA7D"},"children":" \\"}}]}},"\n",{"type":"span","key":"8","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#569CD6","--shiki-dark":"#569CD6"},"children":" -d"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#CE9178","--shiki-dark":"#CE9178"},"children":" '{"}}]}},"\n",{"type":"span","key":"10","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#CE9178","--shiki-dark":"#CE9178"},"children":" \"add_fields\": ["}}}},"\n",{"type":"span","key":"12","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#CE9178","--shiki-dark":"#CE9178"},"children":" {"}}}},"\n",{"type":"span","key":"14","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#CE9178","--shiki-dark":"#CE9178"},"children":" \"name\": \"region\","}}}},"\n",{"type":"span","key":"16","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#CE9178","--shiki-dark":"#CE9178"},"children":" \"data_type\": \"VARCHAR\""}}}},"\n",{"type":"span","key":"18","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#CE9178","--shiki-dark":"#CE9178"},"children":" },"}}}},"\n",{"type":"span","key":"20","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#CE9178","--shiki-dark":"#CE9178"},"children":" {"}}}},"\n",{"type":"span","key":"22","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#CE9178","--shiki-dark":"#CE9178"},"children":" \"name\": \"priority\","}}}},"\n",{"type":"span","key":"24","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#CE9178","--shiki-dark":"#CE9178"},"children":" \"data_type\": \"INT64\""}}}},"\n",{"type":"span","key":"26","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#CE9178","--shiki-dark":"#CE9178"},"children":" }"}}}},"\n",{"type":"span","key":"28","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#CE9178","--shiki-dark":"#CE9178"},"children":" ]"}}}},"\n",{"type":"span","key":"30","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#CE9178","--shiki-dark":"#CE9178"},"children":" }'"}}}},"\n"]}}}},"filename":"cURL"}],"requestExampleType":"mdx","responseExamples":[{"dropdown":false,"language":"json","code":{"type":"pre","key":null,"ref":null,"props":{"className":"shiki shiki-themes dark-plus dark-plus","style":{"backgroundColor":"#0B0C0E","--shiki-dark-bg":"#0B0C0E","color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"language":"json","children":{"type":"code","key":null,"ref":null,"props":{"language":"json","numberOfLines":"5","children":[{"type":"span","key":"0","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":"{"}}}},"\n",{"type":"span","key":"2","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#9CDCFE","--shiki-dark":"#9CDCFE"},"children":" \"database\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":": "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#CE9178","--shiki-dark":"#CE9178"},"children":"\"acme_corp\""}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":","}}]}},"\n",{"type":"span","key":"4","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#9CDCFE","--shiki-dark":"#9CDCFE"},"children":" \"tenant_id\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":": "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#CE9178","--shiki-dark":"#CE9178"},"children":"\"acme_corp\""}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":","}}]}},"\n",{"type":"span","key":"6","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#9CDCFE","--shiki-dark":"#9CDCFE"},"children":" \"added_fields\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":": ["}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#CE9178","--shiki-dark":"#CE9178"},"children":"\"region\""}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":", "}},{"type":"span","key":"4","ref":null,"props":{"style":{"color":"#CE9178","--shiki-dark":"#CE9178"},"children":"\"priority\""}},{"type":"span","key":"5","ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":"]"}}]}},"\n",{"type":"span","key":"8","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":"}"}}}},"\n"]}}}},"filename":"Success"},{"dropdown":false,"language":"json","code":{"type":"pre","key":null,"ref":null,"props":{"className":"shiki shiki-themes dark-plus dark-plus","style":{"backgroundColor":"#0B0C0E","--shiki-dark-bg":"#0B0C0E","color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"language":"json","children":{"type":"code","key":null,"ref":null,"props":{"language":"json","numberOfLines":"12","children":[{"type":"span","key":"0","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":"{"}}}},"\n",{"type":"span","key":"2","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#9CDCFE","--shiki-dark":"#9CDCFE"},"children":" \"success\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":": "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#569CD6","--shiki-dark":"#569CD6"},"children":"false"}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":","}}]}},"\n",{"type":"span","key":"4","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#9CDCFE","--shiki-dark":"#9CDCFE"},"children":" \"data\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":": "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#569CD6","--shiki-dark":"#569CD6"},"children":"null"}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":","}}]}},"\n",{"type":"span","key":"6","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#9CDCFE","--shiki-dark":"#9CDCFE"},"children":" \"error\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":": {"}}]}},"\n",{"type":"span","key":"8","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#9CDCFE","--shiki-dark":"#9CDCFE"},"children":" \"code\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":": "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#CE9178","--shiki-dark":"#CE9178"},"children":"\"INTERNAL_ERROR\""}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":","}}]}},"\n",{"type":"span","key":"10","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#9CDCFE","--shiki-dark":"#9CDCFE"},"children":" \"message\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":": "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#CE9178","--shiki-dark":"#CE9178"},"children":"\"Schema conflict: field "}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#D7BA7D","--shiki-dark":"#D7BA7D"},"children":"\\\""}},{"type":"span","key":"4","ref":null,"props":{"style":{"color":"#CE9178","--shiki-dark":"#CE9178"},"children":"region"}},{"type":"span","key":"5","ref":null,"props":{"style":{"color":"#D7BA7D","--shiki-dark":"#D7BA7D"},"children":"\\\""}},{"type":"span","key":"6","ref":null,"props":{"style":{"color":"#CE9178","--shiki-dark":"#CE9178"},"children":" already exists in the schema with a different definition. Resubmitting a field with its existing definition is accepted as a no-op, but an existing field cannot be modified. See https://docs.hydradb.com/api-reference/v2/endpoint/patch-metadata-schema for usage details. Re-send the field with its existing definition to make this a no-op, or use a different field name.\""}}]}},"\n",{"type":"span","key":"12","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":" },"}}}},"\n",{"type":"span","key":"14","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#9CDCFE","--shiki-dark":"#9CDCFE"},"children":" \"meta\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":": {"}}]}},"\n",{"type":"span","key":"16","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#9CDCFE","--shiki-dark":"#9CDCFE"},"children":" \"request_id\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":": "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#CE9178","--shiki-dark":"#CE9178"},"children":"\"9d13aef4-02f4-4e73-8c62-4c2601d04f9d\""}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":","}}]}},"\n",{"type":"span","key":"18","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#9CDCFE","--shiki-dark":"#9CDCFE"},"children":" \"latency_ms\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":": "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#B5CEA8","--shiki-dark":"#B5CEA8"},"children":"4.8"}}]}},"\n",{"type":"span","key":"20","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":" }"}}}},"\n",{"type":"span","key":"22","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#D4D4D4","--shiki-dark":"#D4D4D4"},"children":"}"}}}},"\n"]}}}},"filename":"Conflict"}],"responseExampleType":"mdx"},"dependencies":{"parameters":{"3428076f-91da-4c46-826e-d1cfd4234cce":{"description":"Database identifier","in":"path","name":"database","required":true,"schema":{"example":"acme_corp","type":"string","isRequired":true,"description":"Database identifier","uniqueKey":"","typeLabel":"string"}}},"requestBody":{"content":{"application/json":{"schema":{"properties":{"add_fields":{"description":"New metadata fields to add to the database schema. Additive only: no deletes, renames or type changes.","example":[{"data_type":"VARCHAR","enable_dense_embedding":true,"enable_match":true,"enable_sparse_embedding":false,"max_length":256,"name":"category"}],"items":{"properties":{"data_type":{"type":"string","description":"Data type of the metadata field, for example `VARCHAR`.","enum":["BOOL","INT8","INT16","INT32","INT64","FLOAT","DOUBLE","VARCHAR","JSON","ARRAY"],"x-enum-varnames":["DataTypeBool","DataTypeInt8","DataTypeInt16","DataTypeInt32","DataTypeInt64","DataTypeFloat","DataTypeDouble","DataTypeVarchar","DataTypeJSON","DataTypeArray"],"example":"VARCHAR","uniqueKey":"add_fields.items.[INDEX].data_type","typeLabel":"enum\u003cstring>"},"enable_dense_embedding":{"description":"Whether to enable semantic (dense) embedding search on this field.","example":true,"type":"boolean","uniqueKey":"add_fields.items.[INDEX].enable_dense_embedding","typeLabel":"boolean"},"enable_match":{"description":"Whether to enable exact-match filtering on this field.","example":true,"type":"boolean","uniqueKey":"add_fields.items.[INDEX].enable_match","typeLabel":"boolean"},"enable_sparse_embedding":{"description":"Whether to enable BM25 (sparse) embedding search on this field.","example":false,"type":"boolean","uniqueKey":"add_fields.items.[INDEX].enable_sparse_embedding","typeLabel":"boolean"},"max_length":{"description":"Maximum string length in bytes for VARCHAR fields.","example":256,"type":"integer","uniqueKey":"add_fields.items.[INDEX].max_length","typeLabel":"integer"},"name":{"description":"Field name. Immutable after database creation.","example":"category","type":"string","uniqueKey":"add_fields.items.[INDEX].name","typeLabel":"string"}},"title":"TenantsCustomPropertyDefinition","type":"object","uniqueKey":"add_fields.items.[INDEX]","typeLabel":"TenantsCustomPropertyDefinition · object"},"type":"array","uniqueItems":false,"uniqueKey":"add_fields","typeLabel":"TenantsCustomPropertyDefinition · object[]"}},"title":"TenantsTenantMetadataSchemaUpdateRequest","type":"object","uniqueKey":"","typeLabel":"TenantsTenantMetadataSchemaUpdateRequest · object"},"examples":{"Example":{"title":"Example","value":{"add_fields":[{"data_type":"VARCHAR","enable_dense_embedding":true,"enable_match":true,"enable_sparse_embedding":false,"max_length":256,"name":"category"}]}}},"exampleType":"generated"}},"description":"Metadata schema fields to add","required":true,"exampleType":"generated"},"responses":{"15d9e4db-b703-458f-956a-6a5e8632f757":{"content":{"application/json":{"schema":{"properties":{"added_fields":{"description":"Names of the metadata schema fields successfully added.","example":["region","summary_label"],"items":{"type":"string","uniqueKey":"added_fields.items.[INDEX]","typeLabel":"string"},"type":"array","uniqueItems":false,"isRequired":true,"uniqueKey":"added_fields","typeLabel":"string[]"},"database":{"description":"Owning database. Formerly `tenant_id`; the `tenant_id` alias is still accepted (deprecated).","example":"acme_corp","type":"string","isRequired":true,"uniqueKey":"database","typeLabel":"string"},"tenant_id":{"deprecated":true,"description":"Deprecated: use `database`.","example":"acme_corp","type":"string","x-deprecated":"true","uniqueKey":"tenant_id","typeLabel":"string"}},"required":["added_fields","database"],"title":"HandlerMetadataSchemaUpdateResponse","type":"object","uniqueKey":"","typeLabel":"HandlerMetadataSchemaUpdateResponse · object"},"examples":{"Example":{"title":"Example","value":{"added_fields":["region","summary_label"],"database":"acme_corp","tenant_id":"acme_corp"}}},"exampleType":"generated"}},"description":"OK","exampleType":"generated"},"97f41d8f-5083-456b-a971-97963a3e7f89":{"content":{"application/json":{"schema":{"properties":{"data":{"description":"Always `null` on this error response.","type":"null","uniqueKey":"data","typeLabel":"null"},"detail":{"properties":{"deprecated":{"description":"Whether this response concerns a deprecated field or route.","example":true,"type":"boolean","uniqueKey":"detail.deprecated","typeLabel":"boolean"},"deprecated_field":{"description":"The deprecated field name.","example":"tenant_id","type":"string","uniqueKey":"detail.deprecated_field","typeLabel":"string"},"deprecated_since":{"description":"API version that deprecated the conflicting selector.","example":"2.0.1","type":"string","uniqueKey":"detail.deprecated_since","typeLabel":"string"},"error_code":{"description":"Machine-readable error classification code.","example":"VALIDATION_ERROR","type":"string","uniqueKey":"detail.error_code","typeLabel":"string"},"message":{"description":"Human-readable description of the error.","example":"Request validation failed","type":"string","uniqueKey":"detail.message","typeLabel":"string"},"preferred_field":{"description":"The canonical replacement for the deprecated field.","example":"database","type":"string","uniqueKey":"detail.preferred_field","typeLabel":"string"},"retry_after_seconds":{"description":"Seconds to wait before retrying deletion of context that is still indexing.","example":1,"type":"integer","uniqueKey":"detail.retry_after_seconds","typeLabel":"integer"},"retryable":{"description":"Whether retrying this failed query can succeed. Present for search workflow failures.","example":true,"type":"boolean","uniqueKey":"detail.retryable","typeLabel":"boolean"},"success":{"deprecated":true,"description":"Deprecated: always `false`. Read the HTTP status, then `error.code` and `error.message`.","example":false,"type":"boolean","x-deprecated":"true","uniqueKey":"detail.success","typeLabel":"boolean"}},"title":"HandlerErrorDetail","type":"object","description":"Structured error detail with code, message, and deprecation hints.","example":{"deprecated":true,"deprecated_field":"tenant_id","deprecated_since":"2.0.1","error_code":"VALIDATION_ERROR","message":"Request validation failed","preferred_field":"database","retry_after_seconds":1,"retryable":true},"uniqueKey":"detail","typeLabel":"HandlerErrorDetail · object"},"error":{"properties":{"code":{"description":"Machine-readable error code (e.g. `DATABASE_NOT_FOUND`).","example":"DATABASE_NOT_FOUND","type":"string","uniqueKey":"error.code","typeLabel":"string"},"details":{"additionalProperties":{"type":"string","uniqueKey":"error.details.additionalProperties","typeLabel":"string"},"description":"Extra facts about the error, as string pairs. Omitted when there are none.","type":"object","uniqueKey":"error.details","typeLabel":"object"},"message":{"description":"Human-readable description of the error.","example":"Database not found","type":"string","uniqueKey":"error.message","typeLabel":"string"},"param":{"description":"The request field that caused the error. Omitted when no single field is at fault.","type":"string","uniqueKey":"error.param","typeLabel":"string"}},"title":"HandlerApiError","type":"object","description":"Error message, empty string on success.","example":{"code":"DATABASE_NOT_FOUND","message":"Database not found"},"uniqueKey":"error","typeLabel":"HandlerApiError · object"},"meta":{"properties":{"api_version":{"description":"Version of the API that served the request, for example `2.0.1`.","type":"string","uniqueKey":"meta.api_version","typeLabel":"string"},"latency_ms":{"description":"Server-side processing time in milliseconds.","example":12.3,"type":"number","uniqueKey":"meta.latency_ms","typeLabel":"number"},"request_id":{"description":"Unique identifier for this request, useful for support and tracing.","example":"9d13aef4-02f4-4e73-8c62-4c2601d04f9d","type":"string","uniqueKey":"meta.request_id","typeLabel":"string"}},"title":"HandlerErrorMeta","type":"object","example":{"latency_ms":12.3,"request_id":"9d13aef4-02f4-4e73-8c62-4c2601d04f9d"},"uniqueKey":"meta","typeLabel":"HandlerErrorMeta · object"},"success":{"description":"Whether the request succeeded.","example":false,"type":"boolean","uniqueKey":"success","typeLabel":"boolean"}},"title":"HandlerErrorResponse","type":"object","uniqueKey":"","typeLabel":"HandlerErrorResponse · object"},"examples":{"Example":{"title":"Example","value":{"data":null,"detail":{"deprecated":true,"deprecated_field":"tenant_id","deprecated_since":"2.0.1","error_code":"VALIDATION_ERROR","message":"Request validation failed","preferred_field":"database","retry_after_seconds":1,"retryable":true},"error":{"code":"DATABASE_NOT_FOUND","message":"Database not found"},"meta":{"latency_ms":12.3,"request_id":"9d13aef4-02f4-4e73-8c62-4c2601d04f9d"},"success":false}}},"exampleType":"generated"}},"description":"Bad Request","exampleType":"generated"},"d50d58c7-d426-4628-8e48-529d44c9a25b":{"content":{"application/json":{"schema":{"properties":{"data":{"description":"Always `null` on this error response.","type":"null","uniqueKey":"data","typeLabel":"null"},"detail":{"properties":{"deprecated":{"description":"Whether this response concerns a deprecated field or route.","example":true,"type":"boolean","uniqueKey":"detail.deprecated","typeLabel":"boolean"},"deprecated_field":{"description":"The deprecated field name.","example":"tenant_id","type":"string","uniqueKey":"detail.deprecated_field","typeLabel":"string"},"deprecated_since":{"description":"API version that deprecated the conflicting selector.","example":"2.0.1","type":"string","uniqueKey":"detail.deprecated_since","typeLabel":"string"},"error_code":{"description":"Machine-readable error classification code.","example":"VALIDATION_ERROR","type":"string","uniqueKey":"detail.error_code","typeLabel":"string"},"message":{"description":"Human-readable description of the error.","example":"Request validation failed","type":"string","uniqueKey":"detail.message","typeLabel":"string"},"preferred_field":{"description":"The canonical replacement for the deprecated field.","example":"database","type":"string","uniqueKey":"detail.preferred_field","typeLabel":"string"},"retry_after_seconds":{"description":"Seconds to wait before retrying deletion of context that is still indexing.","example":1,"type":"integer","uniqueKey":"detail.retry_after_seconds","typeLabel":"integer"},"retryable":{"description":"Whether retrying this failed query can succeed. Present for search workflow failures.","example":true,"type":"boolean","uniqueKey":"detail.retryable","typeLabel":"boolean"},"success":{"deprecated":true,"description":"Deprecated: always `false`. Read the HTTP status, then `error.code` and `error.message`.","example":false,"type":"boolean","x-deprecated":"true","uniqueKey":"detail.success","typeLabel":"boolean"}},"title":"HandlerErrorDetail","type":"object","description":"Structured error detail with code, message, and deprecation hints.","example":{"deprecated":true,"deprecated_field":"tenant_id","deprecated_since":"2.0.1","error_code":"VALIDATION_ERROR","message":"Request validation failed","preferred_field":"database","retry_after_seconds":1,"retryable":true},"uniqueKey":"detail","typeLabel":"HandlerErrorDetail · object"},"error":{"properties":{"code":{"description":"Machine-readable error code (e.g. `DATABASE_NOT_FOUND`).","example":"DATABASE_NOT_FOUND","type":"string","uniqueKey":"error.code","typeLabel":"string"},"details":{"additionalProperties":{"type":"string","uniqueKey":"error.details.additionalProperties","typeLabel":"string"},"description":"Extra facts about the error, as string pairs. Omitted when there are none.","type":"object","uniqueKey":"error.details","typeLabel":"object"},"message":{"description":"Human-readable description of the error.","example":"Database not found","type":"string","uniqueKey":"error.message","typeLabel":"string"},"param":{"description":"The request field that caused the error. Omitted when no single field is at fault.","type":"string","uniqueKey":"error.param","typeLabel":"string"}},"title":"HandlerApiError","type":"object","description":"Error message, empty string on success.","example":{"code":"DATABASE_NOT_FOUND","message":"Database not found"},"uniqueKey":"error","typeLabel":"HandlerApiError · object"},"meta":{"properties":{"api_version":{"description":"Version of the API that served the request, for example `2.0.1`.","type":"string","uniqueKey":"meta.api_version","typeLabel":"string"},"latency_ms":{"description":"Server-side processing time in milliseconds.","example":12.3,"type":"number","uniqueKey":"meta.latency_ms","typeLabel":"number"},"request_id":{"description":"Unique identifier for this request, useful for support and tracing.","example":"9d13aef4-02f4-4e73-8c62-4c2601d04f9d","type":"string","uniqueKey":"meta.request_id","typeLabel":"string"}},"title":"HandlerErrorMeta","type":"object","example":{"latency_ms":12.3,"request_id":"9d13aef4-02f4-4e73-8c62-4c2601d04f9d"},"uniqueKey":"meta","typeLabel":"HandlerErrorMeta · object"},"success":{"description":"Whether the request succeeded.","example":false,"type":"boolean","uniqueKey":"success","typeLabel":"boolean"}},"title":"HandlerErrorResponse","type":"object","uniqueKey":"","typeLabel":"HandlerErrorResponse · object"},"examples":{"Example":{"title":"Example","value":{"data":null,"detail":{"deprecated":true,"deprecated_field":"tenant_id","deprecated_since":"2.0.1","error_code":"VALIDATION_ERROR","message":"Request validation failed","preferred_field":"database","retry_after_seconds":1,"retryable":true},"error":{"code":"DATABASE_NOT_FOUND","message":"Database not found"},"meta":{"latency_ms":12.3,"request_id":"9d13aef4-02f4-4e73-8c62-4c2601d04f9d"},"success":false}}},"exampleType":"generated"}},"description":"Not Found","exampleType":"generated"},"82fef145-0fd3-4437-880a-66f1d29b352e":{"content":{"application/json":{"schema":{"properties":{"data":{"description":"Always `null` on this error response.","type":"null","uniqueKey":"data","typeLabel":"null"},"detail":{"properties":{"deprecated":{"description":"Whether this response concerns a deprecated field or route.","example":true,"type":"boolean","uniqueKey":"detail.deprecated","typeLabel":"boolean"},"deprecated_field":{"description":"The deprecated field name.","example":"tenant_id","type":"string","uniqueKey":"detail.deprecated_field","typeLabel":"string"},"deprecated_since":{"description":"API version that deprecated the conflicting selector.","example":"2.0.1","type":"string","uniqueKey":"detail.deprecated_since","typeLabel":"string"},"error_code":{"description":"Machine-readable error classification code.","example":"VALIDATION_ERROR","type":"string","uniqueKey":"detail.error_code","typeLabel":"string"},"message":{"description":"Human-readable description of the error.","example":"Request validation failed","type":"string","uniqueKey":"detail.message","typeLabel":"string"},"preferred_field":{"description":"The canonical replacement for the deprecated field.","example":"database","type":"string","uniqueKey":"detail.preferred_field","typeLabel":"string"},"retry_after_seconds":{"description":"Seconds to wait before retrying deletion of context that is still indexing.","example":1,"type":"integer","uniqueKey":"detail.retry_after_seconds","typeLabel":"integer"},"retryable":{"description":"Whether retrying this failed query can succeed. Present for search workflow failures.","example":true,"type":"boolean","uniqueKey":"detail.retryable","typeLabel":"boolean"},"success":{"deprecated":true,"description":"Deprecated: always `false`. Read the HTTP status, then `error.code` and `error.message`.","example":false,"type":"boolean","x-deprecated":"true","uniqueKey":"detail.success","typeLabel":"boolean"}},"title":"HandlerErrorDetail","type":"object","description":"Structured error detail with code, message, and deprecation hints.","example":{"deprecated":true,"deprecated_field":"tenant_id","deprecated_since":"2.0.1","error_code":"VALIDATION_ERROR","message":"Request validation failed","preferred_field":"database","retry_after_seconds":1,"retryable":true},"uniqueKey":"detail","typeLabel":"HandlerErrorDetail · object"},"error":{"properties":{"code":{"description":"Machine-readable error code (e.g. `DATABASE_NOT_FOUND`).","example":"DATABASE_NOT_FOUND","type":"string","uniqueKey":"error.code","typeLabel":"string"},"details":{"additionalProperties":{"type":"string","uniqueKey":"error.details.additionalProperties","typeLabel":"string"},"description":"Extra facts about the error, as string pairs. Omitted when there are none.","type":"object","uniqueKey":"error.details","typeLabel":"object"},"message":{"description":"Human-readable description of the error.","example":"Database not found","type":"string","uniqueKey":"error.message","typeLabel":"string"},"param":{"description":"The request field that caused the error. Omitted when no single field is at fault.","type":"string","uniqueKey":"error.param","typeLabel":"string"}},"title":"HandlerApiError","type":"object","description":"Error message, empty string on success.","example":{"code":"DATABASE_NOT_FOUND","message":"Database not found"},"uniqueKey":"error","typeLabel":"HandlerApiError · object"},"meta":{"properties":{"api_version":{"description":"Version of the API that served the request, for example `2.0.1`.","type":"string","uniqueKey":"meta.api_version","typeLabel":"string"},"latency_ms":{"description":"Server-side processing time in milliseconds.","example":12.3,"type":"number","uniqueKey":"meta.latency_ms","typeLabel":"number"},"request_id":{"description":"Unique identifier for this request, useful for support and tracing.","example":"9d13aef4-02f4-4e73-8c62-4c2601d04f9d","type":"string","uniqueKey":"meta.request_id","typeLabel":"string"}},"title":"HandlerErrorMeta","type":"object","example":{"latency_ms":12.3,"request_id":"9d13aef4-02f4-4e73-8c62-4c2601d04f9d"},"uniqueKey":"meta","typeLabel":"HandlerErrorMeta · object"},"success":{"description":"Whether the request succeeded.","example":false,"type":"boolean","uniqueKey":"success","typeLabel":"boolean"}},"title":"HandlerErrorResponse","type":"object","uniqueKey":"","typeLabel":"HandlerErrorResponse · object"},"examples":{"Example":{"title":"Example","value":{"data":null,"detail":{"deprecated":true,"deprecated_field":"tenant_id","deprecated_since":"2.0.1","error_code":"VALIDATION_ERROR","message":"Request validation failed","preferred_field":"database","retry_after_seconds":1,"retryable":true},"error":{"code":"DATABASE_NOT_FOUND","message":"Database not found"},"meta":{"latency_ms":12.3,"request_id":"9d13aef4-02f4-4e73-8c62-4c2601d04f9d"},"success":false}}},"exampleType":"generated"}},"description":"Conflict","exampleType":"generated"},"a7e90e75-3a73-4227-9a62-dc7e6f2762fe":{"content":{"application/json":{"schema":{"properties":{"data":{"description":"Always `null` on this error response.","type":"null","uniqueKey":"data","typeLabel":"null"},"detail":{"properties":{"deprecated":{"description":"Whether this response concerns a deprecated field or route.","example":true,"type":"boolean","uniqueKey":"detail.deprecated","typeLabel":"boolean"},"deprecated_field":{"description":"The deprecated field name.","example":"tenant_id","type":"string","uniqueKey":"detail.deprecated_field","typeLabel":"string"},"deprecated_since":{"description":"API version that deprecated the conflicting selector.","example":"2.0.1","type":"string","uniqueKey":"detail.deprecated_since","typeLabel":"string"},"error_code":{"description":"Machine-readable error classification code.","example":"VALIDATION_ERROR","type":"string","uniqueKey":"detail.error_code","typeLabel":"string"},"message":{"description":"Human-readable description of the error.","example":"Request validation failed","type":"string","uniqueKey":"detail.message","typeLabel":"string"},"preferred_field":{"description":"The canonical replacement for the deprecated field.","example":"database","type":"string","uniqueKey":"detail.preferred_field","typeLabel":"string"},"retry_after_seconds":{"description":"Seconds to wait before retrying deletion of context that is still indexing.","example":1,"type":"integer","uniqueKey":"detail.retry_after_seconds","typeLabel":"integer"},"retryable":{"description":"Whether retrying this failed query can succeed. Present for search workflow failures.","example":true,"type":"boolean","uniqueKey":"detail.retryable","typeLabel":"boolean"},"success":{"deprecated":true,"description":"Deprecated: always `false`. Read the HTTP status, then `error.code` and `error.message`.","example":false,"type":"boolean","x-deprecated":"true","uniqueKey":"detail.success","typeLabel":"boolean"}},"title":"HandlerErrorDetail","type":"object","description":"Structured error detail with code, message, and deprecation hints.","example":{"deprecated":true,"deprecated_field":"tenant_id","deprecated_since":"2.0.1","error_code":"VALIDATION_ERROR","message":"Request validation failed","preferred_field":"database","retry_after_seconds":1,"retryable":true},"uniqueKey":"detail","typeLabel":"HandlerErrorDetail · object"},"error":{"properties":{"code":{"description":"Machine-readable error code (e.g. `DATABASE_NOT_FOUND`).","example":"DATABASE_NOT_FOUND","type":"string","uniqueKey":"error.code","typeLabel":"string"},"details":{"additionalProperties":{"type":"string","uniqueKey":"error.details.additionalProperties","typeLabel":"string"},"description":"Extra facts about the error, as string pairs. Omitted when there are none.","type":"object","uniqueKey":"error.details","typeLabel":"object"},"message":{"description":"Human-readable description of the error.","example":"Database not found","type":"string","uniqueKey":"error.message","typeLabel":"string"},"param":{"description":"The request field that caused the error. Omitted when no single field is at fault.","type":"string","uniqueKey":"error.param","typeLabel":"string"}},"title":"HandlerApiError","type":"object","description":"Error message, empty string on success.","example":{"code":"DATABASE_NOT_FOUND","message":"Database not found"},"uniqueKey":"error","typeLabel":"HandlerApiError · object"},"meta":{"properties":{"api_version":{"description":"Version of the API that served the request, for example `2.0.1`.","type":"string","uniqueKey":"meta.api_version","typeLabel":"string"},"latency_ms":{"description":"Server-side processing time in milliseconds.","example":12.3,"type":"number","uniqueKey":"meta.latency_ms","typeLabel":"number"},"request_id":{"description":"Unique identifier for this request, useful for support and tracing.","example":"9d13aef4-02f4-4e73-8c62-4c2601d04f9d","type":"string","uniqueKey":"meta.request_id","typeLabel":"string"}},"title":"HandlerErrorMeta","type":"object","example":{"latency_ms":12.3,"request_id":"9d13aef4-02f4-4e73-8c62-4c2601d04f9d"},"uniqueKey":"meta","typeLabel":"HandlerErrorMeta · object"},"success":{"description":"Whether the request succeeded.","example":false,"type":"boolean","uniqueKey":"success","typeLabel":"boolean"}},"title":"HandlerErrorResponse","type":"object","uniqueKey":"","typeLabel":"HandlerErrorResponse · object"},"examples":{"Example":{"title":"Example","value":{"data":null,"detail":{"deprecated":true,"deprecated_field":"tenant_id","deprecated_since":"2.0.1","error_code":"VALIDATION_ERROR","message":"Request validation failed","preferred_field":"database","retry_after_seconds":1,"retryable":true},"error":{"code":"DATABASE_NOT_FOUND","message":"Database not found"},"meta":{"latency_ms":12.3,"request_id":"9d13aef4-02f4-4e73-8c62-4c2601d04f9d"},"success":false}}},"exampleType":"generated"}},"description":"Internal Server Error","exampleType":"generated"}},"security":{"db856e27-aef8-42cb-9497-e2ed529291f6":{"BearerAuth":{"bearerFormat":"API key","description":"Send your API key as Authorization: Bearer \u003cyour_api_key>.","scheme":"bearer","type":"http","scopes":[],"schemeName":"BearerAuth"}}},"servers":{"e582ccd8-d5b8-418b-9825-737cb4a46e19":{"description":"Production server","url":"https://api.hydradb.com"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"bearerFormat":"API key","description":"Send your API key as Authorization: Bearer \u003cyour_api_key>.","scheme":"bearer","type":"http","scopes":[],"schemeName":"BearerAuth"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"Send your API key as Authorization: Bearer \u003cyour_api_key>.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"BearerAuth","name":"Authorization"}],"title":"BearerAuth"}]},"originalFileLocation":"api-reference/v2/openapi.json"},"subdomain":"cortex-e852fafe","siteName":"HydraDB","title":"Update Metadata Schema - HydraDB","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{"v2":{"href":"/api-reference/v2/endpoint/update-metadata-schema","matchLevel":0},"v1":{"href":"/get-started/introduction","matchLevel":4}},"firstHrefInLanguage":{}},"lastModified":"2026-11-13T12:22:45.159Z","originalFileLocation":"api-reference/v2/endpoint/update-metadata-schema.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"dark\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Add new database metadata schema fields after database creation.\">\u003cmeta data-mint-head name=\"application-name\" content=\"HydraDB\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/cortex-e852fafe/DBxDrAuXzUjAgIlJ/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/cortex-e852fafe/DBxDrAuXzUjAgIlJ/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/cortex-e852fafe/DBxDrAuXzUjAgIlJ/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/cortex-e852fafe/DBxDrAuXzUjAgIlJ/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/cortex-e852fafe/DBxDrAuXzUjAgIlJ/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/cortex-e852fafe/DBxDrAuXzUjAgIlJ/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/cortex-e852fafe/DBxDrAuXzUjAgIlJ/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/cortex-e852fafe/DBxDrAuXzUjAgIlJ/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/cortex-e852fafe/DBxDrAuXzUjAgIlJ/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Update Metadata Schema - HydraDB\">\u003cmeta data-mint-head property=\"og:description\" content=\"Add new database metadata schema fields after database creation.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"HydraDB\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.hydradb.com/api-reference/v2/endpoint/update-metadata-schema\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://cortex-e852fafe.mintlify.site/_mintlify/api/og/v2?division=Databases\u0026amp;title=Update+Metadata+Schema\u0026amp;description=Add+new+database+metadata+schema+fields+after+database+creation.\u0026amp;theme=9098e130351f6ce0100471f1\u0026amp;signature=91e9b7db1d95f129e69b06d46f353ecf3430bb842564eec655d0abf18e95a39e\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Update Metadata Schema - HydraDB\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Add new database metadata schema fields after database creation.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://cortex-e852fafe.mintlify.site/_mintlify/api/og/v2?division=Databases\u0026amp;title=Update+Metadata+Schema\u0026amp;description=Add+new+database+metadata+schema+fields+after+database+creation.\u0026amp;theme=9098e130351f6ce0100471f1\u0026amp;signature=91e9b7db1d95f129e69b06d46f353ecf3430bb842564eec655d0abf18e95a39e\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/cortex-e852fafe/DBxDrAuXzUjAgIlJ/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"HydraDB\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#FF571A\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.hydradb.com/api-reference/v2/endpoint/update-metadata-schema\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/v2/endpoint/update-metadata-schema.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.hydradb.com/#organization\",\"name\":\"HydraDB\",\"url\":\"https://docs.hydradb.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/cortex-e852fafe/BS0KyNLwX-6ZV20u/logo/logo.png?fit=max\u0026auto=format\u0026n=BS0KyNLwX-6ZV20u\u0026q=85\u0026s=8344dc832de70bde023451b8be681c27\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.hydradb.com#website\",\"name\":\"HydraDB\",\"url\":\"https://docs.hydradb.com\",\"publisher\":{\"@id\":\"https://docs.hydradb.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.hydradb.com/api-reference/v2/endpoint/update-metadata-schema#webpage\",\"url\":\"https://docs.hydradb.com/api-reference/v2/endpoint/update-metadata-schema\",\"name\":\"Update Metadata Schema\",\"description\":\"Add new database metadata schema fields after database creation.\",\"dateModified\":\"2026-11-13T12:22:45.159Z\",\"isPartOf\":{\"@id\":\"https://docs.hydradb.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.hydradb.com/api-reference/v2/endpoint/update-metadata-schema#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.hydradb.com/api-reference/v2/endpoint/update-metadata-schema#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Databases\",\"item\":\"https://docs.hydradb.com/api-reference/v2/endpoint/databases-overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Update Metadata Schema\",\"item\":\"https://docs.hydradb.com/api-reference/v2/endpoint/update-metadata-schema\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.hydradb.com/api-reference/v2/endpoint/update-metadata-schema#apireference\",\"headline\":\"Update Metadata Schema\",\"name\":\"Update Metadata Schema\",\"description\":\"Add new database metadata schema fields after database creation.\",\"url\":\"https://docs.hydradb.com/api-reference/v2/endpoint/update-metadata-schema\",\"mainEntityOfPage\":{\"@id\":\"https://docs.hydradb.com/api-reference/v2/endpoint/update-metadata-schema#webpage\"},\"dateModified\":\"2026-11-13T12:22:45.159Z\",\"publisher\":{\"@id\":\"https://docs.hydradb.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.hydradb.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"HydraDB\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"HydraDB\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/v2/endpoint/update-metadata-schema.md","siteName":"HydraDB","nav":{"global":null,"versions":[{"version":"v2","tabs":[{"tab":"Guides","pages":[{"title":"Guides","href":"/get-started/v2/introduction"}]},{"tab":"API Reference","groups":[{"group":"Overview","public":true,"pages":[{"title":"API Reference","href":"/api-reference/v2"},{"title":"SDKs: Python and TypeScript","href":"/api-reference/v2/sdks"},{"title":"Error Responses","href":"/api-reference/v2/error-responses"}]},{"group":"Databases","public":true,"pages":[{"title":"Databases: Overview","href":"/api-reference/v2/endpoint/databases-overview"},{"title":"Create Database","openapi":"api-reference/v2/openapi.json POST /databases","href":"/api-reference/v2/endpoint/create-database"},{"title":"Database Status","openapi":"api-reference/v2/openapi.json GET /databases/status","href":"/api-reference/v2/endpoint/database-status"},{"title":"List Databases","openapi":"api-reference/v2/openapi.json GET /databases","href":"/api-reference/v2/endpoint/list-databases"},{"title":"Database Stats","openapi":"api-reference/v2/openapi.json GET /databases/stats","href":"/api-reference/v2/endpoint/database-stats"},{"title":"Get Metadata Schema","description":"Read the metadata fields declared for a database.","openapi":"api-reference/v2/openapi.json GET /databases/{database}/metadata-schema","href":"/api-reference/v2/endpoint/get-metadata-schema"},{"title":"Update Metadata Schema","openapi":"api-reference/v2/openapi.json PATCH /databases/{database}/metadata-schema","href":"/api-reference/v2/endpoint/update-metadata-schema"},{"title":"List Collections","description":"List collection IDs inside a database.","openapi":"api-reference/v2/openapi.json GET /databases/collections","href":"/api-reference/v2/endpoint/list-collections"},{"title":"Delete Collection","openapi":"api-reference/v2/openapi.json DELETE /databases/collections","href":"/api-reference/v2/endpoint/delete-collection"},{"title":"Delete Database","openapi":"api-reference/v2/openapi.json DELETE /databases","href":"/api-reference/v2/endpoint/delete-database"}]},{"group":"Context","public":true,"pages":[{"title":"Context: Overview","href":"/api-reference/v2/endpoint/context-overview"},{"title":"Ingest Context","openapi":"api-reference/v2/openapi.json POST /context/ingest","href":"/api-reference/v2/endpoint/ingest-context"},{"title":"Ingestion Status","openapi":"api-reference/v2/openapi.json GET /context/status","href":"/api-reference/v2/endpoint/source-status"},{"title":"List Context","openapi":"api-reference/v2/openapi.json POST /context/list","href":"/api-reference/v2/endpoint/list-context"},{"title":"Inspect Context","openapi":"api-reference/v2/openapi.json GET /context/inspect","href":"/api-reference/v2/endpoint/fetch-content"},{"title":"Update Source Metadata","openapi":"api-reference/v2/openapi.json PATCH /context/{id}/metadata","href":"/api-reference/v2/endpoint/update-source-metadata"},{"title":"Inspecting Context Relations","openapi":"api-reference/v2/openapi.json GET /context/relations","href":"/api-reference/v2/endpoint/source-relations"},{"title":"Connected Subgraph","openapi":"api-reference/v2/openapi.json GET /context/{id}/subgraph","href":"/api-reference/v2/endpoint/subgraph"},{"title":"Delete Context","openapi":"api-reference/v2/openapi.json DELETE /context","href":"/api-reference/v2/endpoint/delete-source"}]},{"group":"Query","public":true,"pages":[{"title":"Query: Overview","href":"/api-reference/v2/endpoint/query-overview"},{"title":"Query","openapi":"api-reference/v2/openapi.json POST /query","href":"/api-reference/v2/endpoint/query"},{"title":"Submit Feedback","openapi":"api-reference/v2/openapi.json POST /feedback","href":"/api-reference/v2/endpoint/submit-feedback"}]},{"group":"Connectors","public":true,"pages":[{"title":"Connectors: Overview","href":"/api-reference/v2/endpoint/connectors-overview"},{"title":"List Connector Providers","openapi":"api-reference/v2/openapi.json GET /connectors/providers","href":"/api-reference/v2/endpoint/list-connector-providers"},{"title":"Create Connector","openapi":"api-reference/v2/openapi.json POST /connectors","href":"/api-reference/v2/endpoint/create-connector"},{"title":"Discover Resources","openapi":"api-reference/v2/openapi.json GET /connectors/{id}/discover","href":"/api-reference/v2/endpoint/discover-connector-resources"},{"title":"Configure Connector","openapi":"api-reference/v2/openapi.json POST /connectors/{id}/configure","href":"/api-reference/v2/endpoint/configure-connector"},{"title":"Get Connector Status","openapi":"api-reference/v2/openapi.json GET /connectors/{id}/status","href":"/api-reference/v2/endpoint/get-connector-status"},{"title":"List Connectors","openapi":"api-reference/v2/openapi.json GET /connectors","href":"/api-reference/v2/endpoint/list-connectors"},{"title":"Update Connector","openapi":"api-reference/v2/openapi.json PATCH /connectors/{id}","href":"/api-reference/v2/endpoint/update-connector"},{"title":"Update Connector Resource","openapi":"api-reference/v2/openapi.json PATCH /connectors/{id}/resources/{resource_id}","href":"/api-reference/v2/endpoint/update-connector-resource"}]},{"group":"Webhooks","public":true,"pages":[{"title":"Webhooks: Overview","href":"/api-reference/v2/endpoint/webhooks-overview"},{"title":"Register Webhook","openapi":"api-reference/v2/openapi.json POST /webhooks/indexing","href":"/api-reference/v2/endpoint/register-webhook"},{"title":"Get Webhook","openapi":"api-reference/v2/openapi.json GET /webhooks/indexing","href":"/api-reference/v2/endpoint/get-webhook"},{"title":"Delete Webhook","openapi":"api-reference/v2/openapi.json DELETE /webhooks/indexing","href":"/api-reference/v2/endpoint/delete-webhook"},{"title":"Send Test Delivery","openapi":"api-reference/v2/openapi.json POST /webhooks/indexing/test","href":"/api-reference/v2/endpoint/test-webhook"},{"title":"List Deliveries","openapi":"api-reference/v2/openapi.json GET /webhooks/indexing/deliveries","href":"/api-reference/v2/endpoint/list-webhook-deliveries"},{"title":"Get Delivery","openapi":"api-reference/v2/openapi.json GET /webhooks/indexing/deliveries/{delivery_id}","href":"/api-reference/v2/endpoint/get-webhook-delivery"},{"title":"Retry Delivery","openapi":"api-reference/v2/openapi.json POST /webhooks/indexing/deliveries/{delivery_id}/retry","href":"/api-reference/v2/endpoint/retry-webhook-delivery"},{"title":"Set Signing Secret","openapi":"api-reference/v2/openapi.json POST /webhooks/indexing/signing-secret","href":"/api-reference/v2/endpoint/set-webhook-signing-secret"},{"title":"Disable Signing","openapi":"api-reference/v2/openapi.json DELETE /webhooks/indexing/signing-secret","href":"/api-reference/v2/endpoint/disable-webhook-signing"}]}]},{"tab":"Cookbooks","pages":[{"title":"Cookbooks","href":"/cookbooks/v2"}]}]},{"version":"v1","pages":[{"title":"v1","href":"/get-started/introduction"}]}]},"basePath":"","title":"Update Metadata Schema - HydraDB","deploymentId":"dpl_6UE2cqB47X6P7P3F2hD3UphW6ijc","buildId":"dpl_6UE2cqB47X6P7P3F2hD3UphW6ijc","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-BMn8tSe3.js","snippetPresets-Dl5ZrD9W.js","utils-CddEzDcs.js","style-to-object-BY3JEAdk.js","utils-Dym31Pnf.js","v4-DIgz8zy6.js","addTypeLabelsToSchema-ZiqR8hPK.js","conditional-requirements-CFM0id0Q.js","cloneDeep-D3fPbylz.js","_Uint8Array-BcNtDki0.js","isObject-FP1Yky1u.js","ApiExamples-4Sf3CFhl.js","usePlaygroundInputsStore-Ck91l6q0.js","shallow-DapBSR9G.js","isEqual-Clu_sGzx.js","CodeSnippets-DAVHdSX2.js","CodeSnippet-Be6AcO_D.js","use-playground-group-access-CteWws2O.js","Page-_aL_PM_2.js","api-description-markdown-BPoPkVJQ.js","DynamicMarkdown-QJ7LkRm3.js","SectionHeading-DyxPTJti.js","MethodPill-CGjK-dNY.js","getPastedJson-C4YIGTOJ.js","Check2Icon-B7COpIZE.js","axios-CsQoIw0U.js","Markdown-Bquzb4Gw.js","AssistantPageLink-wSgGy_i5.js","dist-Bg48sGSz.js","lib-DMeTj1gb.js","lib-B8HbPgcC.js","katex-Dbtb6Wk7.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js"]}