Monthly quota exceeded (includes quota and current_usage)
Workspace has used its monthly query quota
500
Failed to process query
Server error (see details in response)
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"SundayPyjamas AI Suite","colors":{"primary":"#52525B","light":"#A1A1AA","dark":"#27272A"},"logo":{"light":"https://mintcdn.com/sundaypyjamas/mPtTCdYgcCjb2V3-/logo/dark.svg?fit=max\u0026auto=format\u0026n=mPtTCdYgcCjb2V3-\u0026q=85\u0026s=e5e3e1e59634cc40750fcd055681aa89","dark":"https://mintcdn.com/sundaypyjamas/mPtTCdYgcCjb2V3-/logo/light.svg?fit=max\u0026auto=format\u0026n=mPtTCdYgcCjb2V3-\u0026q=85\u0026s=b9d1555ea0161f6a3430f051ece1ad65","href":"https://suite.sundaypyjamas.com"},"favicon":"https://mintcdn.com/sundaypyjamas/cBD4NursMvkHwenF/favicon.ico?fit=max\u0026auto=format\u0026n=cBD4NursMvkHwenF\u0026q=85\u0026s=5434345933ef2101b5a73c0c78e619f4","background":{"decoration":"gradient"},"navbar":{"links":[],"primary":{"type":"button","label":"Get API Key","href":"https://suite.sundaypyjamas.com"}},"footer":{"socials":{"github":"https://github.com/sundaypyjamas"}},"fonts":{"heading":{"family":"Inter"},"body":{"family":"Inter"}},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"API Platform","icon":"gauge-high","href":"https://suite.sundaypyjamas.com"},{"anchor":"GitHub","icon":"github","href":"https://github.com/sundaypyjamas"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"sundaypyjamas","hasAudioNarration":false,"actualSubdomain":"sundaypyjamas","customDomains":["docs.sundaypyjamas.com"],"gitSource":{"type":"github","owner":"sundaypyjamas","repo":"ai-suite-platform-docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"entitlements":{},"buildId":"6ae92b3fc650774b1d01b165:success","clientVersion":"0.0.4271","searchFilterCounts":[{"language":"default","tag":"API Reference","count":31},{"language":"default","tag":"User Guide","count":26},{"language":"default","tag":"Documentation","count":11},{"language":"default","tag":"Work with Agents","count":6},{"language":"default","tag":"Manage \u0026 Get Help","count":6},{"language":"default","tag":"Agents","count":5},{"language":"default","tag":"More Ways to Work","count":5},{"language":"default","tag":"Useful Skills","count":5},{"language":"default","tag":"Apps","count":4},{"language":"default","tag":"Storage","count":4}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"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":"workos-onboarding","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":"assistant-v5","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":"workos-sso-scim","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":"workos-signup","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":"workos-enabled","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":"sso-setup-deadline-banner","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}],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":"#navbar{z-index:30}.dark #navbar,.dark #navbar-transition{background-color:#0a0a0a!important;opacity:1!important}html:not(.dark) #navbar,html:not(.dark) #navbar-transition{background-color:#ffffff!important;opacity:1!important}#sidebar-content .pointer-events-none.sticky{display:none!important}#navigation-items{padding-top:0.5rem}"}]}
{"page":{"pagePath":"api-reference/rag/query","slug":"/api-reference/rag/query","pageMetadata":{"title":"POST /rag/query","api":"POST https://suite.sundaypyjamas.com/api/v1/rag/query","description":"Ask a natural-language question grounded in your uploaded documents","href":"/api-reference/rag/query"},"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: \"Ask a natural-language question grounded in your uploaded documents\"\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];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{Expandable,Heading,ParamField,ResponseField,Table}=_components;if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`2`,id:`authentication`,children:`Authentication`}),`\n`,_jsx(ParamField,{header:`Authorization`,type:`string`,required:true,id:`param-authorization`,children:_jsxs(_components.p,{children:[`Bearer token from an authenticated Supabase session. See the `,_jsx(_components.a,{href:`/api-reference/rag/introduction#base-url`,children:`note on RAG auth`}),`.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`request-body`,children:`Request Body`}),`\n`,_jsx(ParamField,{body:`query`,type:`string`,required:true,id:`param-query`,children:_jsx(_components.p,{children:`The question to answer.`})}),`\n`,_jsx(ParamField,{body:`workspace_id`,type:`string`,required:true,id:`param-workspace-id`,children:_jsx(_components.p,{children:`UUID of the workspace whose documents to search.`})}),`\n`,_jsx(ParamField,{body:`options`,type:`object`,id:`param-options`,children:_jsxs(Expandable,{title:`options`,children:[_jsx(ParamField,{body:`max_sources`,type:`number`,default:`5`,id:`param-max-sources`,children:_jsx(_components.p,{children:`Maximum number of source chunks to retrieve.`})}),_jsx(ParamField,{body:`confidence_threshold`,type:`number`,default:`0.7`,id:`param-confidence-threshold`,children:_jsx(_components.p,{children:`Minimum relevance score (0–1) for a chunk to be included as a source.`})}),_jsx(ParamField,{body:`include_metadata`,type:`boolean`,default:`true`,id:`param-include-metadata`,children:_jsx(_components.p,{children:`Whether to include source metadata in the response.`})}),_jsx(ParamField,{body:`session_id`,type:`string`,id:`param-session-id`,children:_jsx(_components.p,{children:`Optional identifier to associate this query with a conversation for context continuity.`})})]})}),`\n`,_jsx(Heading,{level:`2`,id:`response`,children:`Response`}),`\n`,_jsx(ResponseField,{name:`status`,type:`string`,id:`param-status`,children:_jsx(_components.code,{children:`\"success\"`})}),`\n`,_jsx(ResponseField,{name:`result`,type:`object`,id:`param-result`,children:_jsxs(Expandable,{title:`result`,children:[_jsx(ResponseField,{name:`answer`,type:`string`,id:`param-answer`,children:`Generated answer`}),_jsx(ResponseField,{name:`confidence`,type:`number`,id:`param-confidence`,children:`0–1 confidence score for the answer`}),_jsx(ResponseField,{name:`sources`,type:`object[]`,id:`param-sources`,children:_jsxs(Expandable,{title:`source`,children:[_jsx(ResponseField,{name:`content`,type:`string`,id:`param-content`,children:`Relevant text excerpt`}),_jsx(ResponseField,{name:`document`,type:`string`,id:`param-document`,children:`Source document name`}),_jsx(ResponseField,{name:`page`,type:`number`,id:`param-page`}),_jsx(ResponseField,{name:`confidence`,type:`number`,id:`param-confidence-1`}),_jsx(ResponseField,{name:`relevance_score`,type:`number`,id:`param-relevance-score`})]})})]})}),`\n`,_jsx(ResponseField,{name:`usage`,type:`object`,id:`param-usage`,children:`Token/quota usage for this query`}),`\n`,_jsx(ResponseField,{name:`performance`,type:`object`,id:`param-performance`,children:`Timing/processing metrics`}),`\n`,_jsx(ResponseField,{name:`workspace_id`,type:`string`,id:`param-workspace-id-1`}),`\n`,_jsx(ResponseField,{name:`timestamp`,type:`string`,id:`param-timestamp`,children:`ISO 8601`}),`\n`,`\n`,`\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:`Error`}),_jsx(_components.th,{children:`Cause`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`Query is required and must be a string`})}),_jsxs(_components.td,{children:[`Missing/invalid `,_jsx(_components.code,{children:`query`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`workspace_id is required`})}),_jsxs(_components.td,{children:[`Missing `,_jsx(_components.code,{children:`workspace_id`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`401`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`Authentication required`})}),_jsx(_components.td,{children:`Missing/invalid session`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`403`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`Access denied to workspace`})}),_jsx(_components.td,{children:`Caller isn’t a member of the workspace`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`403`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`RAG service not enabled for this workspace`})}),_jsxs(_components.td,{children:[`RAG hasn’t been enabled/provisioned yet — `,_jsx(_components.a,{href:`/api-reference/rag/upload`,children:`upload a document`}),` first`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`429`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`Monthly quota exceeded`}),` (includes `,_jsx(_components.code,{children:`quota`}),` and `,_jsx(_components.code,{children:`current_usage`}),`)`]}),_jsx(_components.td,{children:`Workspace has used its monthly query quota`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`500`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`Failed to process query`})}),_jsxs(_components.td,{children:[`Server error (see `,_jsx(_components.code,{children:`details`}),` in response)`]})]})]})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{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":{"config":{},"pageMetadata":{"title":"POST /rag/query","api":"POST https://suite.sundaypyjamas.com/api/v1/rag/query","description":"Ask a natural-language question grounded in your uploaded documents","href":"/api-reference/rag/query"}}},"mdxSourceWithNoJs":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,Expandable,Heading,ParamField,RequestExample,ResponseExample,ResponseField,Table}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!RequestExample)_missingMdxReference(`RequestExample`,true);if(!ResponseExample)_missingMdxReference(`ResponseExample`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`2`,id:`authentication`,children:`Authentication`}),`\n`,_jsx(ParamField,{header:`Authorization`,type:`string`,required:true,id:`param-authorization`,children:_jsxs(_components.p,{children:[`Bearer token from an authenticated Supabase session. See the `,_jsx(_components.a,{href:`/api-reference/rag/introduction#base-url`,children:`note on RAG auth`}),`.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`request-body`,children:`Request Body`}),`\n`,_jsx(ParamField,{body:`query`,type:`string`,required:true,id:`param-query`,children:_jsx(_components.p,{children:`The question to answer.`})}),`\n`,_jsx(ParamField,{body:`workspace_id`,type:`string`,required:true,id:`param-workspace-id`,children:_jsx(_components.p,{children:`UUID of the workspace whose documents to search.`})}),`\n`,_jsx(ParamField,{body:`options`,type:`object`,id:`param-options`,children:_jsxs(Expandable,{title:`options`,children:[_jsx(ParamField,{body:`max_sources`,type:`number`,default:`5`,id:`param-max-sources`,children:_jsx(_components.p,{children:`Maximum number of source chunks to retrieve.`})}),_jsx(ParamField,{body:`confidence_threshold`,type:`number`,default:`0.7`,id:`param-confidence-threshold`,children:_jsx(_components.p,{children:`Minimum relevance score (0–1) for a chunk to be included as a source.`})}),_jsx(ParamField,{body:`include_metadata`,type:`boolean`,default:`true`,id:`param-include-metadata`,children:_jsx(_components.p,{children:`Whether to include source metadata in the response.`})}),_jsx(ParamField,{body:`session_id`,type:`string`,id:`param-session-id`,children:_jsx(_components.p,{children:`Optional identifier to associate this query with a conversation for context continuity.`})})]})}),`\n`,_jsx(Heading,{level:`2`,id:`response`,children:`Response`}),`\n`,_jsx(ResponseField,{name:`status`,type:`string`,id:`param-status`,children:_jsx(_components.code,{children:`\"success\"`})}),`\n`,_jsx(ResponseField,{name:`result`,type:`object`,id:`param-result`,children:_jsxs(Expandable,{title:`result`,children:[_jsx(ResponseField,{name:`answer`,type:`string`,id:`param-answer`,children:`Generated answer`}),_jsx(ResponseField,{name:`confidence`,type:`number`,id:`param-confidence`,children:`0–1 confidence score for the answer`}),_jsx(ResponseField,{name:`sources`,type:`object[]`,id:`param-sources`,children:_jsxs(Expandable,{title:`source`,children:[_jsx(ResponseField,{name:`content`,type:`string`,id:`param-content`,children:`Relevant text excerpt`}),_jsx(ResponseField,{name:`document`,type:`string`,id:`param-document`,children:`Source document name`}),_jsx(ResponseField,{name:`page`,type:`number`,id:`param-page`}),_jsx(ResponseField,{name:`confidence`,type:`number`,id:`param-confidence-1`}),_jsx(ResponseField,{name:`relevance_score`,type:`number`,id:`param-relevance-score`})]})})]})}),`\n`,_jsx(ResponseField,{name:`usage`,type:`object`,id:`param-usage`,children:`Token/quota usage for this query`}),`\n`,_jsx(ResponseField,{name:`performance`,type:`object`,id:`param-performance`,children:`Timing/processing metrics`}),`\n`,_jsx(ResponseField,{name:`workspace_id`,type:`string`,id:`param-workspace-id-1`}),`\n`,_jsx(ResponseField,{name:`timestamp`,type:`string`,id:`param-timestamp`,children:`ISO 8601`}),`\n`,_jsx(RequestExample,{children:_jsx(CodeBlock,{filename:`cURL`,numberOfLines:`8`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`8`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://suite.sundaypyjamas.com/api/v1/rag/query`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer \u003csupabase_access_token>\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"query\": \"What were the top risks identified in the Q2 report?\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"workspace_id\": \"9d4c1a2e-...\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"options\": { \"max_sources\": 3 }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})})}),`\n`,_jsx(ResponseExample,{children:_jsx(CodeBlock,{filename:`Response`,numberOfLines:`20`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`20`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"success\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"result\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"answer\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"The Q2 report identifies three key risks: supply chain delays, rising customer acquisition costs, and increased competitive pressure in the EU market.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"confidence\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0.86`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"sources\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"content\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Supply chain delays increased average fulfillment time by 4 days...\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"document\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"report.pdf\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"page\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`12`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"confidence\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0.91`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"relevance_score\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0.88`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"usage\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"performance\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"workspace_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"9d4c1a2e-...\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"timestamp\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2026-07-08T10:05:00Z\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})})}),`\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:`Error`}),_jsx(_components.th,{children:`Cause`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`Query is required and must be a string`})}),_jsxs(_components.td,{children:[`Missing/invalid `,_jsx(_components.code,{children:`query`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`workspace_id is required`})}),_jsxs(_components.td,{children:[`Missing `,_jsx(_components.code,{children:`workspace_id`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`401`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`Authentication required`})}),_jsx(_components.td,{children:`Missing/invalid session`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`403`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`Access denied to workspace`})}),_jsx(_components.td,{children:`Caller isn’t a member of the workspace`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`403`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`RAG service not enabled for this workspace`})}),_jsxs(_components.td,{children:[`RAG hasn’t been enabled/provisioned yet — `,_jsx(_components.a,{href:`/api-reference/rag/upload`,children:`upload a document`}),` first`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`429`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`Monthly quota exceeded`}),` (includes `,_jsx(_components.code,{children:`quota`}),` and `,_jsx(_components.code,{children:`current_usage`}),`)`]}),_jsx(_components.td,{children:`Workspace has used its monthly query quota`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`500`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`Failed to process query`})}),_jsxs(_components.td,{children:[`Server error (see `,_jsx(_components.code,{children:`details`}),` in response)`]})]})]})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{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":{"config":{},"pageMetadata":{"title":"POST /rag/query","api":"POST https://suite.sundaypyjamas.com/api/v1/rag/query","description":"Ask a natural-language question grounded in your uploaded documents","href":"/api-reference/rag/query"}}}},"mdxExtracts":{"tableOfContents":[{"title":"Authentication","slug":"authentication","depth":2,"children":[]},{"title":"Request Body","slug":"request-body","depth":2,"children":[]},{"title":"Response","slug":"response","depth":2,"children":[]},{"title":"Errors","slug":"errors","depth":2,"children":[]}],"codeExamples":{"request":{"type":"RequestExample","children":[{"filename":"cURL","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"shellscript\">\u003ccode language=\"shellscript\" numberOfLines=\"8\">\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#DCDCAA\">curl\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -X\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> POST\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> https://suite.sundaypyjamas.com/api/v1/rag/query\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -H\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"Authorization: Bearer \u0026#x3C;supabase_access_token>\"\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -H\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"Content-Type: application/json\"\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -d\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> '{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"query\": \"What were the top risks identified in the Q2 report?\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"workspace_id\": \"9d4c1a2e-...\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"options\": { \"max_sources\": 3 }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> }'\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]},"response":{"type":"ResponseExample","children":[{"filename":"Response","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"20\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"status\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"success\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"result\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"answer\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"The Q2 report identifies three key risks: supply chain delays, rising customer acquisition costs, and increased competitive pressure in the EU market.\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"confidence\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">0.86\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"sources\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: [\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"content\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"Supply chain delays increased average fulfillment time by 4 days...\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"document\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"report.pdf\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"page\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">12\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"confidence\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">0.91\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"relevance_score\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">0.88\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> ]\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"usage\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: {},\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"performance\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: {},\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"workspace_id\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"9d4c1a2e-...\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"timestamp\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"2026-07-08T10:05:00Z\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]}},"endpoint":{"title":"POST /rag/query","path":"/api/v1/rag/query","servers":[{"url":"https://suite.sundaypyjamas.com"}],"method":"post","request":{"security":[],"parameters":{"query":{},"header":{"Authorization":{"schema":[{"type":"string","description":"Bearer token from an authenticated Supabase session. See the note on RAG auth .","required":true}]}},"cookie":{},"path":{}},"body":{"application/json":{"schemaArray":[{"type":"object","properties":{"query":[{"type":"string","description":"The question to answer.","required":true}],"workspace_id":[{"type":"string","description":"UUID of the workspace whose documents to search.","required":true}],"options":[{"type":"object","properties":{"max_sources":[{"type":"number","description":"Maximum number of source chunks to retrieve."}],"confidence_threshold":[{"type":"number","description":"Minimum relevance score (0–1) for a chunk to be included as a source."}],"include_metadata":[{"type":"boolean","description":"Whether to include source metadata in the response."}],"session_id":[{"type":"string","description":"Optional identifier to associate this query with a conversation for context continuity."}]}}]}}],"examples":{"example":{"value":{"query":"\u003cstring>","workspace_id":"\u003cstring>","options":{"max_sources":123,"confidence_threshold":123,"include_metadata":true,"session_id":"\u003cstring>"}}}}}}},"response":{"200":{"application/json":{"schemaArray":[{"type":"object","properties":{"status":[{"type":"string","description":"`\"success\"`"}],"result":[{"type":"object","properties":{"answer":[{"type":"string","description":"Generated answer"}],"confidence":[{"type":"number","description":"0–1 confidence score for the answer"}],"sources":[{"type":"array","items":[{"type":"object","properties":{"content":[{"type":"string","description":"Relevant text excerpt"}],"document":[{"type":"string","description":"Source document name"}],"page":[{"type":"number"}],"confidence":[{"type":"number"}],"relevance_score":[{"type":"number"}]}}]}]}}],"usage":[{"type":"object","properties":{},"description":"Token/quota usage for this query"}],"performance":[{"type":"object","properties":{},"description":"Timing/processing metrics"}],"workspace_id":[{"type":"string"}],"timestamp":[{"type":"string","description":"ISO 8601"}]}}],"examples":{"example":{"value":{"status":"\u003cstring>","result":{"answer":"\u003cstring>","confidence":123,"sources":[{"content":"\u003cstring>","document":"\u003cstring>","page":123,"confidence":123,"relevance_score":123}]},"usage":{},"performance":{},"workspace_id":"\u003cstring>","timestamp":"\u003cstring>"}}}}}},"deprecated":false}},"jsLinks":[],"subdomain":"sundaypyjamas","siteName":"SundayPyjamas AI Suite","title":"POST /rag/query - SundayPyjamas AI Suite","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-07-09T19:52:30.006Z","originalFileLocation":"api-reference/rag/query.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=\"system\"}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=\"Ask a natural-language question grounded in your uploaded documents\">\u003cmeta data-mint-head name=\"application-name\" content=\"SundayPyjamas AI Suite\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/sundaypyjamas/wQgQ3BV84t2A39dR/_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/sundaypyjamas/wQgQ3BV84t2A39dR/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/sundaypyjamas/wQgQ3BV84t2A39dR/_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/sundaypyjamas/wQgQ3BV84t2A39dR/_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/sundaypyjamas/wQgQ3BV84t2A39dR/_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/sundaypyjamas/wQgQ3BV84t2A39dR/_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/sundaypyjamas/wQgQ3BV84t2A39dR/_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/sundaypyjamas/wQgQ3BV84t2A39dR/_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/sundaypyjamas/wQgQ3BV84t2A39dR/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"POST /rag/query - SundayPyjamas AI Suite\">\u003cmeta data-mint-head property=\"og:description\" content=\"Ask a natural-language question grounded in your uploaded documents\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"SundayPyjamas AI Suite\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.sundaypyjamas.com/api-reference/rag/query\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://sundaypyjamas.mintlify.site/_mintlify/api/og/v2?division=RAG\u0026amp;title=POST+%2Frag%2Fquery\u0026amp;description=Ask+a+natural-language+question+grounded+in+your+uploaded+documents\u0026amp;theme=fa3b1ef4a5a7bb21408bdce7\u0026amp;signature=4b0a7eef40fc62a653ff583515a87d1eb58ebd59975ac9df57497a442e41941a\">\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=\"POST /rag/query - SundayPyjamas AI Suite\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Ask a natural-language question grounded in your uploaded documents\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://sundaypyjamas.mintlify.site/_mintlify/api/og/v2?division=RAG\u0026amp;title=POST+%2Frag%2Fquery\u0026amp;description=Ask+a+natural-language+question+grounded+in+your+uploaded+documents\u0026amp;theme=fa3b1ef4a5a7bb21408bdce7\u0026amp;signature=4b0a7eef40fc62a653ff583515a87d1eb58ebd59975ac9df57497a442e41941a\">\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/sundaypyjamas/wQgQ3BV84t2A39dR/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"SundayPyjamas AI Suite\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#52525B\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.sundaypyjamas.com/api-reference/rag/query\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/rag/query.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.sundaypyjamas.com/#organization\",\"name\":\"SundayPyjamas AI Suite\",\"url\":\"https://docs.sundaypyjamas.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/sundaypyjamas/mPtTCdYgcCjb2V3-/logo/dark.svg?fit=max\u0026auto=format\u0026n=mPtTCdYgcCjb2V3-\u0026q=85\u0026s=e5e3e1e59634cc40750fcd055681aa89\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.sundaypyjamas.com#website\",\"name\":\"SundayPyjamas AI Suite\",\"url\":\"https://docs.sundaypyjamas.com\",\"publisher\":{\"@id\":\"https://docs.sundaypyjamas.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.sundaypyjamas.com/api-reference/rag/query#webpage\",\"url\":\"https://docs.sundaypyjamas.com/api-reference/rag/query\",\"name\":\"POST /rag/query\",\"description\":\"Ask a natural-language question grounded in your uploaded documents\",\"dateModified\":\"2026-07-09T19:52:30.006Z\",\"isPartOf\":{\"@id\":\"https://docs.sundaypyjamas.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.sundaypyjamas.com/api-reference/rag/query#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.sundaypyjamas.com/api-reference/rag/query#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"RAG\",\"item\":\"https://docs.sundaypyjamas.com/api-reference/rag/introduction\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"POST /rag/query\",\"item\":\"https://docs.sundaypyjamas.com/api-reference/rag/query\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.sundaypyjamas.com/api-reference/rag/query#apireference\",\"headline\":\"POST /rag/query\",\"name\":\"POST /rag/query\",\"description\":\"Ask a natural-language question grounded in your uploaded documents\",\"url\":\"https://docs.sundaypyjamas.com/api-reference/rag/query\",\"mainEntityOfPage\":{\"@id\":\"https://docs.sundaypyjamas.com/api-reference/rag/query#webpage\"},\"dateModified\":\"2026-07-09T19:52:30.006Z\",\"publisher\":{\"@id\":\"https://docs.sundaypyjamas.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.sundaypyjamas.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"SundayPyjamas AI Suite\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"SundayPyjamas AI Suite\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/rag/query.md","siteName":"SundayPyjamas AI Suite","nav":{"global":{"anchors":[{"anchor":"API Platform","icon":"gauge-high","href":"https://suite.sundaypyjamas.com"},{"anchor":"GitHub","icon":"github","href":"https://github.com/sundaypyjamas"}]},"tabs":[{"tab":"User Guide","pages":[{"title":"User Guide","href":"/user-guide/welcome"}]},{"tab":"Documentation","pages":[{"title":"Documentation","href":"/introduction"}]},{"tab":"API Reference","groups":[{"group":"Chat","pages":[{"title":"Chat API Reference","href":"/api-reference/chat/introduction"},{"title":"POST /chat","api":"POST https://suite.sundaypyjamas.com/api/v1/chat","href":"/api-reference/chat/post-chat"}]},{"group":"Agents","pages":[{"title":"Agents API","href":"/api-reference/agents/introduction"},{"title":"Manage Agents","href":"/api-reference/agents/agents"},{"title":"Runs","href":"/api-reference/agents/runs"},{"title":"Sessions","href":"/api-reference/agents/sessions"},{"title":"Messaging \u0026 Events","href":"/api-reference/agents/messaging"}]},{"group":"RAG","pages":[{"title":"RAG API","href":"/api-reference/rag/introduction"},{"title":"POST /rag/upload","api":"POST https://suite.sundaypyjamas.com/api/v1/rag/upload","description":"Upload and index documents for retrieval-augmented generation","href":"/api-reference/rag/upload"},{"title":"POST /rag/query","api":"POST https://suite.sundaypyjamas.com/api/v1/rag/query","href":"/api-reference/rag/query"}]},{"group":"Artifacts","pages":[{"title":"Artifacts API","description":"Generate structured, LLM-authored reports from your own aggregated data","href":"/api-reference/artifacts/introduction"},{"title":"POST /artifacts/generate","api":"POST https://suite.sundaypyjamas.com/api/v1/artifacts/generate","href":"/api-reference/artifacts/generate"}]},{"group":"Image","pages":[{"title":"Image API","href":"/api-reference/image/introduction"},{"title":"POST /image","api":"POST https://suite.sundaypyjamas.com/api/v1/image","href":"/api-reference/image/generate"}]},{"group":"Vector Store","pages":[{"title":"Vector Store API","href":"/api-reference/vector-store/introduction"},{"title":"Indexes","href":"/api-reference/vector-store/indexes"},{"title":"Vectors","href":"/api-reference/vector-store/vectors"}]},{"group":"Apps","pages":[{"title":"Apps API","href":"/api-reference/apps/introduction"},{"title":"Chat","href":"/api-reference/apps/chat"},{"title":"Memory","href":"/api-reference/apps/memory"},{"title":"Usage","href":"/api-reference/apps/usage"}]},{"group":"Storage","pages":[{"title":"Storage API","href":"/api-reference/storage/introduction"},{"title":"Files","href":"/api-reference/storage/files"},{"title":"Folders \u0026 Tree","href":"/api-reference/storage/folders"},{"title":"Import","href":"/api-reference/storage/import"}]},{"group":"Integrations","pages":[{"title":"Integrations API","href":"/api-reference/integrations/introduction"},{"title":"Integration Packs","href":"/api-reference/integrations/integration-packs"},{"title":"MCP Connectors","href":"/api-reference/integrations/mcp-connectors"}]},{"group":"Insights","pages":[{"title":"Insights API","href":"/api-reference/insights/introduction"},{"title":"Conversations","href":"/api-reference/insights/conversations"}]},{"group":"Platform Tools","pages":[{"title":"Platform Tools API","href":"/api-reference/platform-tools/introduction"}]}]}]},"basePath":"","title":"POST /rag/query - SundayPyjamas AI Suite","deploymentId":"dpl_Em2U4NQQ2N2DE3HPbPUJVZLnAtvc","buildId":"dpl_Em2U4NQQ2N2DE3HPbPUJVZLnAtvc","dynamics":["c2aa737661","2b790eda92","b0f84f53ff"],"chunks":["OpenApiReferenceProvider-_HcdDqS2.js","snippetPresets-CXnm-WO6.js","utils-Dg59J__o.js","style-to-object-BY3JEAdk.js","utils-D8TRpdk7.js","v4-DIgz8zy6.js","addUniqueKeysToSchema-B6QaxWc5.js","conditional-requirements-CFM0id0Q.js","cloneDeep-DeMZ-lcM.js","_Uint8Array-BjA2mcVW.js","isObject-FP1Yky1u.js","ApiExamples-cjPyMv63.js","usePlaygroundInputsStore-D7BWoaw4.js","shallow-Z1ceDNSG.js","isEqual-BObTuQrO.js","CodeSnippets-D1UZ1AE-.js","CodeSnippet-B373COAT.js","getApiPlaygroundDisplay-CfL-UuDS.js","Page-DuqezyvM.js","DynamicMarkdown-5yMTCLas.js","SectionHeading-BxT1HYfP.js","icon-DYJTTD3g.js","MethodPill-4AyycJeu.js","getPastedJson-Bp3WV6cN.js","Check2Icon-PhZu6Gry.js","axios-CsQoIw0U.js"]}