{ "id": "f7a8b9c0-d1e2-3f4a-5b6c-789012def345", "url": "https://example.com/help/faq", "title": "Frequently Asked Questions - Example Inc", "description": "Find answers to common questions about our products and services.", "sync_period": "7d", "sync_status": "completed", "chunk_count": 24, "last_synced_at": "2024-01-15T10:35:00Z", "next_sync_at": "2024-01-22T10:35:00Z", "created_at": "2024-01-15T10:30:00Z"}
{ "error": { "code": "scrape_failed", "message": "Could not fetch content from URL. Make sure the page is publicly accessible." }}
Add a webpage URL as a knowledge source. The content is scraped, processed into chunks, and embedded as vectors for RAG (Retrieval Augmented Generation). Your AI agents can then reference this knowledge when answering questions.
Request Body
string
required
URL to scrape and add to knowledge base. Must be publicly accessible or include auth headers.Example:https://example.com/faq
string
default:"7d"
How often to re-sync content from the URL.Options:24h, 7d, 1mo, 3mo
string
default:"single"
How much of the website to crawl.Options:
single - Fetch one page only (immediate)
sitemap - Crawl all pages in sitemap.xml (async)
recursive - Follow links from starting URL (async)
integer
default:"100"
Maximum pages to crawl (for sitemap/recursive modes). Range: 1-500.
integer
default:"3"
How deep to follow links (recursive mode only). Range: 1-5.
boolean
default:"true"
Whether to honor robots.txt crawl restrictions.
object
Authentication headers for protected pages.Example (Bearer):
{ "id": "f7a8b9c0-d1e2-3f4a-5b6c-789012def345", "url": "https://example.com/help/faq", "title": "Frequently Asked Questions - Example Inc", "description": "Find answers to common questions about our products and services.", "sync_period": "7d", "sync_status": "completed", "chunk_count": 24, "last_synced_at": "2024-01-15T10:35:00Z", "next_sync_at": "2024-01-22T10:35:00Z", "created_at": "2024-01-15T10:30:00Z"}
{ "error": { "code": "scrape_failed", "message": "Could not fetch content from URL. Make sure the page is publicly accessible." }}
How Knowledge Works
Scraping: Content is extracted from the URL, removing navigation and boilerplate
Chunking: Text is split into semantic chunks (~500 tokens each)
Embedding: Each chunk is converted to a vector embedding
Storage: Chunks are stored in a vector database (pgvector)
Retrieval: During calls/chats, relevant chunks are retrieved and included in agent context
Supported Content
HTML pages (blogs, FAQs, documentation)
PDF files (product manuals, guides)
Plain text files
Dynamic content loaded via JavaScript may not be captured. For SPAs, consider providing direct links to static content or using server-side rendered pages.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"MAGPIPE","description":"Magpipe docs — AI agents for voice, SMS, WhatsApp, email and chat.","colors":{"primary":"#6366f1","light":"#a5b4fc","dark":"#4f46e5"},"logo":{"light":"https://mintcdn.com/snapsonic/SKw4VJxnEGW2Rnt8/logo/light.svg?fit=max\u0026auto=format\u0026n=SKw4VJxnEGW2Rnt8\u0026q=85\u0026s=b85b853edd6df8f42faded36abf5dd91","dark":"https://mintcdn.com/snapsonic/SKw4VJxnEGW2Rnt8/logo/dark.svg?fit=max\u0026auto=format\u0026n=SKw4VJxnEGW2Rnt8\u0026q=85\u0026s=ba7a94e91d596215adf79c21a5b8b97d","href":"https://magpipe.ai"},"favicon":"https://mintcdn.com/snapsonic/SKw4VJxnEGW2Rnt8/logo/favicon.svg?fit=max\u0026auto=format\u0026n=SKw4VJxnEGW2Rnt8\u0026q=85\u0026s=d110aa19772b0077eee89b696fa420f9","api":{"openapi":"openapi.json","playground":{"display":"interactive"},"mdx":{"auth":{"method":"bearer"},"server":"https://api.magpipe.ai/functions/v1"}},"appearance":{"default":"light"},"background":{"color":{"light":"#f9fafb","dark":"#0f172a"}},"navbar":{"links":[{"href":"https://magpipe.ai/inbox?support=1","label":"Support"}],"primary":{"type":"button","label":"Dashboard","href":"https://magpipe.ai/inbox"}},"footer":{"socials":{"website":"https://magpipe.ai","github":"https://github.com/elagerway/magpipe"}},"fonts":{"heading":{"family":"Barlow","weight":800},"body":{"family":"Inter"}},"styling":{"eyebrows":"section","codeblocks":"dark","latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"snapsonic","hasAudioNarration":false,"actualSubdomain":"snapsonic","customDomains":["docs.magpipe.ai"],"gitSource":{"type":"github","owner":"snapsonic","repo":"magpipe","deployBranch":"master","contentDirectory":"docs","isPrivate":true,"mountPath":"","label":"","_id":"6b10aa199ffae5051c3fbfb6"},"entitlements":{},"buildId":"6b05caf43341fbe734ae1d78","clientVersion":"0.0.4458","searchFilterCounts":[{"language":"default","tag":"API Reference","count":88},{"language":"default","tag":"Documentation","count":31},{"language":"default","tag":"Features","count":25},{"language":"default","tag":"Skills","count":7},{"language":"default","tag":"Calls","count":6},{"language":"default","tag":"Agents","count":5},{"language":"default","tag":"Contacts","count":5},{"language":"default","tag":"Custom Functions","count":5},{"language":"default","tag":"Dynamic Variables","count":5},{"language":"default","tag":"Testing","count":5}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","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":"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":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"auth-vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":true},"customCss":[{"filePath":"style.css","content":":root{--mp-ink: #0f172a;--mp-cream: #f9fafb;--mp-paper: #ffffff;--mp-accent: #6366f1;--mp-accent-soft: #a5b4fc;--mp-accent-tint: #e0e7ff;--mp-line: #0f172a;--mp-shadow: 4px 4px 0 var(--mp-ink);--mp-mono: ui-monospace, \"SF Mono\", Menlo, Consolas, monospace;--mp-display: \"Barlow\", \"Inter\", system-ui, sans-serif}.dark{--mp-ink: #f9fafb;--mp-cream: #0f172a;--mp-paper: #111a2e;--mp-accent-tint: #1e2347;--mp-line: #f9fafb;--mp-shadow: 4px 4px 0 var(--mp-accent)}#content-area h1,#page-title,#content-area h2{font-family:var(--mp-display)!important;font-weight:800!important;text-transform:uppercase;letter-spacing:-0.015em;line-height:1!important}#page-title{font-size:2.5rem!important}#content-area h2{font-size:1.6rem!important;margin-top:2.5rem}#content-area h3{font-family:var(--mp-display)!important;font-weight:700!important;font-size:1.15rem!important;text-transform:uppercase;letter-spacing:0}#header .eyebrow,#content-area .eyebrow,[class*=\"eyebrow\"]{font-family:var(--mp-mono)!important;font-size:0.68rem!important;letter-spacing:0.14em;text-transform:uppercase;font-weight:500!important}#header .eyebrow::before,[class*=\"eyebrow\"]::before{content:\"/ \"}#navbar{border-bottom:2px solid var(--mp-line)!important;box-shadow:none!important}#navbar img{height:30px!important}#navbar .nav-tabs-item,#navbar-transition .nav-tabs-item,#navbar nav a{font-family:var(--mp-mono)!important;font-size:0.72rem!important;letter-spacing:0.12em;text-transform:uppercase}#search-bar-entry{border-radius:0!important;border:2px solid var(--mp-line)!important;box-shadow:none!important}#navbar button,#topbar-cta-button,#topbar-cta-button a,#navbar a[href*=\"magpipe.ai/inbox\"]{border-radius:0!important}#topbar-cta-button a,#navbar a[href=\"https://magpipe.ai/inbox\"]{background:var(--mp-ink)!important;color:var(--mp-cream)!important;border:2px solid var(--mp-ink)!important;font-family:var(--mp-mono)!important;font-size:0.72rem!important;letter-spacing:0.12em;text-transform:uppercase;box-shadow:none!important}#topbar-cta-button a:hover,#navbar a[href=\"https://magpipe.ai/inbox\"]:hover{background:var(--mp-accent)!important;border-color:var(--mp-accent)!important}.dark #topbar-cta-button a{background:var(--mp-accent)!important;border-color:var(--mp-accent)!important;color:#fff!important}#topbar-cta-button a>span.absolute{display:none!important}#topbar-cta-button a{padding:0.55rem 1rem!important;line-height:1!important}#topbar-cta-button a svg{display:none!important}#topbar-cta-button a span,#topbar-cta-button a div{color:inherit!important}#sidebar h3.sidebar-title,#sidebar-content h3.sidebar-title,#navigation-items h3,#sidebar h5,#navigation-items h5{font-family:var(--mp-mono)!important;font-size:0.66rem!important;letter-spacing:0.14em;text-transform:uppercase;font-weight:500!important}#sidebar a,#navigation-items a,#sidebar li>div{border-radius:0!important}#navigation-items a[aria-current=\"page\"],#navigation-items li.active>a,#sidebar a.active{background:var(--mp-accent-tint)!important;box-shadow:inset 4px 0 0 var(--mp-accent)}#table-of-contents h5,#table-of-contents-content>p:first-child,#table-of-contents .flex>span{font-family:var(--mp-mono)!important;font-size:0.66rem!important;letter-spacing:0.14em;text-transform:uppercase}#content-area .card,#content-area a[class*=\"card\"],#content-area [class*=\"callout\"],#content-area .callout,#content-area pre,#content-area [class*=\"codeblock\"],#content-area [class*=\"code-group\"],#content-area img,#content-area video,#content-area .frame,#content-area [class*=\"accordion\"],#content-area [class*=\"tabs\"]>div,#content-area button,#content-area input,#content-area select,#content-area [class*=\"badge\"],#content-area [class*=\"rounded\"]{border-radius:0!important}#content-area .card,#content-area a[class*=\"card\"]{border:2px solid var(--mp-line)!important;box-shadow:var(--mp-shadow)!important;transition:transform 0.08s ease, box-shadow 0.08s ease}#content-area .card:hover,#content-area a[class*=\"card\"]:hover{transform:translate(2px, 2px);box-shadow:2px 2px 0 var(--mp-ink)!important}#content-area .card h2,#content-area .card h3,#content-area a[class*=\"card\"] h2,#content-area a[class*=\"card\"] h3{font-family:var(--mp-display)!important;font-weight:800!important;text-transform:uppercase;font-size:1.1rem!important}#content-area img:not([class*=\"icon\"]):not(.h-6):not(.w-6),#content-area .frame{border:2px solid var(--mp-line)}#content-area [class*=\"callout\"],#content-area .callout{border:2px solid var(--mp-line)!important;border-left-width:6px!important}#content-area table{border-collapse:collapse;border:2px solid var(--mp-line)}#content-area th,#content-area td{border:1px solid var(--mp-line)!important}#content-area th{font-family:var(--mp-mono);font-size:0.68rem;letter-spacing:0.12em;text-transform:uppercase;background:var(--mp-paper)}#content-area :not(pre)>code{border-radius:0!important;border:1px solid var(--mp-line)}#content-area pre{border:2px solid var(--mp-line)!important}#content-area [class*=\"step\"] [class*=\"rounded-full\"],#content-area [class*=\"steps\"] [class*=\"number\"]{border-radius:0!important;font-family:var(--mp-mono);font-weight:600;border:2px solid var(--mp-line);background:var(--mp-paper)}#content-area [class*=\"method\"],[class*=\"api-playground\"] button,[class*=\"playground\"] input,[class*=\"playground\"] select{border-radius:0!important}.code-group,.code-group>*,#content-side-layout pre,#content-side-layout [class*=\"rounded\"]{border-radius:0!important}.code-group{border:2px solid var(--mp-line)!important}#footer{border-top:2px solid var(--mp-line)}#content-area a.pagination-prev,#content-area a.pagination-next{border-radius:0!important;border:2px solid var(--mp-line)!important;padding:0.55rem 0.9rem!important;gap:0.6rem!important;font-family:var(--mp-mono)!important;font-size:0.72rem!important;font-weight:500!important;letter-spacing:0.1em;text-transform:uppercase;color:var(--mp-ink)!important;max-width:48%;transition:background 0.1s ease}#content-area a.pagination-prev:hover,#content-area a.pagination-next:hover{background:var(--mp-accent-tint)!important}#content-area a.pagination-prev svg,#content-area a.pagination-next svg{stroke:var(--mp-ink)!important;height:0.55rem!important}#content-area a.pagination-prev [data-component-part=\"pagination-title\"],#content-area a.pagination-next [data-component-part=\"pagination-title\"]{color:inherit!important}@media (max-width: 768px){:root,.dark{--mp-shadow: 3px 3px 0 var(--mp-ink)}#page-title{font-size:2rem!important}}"}]}
{"page":{"pagePath":"api-reference/endpoints/add-knowledge-source","slug":"/api-reference/endpoints/add-knowledge-source","pageMetadata":{"title":"Add Knowledge Source","api":"POST /knowledge-source-add","description":"Add a URL as a knowledge source for your AI agents","href":"/api-reference/endpoints/add-knowledge-source"},"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 a URL as a knowledge source for your AI agents\"\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={code:`code`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Note,ParamField,ResponseField}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Add a webpage URL as a knowledge source. The content is scraped, processed into chunks, and embedded as vectors for RAG (Retrieval Augmented Generation). Your AI agents can then reference this knowledge when answering questions.`}),`\n`,_jsx(Heading,{level:`2`,id:`request-body`,children:`Request Body`}),`\n`,_jsxs(ParamField,{body:`url`,type:`string`,required:true,id:`param-url`,children:[_jsx(_components.p,{children:`URL to scrape and add to knowledge base. Must be publicly accessible or include auth headers.`}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Example:`}),` `,_jsx(_components.code,{children:`https://example.com/faq`})]})]}),`\n`,_jsxs(ParamField,{body:`sync_period`,type:`string`,default:`7d`,id:`param-sync-period`,children:[_jsx(_components.p,{children:`How often to re-sync content from the URL.`}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Options:`}),` `,_jsx(_components.code,{children:`24h`}),`, `,_jsx(_components.code,{children:`7d`}),`, `,_jsx(_components.code,{children:`1mo`}),`, `,_jsx(_components.code,{children:`3mo`})]})]}),`\n`,_jsxs(ParamField,{body:`crawl_mode`,type:`string`,default:`single`,id:`param-crawl-mode`,children:[_jsx(_components.p,{children:`How much of the website to crawl.`}),_jsx(_components.p,{children:_jsx(_components.strong,{children:`Options:`})}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`single`}),` - Fetch one page only (immediate)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`sitemap`}),` - Crawl all pages in sitemap.xml (async)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`recursive`}),` - Follow links from starting URL (async)`]}),`\n`]})]}),`\n`,_jsx(ParamField,{body:`max_pages`,type:`integer`,default:`100`,id:`param-max-pages`,children:_jsx(_components.p,{children:`Maximum pages to crawl (for sitemap/recursive modes). Range: 1-500.`})}),`\n`,_jsx(ParamField,{body:`crawl_depth`,type:`integer`,default:`3`,id:`param-crawl-depth`,children:_jsx(_components.p,{children:`How deep to follow links (recursive mode only). Range: 1-5.`})}),`\n`,_jsx(ParamField,{body:`respect_robots_txt`,type:`boolean`,default:`true`,id:`param-respect-robots-txt`,children:_jsx(_components.p,{children:`Whether to honor robots.txt crawl restrictions.`})}),`\n`,_jsxs(ParamField,{body:`auth_headers`,type:`object`,id:`param-auth-headers`,children:[_jsx(_components.p,{children:`Authentication headers for protected pages.`}),_jsx(_components.p,{children:_jsx(_components.strong,{children:`Example (Bearer):`})}),_jsx(CodeBlock,{filename:``,numberOfLines:`3`,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:`3`,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:` \"Authorization\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Bearer YOUR_API_KEY\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsx(_components.p,{children:_jsx(_components.strong,{children:`Example (Basic):`})}),_jsx(CodeBlock,{filename:``,numberOfLines:`3`,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:`3`,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:` \"Authorization\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Basic dXNlcm5hbWU6cGFzc3dvcmQ=\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})})]}),`\n`,_jsx(Heading,{level:`2`,id:`response`,children:`Response`}),`\n`,_jsx(ResponseField,{name:`id`,type:`string`,id:`param-id`,children:_jsx(_components.p,{children:`Unique knowledge source identifier.`})}),`\n`,_jsx(ResponseField,{name:`url`,type:`string`,id:`param-url-1`,children:_jsx(_components.p,{children:`The source URL.`})}),`\n`,_jsx(ResponseField,{name:`title`,type:`string`,id:`param-title`,children:_jsx(_components.p,{children:`Extracted page title.`})}),`\n`,_jsx(ResponseField,{name:`description`,type:`string`,id:`param-description`,children:_jsx(_components.p,{children:`Extracted meta description.`})}),`\n`,_jsx(ResponseField,{name:`sync_status`,type:`string`,id:`param-sync-status`,children:_jsxs(_components.p,{children:[`Current sync status: `,_jsx(_components.code,{children:`pending`}),`, `,_jsx(_components.code,{children:`syncing`}),`, `,_jsx(_components.code,{children:`completed`}),`, `,_jsx(_components.code,{children:`failed`}),`.`]})}),`\n`,_jsx(ResponseField,{name:`chunk_count`,type:`integer`,id:`param-chunk-count`,children:_jsx(_components.p,{children:`Number of text chunks created from the content.`})}),`\n`,_jsx(ResponseField,{name:`next_sync_at`,type:`string`,id:`param-next-sync-at`,children:_jsx(_components.p,{children:`When the next automatic sync will occur.`})}),`\n`,`\n`,`\n`,_jsx(Heading,{level:`2`,id:`how-knowledge-works`,children:`How Knowledge Works`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Scraping`}),`: Content is extracted from the URL, removing navigation and boilerplate`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Chunking`}),`: Text is split into semantic chunks (~500 tokens each)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Embedding`}),`: Each chunk is converted to a vector embedding`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Storage`}),`: Chunks are stored in a vector database (pgvector)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Retrieval`}),`: During calls/chats, relevant chunks are retrieved and included in agent context`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`supported-content`,children:`Supported Content`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`HTML pages (blogs, FAQs, documentation)`}),`\n`,_jsx(_components.li,{children:`PDF files (product manuals, guides)`}),`\n`,_jsx(_components.li,{children:`Plain text files`}),`\n`]}),`\n`,_jsx(Note,{children:_jsx(_components.p,{children:`Dynamic content loaded via JavaScript may not be captured. For SPAs, consider providing direct links to static content or using server-side rendered pages.`})})]})}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":{"codeStyling":"dark","config":{},"pageMetadata":{"title":"Add Knowledge Source","api":"POST /knowledge-source-add","description":"Add a URL as a knowledge source for your AI agents","href":"/api-reference/endpoints/add-knowledge-source"}}},"mdxSourceWithNoJs":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Note,ParamField,RequestExample,ResponseExample,ResponseField}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!RequestExample)_missingMdxReference(`RequestExample`,true);if(!ResponseExample)_missingMdxReference(`ResponseExample`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Add a webpage URL as a knowledge source. The content is scraped, processed into chunks, and embedded as vectors for RAG (Retrieval Augmented Generation). Your AI agents can then reference this knowledge when answering questions.`}),`\n`,_jsx(Heading,{level:`2`,id:`request-body`,children:`Request Body`}),`\n`,_jsxs(ParamField,{body:`url`,type:`string`,required:true,id:`param-url`,children:[_jsx(_components.p,{children:`URL to scrape and add to knowledge base. Must be publicly accessible or include auth headers.`}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Example:`}),` `,_jsx(_components.code,{children:`https://example.com/faq`})]})]}),`\n`,_jsxs(ParamField,{body:`sync_period`,type:`string`,default:`7d`,id:`param-sync-period`,children:[_jsx(_components.p,{children:`How often to re-sync content from the URL.`}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Options:`}),` `,_jsx(_components.code,{children:`24h`}),`, `,_jsx(_components.code,{children:`7d`}),`, `,_jsx(_components.code,{children:`1mo`}),`, `,_jsx(_components.code,{children:`3mo`})]})]}),`\n`,_jsxs(ParamField,{body:`crawl_mode`,type:`string`,default:`single`,id:`param-crawl-mode`,children:[_jsx(_components.p,{children:`How much of the website to crawl.`}),_jsx(_components.p,{children:_jsx(_components.strong,{children:`Options:`})}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`single`}),` - Fetch one page only (immediate)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`sitemap`}),` - Crawl all pages in sitemap.xml (async)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`recursive`}),` - Follow links from starting URL (async)`]}),`\n`]})]}),`\n`,_jsx(ParamField,{body:`max_pages`,type:`integer`,default:`100`,id:`param-max-pages`,children:_jsx(_components.p,{children:`Maximum pages to crawl (for sitemap/recursive modes). Range: 1-500.`})}),`\n`,_jsx(ParamField,{body:`crawl_depth`,type:`integer`,default:`3`,id:`param-crawl-depth`,children:_jsx(_components.p,{children:`How deep to follow links (recursive mode only). Range: 1-5.`})}),`\n`,_jsx(ParamField,{body:`respect_robots_txt`,type:`boolean`,default:`true`,id:`param-respect-robots-txt`,children:_jsx(_components.p,{children:`Whether to honor robots.txt crawl restrictions.`})}),`\n`,_jsxs(ParamField,{body:`auth_headers`,type:`object`,id:`param-auth-headers`,children:[_jsx(_components.p,{children:`Authentication headers for protected pages.`}),_jsx(_components.p,{children:_jsx(_components.strong,{children:`Example (Bearer):`})}),_jsx(CodeBlock,{filename:``,numberOfLines:`3`,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:`3`,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:` \"Authorization\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Bearer YOUR_API_KEY\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsx(_components.p,{children:_jsx(_components.strong,{children:`Example (Basic):`})}),_jsx(CodeBlock,{filename:``,numberOfLines:`3`,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:`3`,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:` \"Authorization\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Basic dXNlcm5hbWU6cGFzc3dvcmQ=\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})})]}),`\n`,_jsx(Heading,{level:`2`,id:`response`,children:`Response`}),`\n`,_jsx(ResponseField,{name:`id`,type:`string`,id:`param-id`,children:_jsx(_components.p,{children:`Unique knowledge source identifier.`})}),`\n`,_jsx(ResponseField,{name:`url`,type:`string`,id:`param-url-1`,children:_jsx(_components.p,{children:`The source URL.`})}),`\n`,_jsx(ResponseField,{name:`title`,type:`string`,id:`param-title`,children:_jsx(_components.p,{children:`Extracted page title.`})}),`\n`,_jsx(ResponseField,{name:`description`,type:`string`,id:`param-description`,children:_jsx(_components.p,{children:`Extracted meta description.`})}),`\n`,_jsx(ResponseField,{name:`sync_status`,type:`string`,id:`param-sync-status`,children:_jsxs(_components.p,{children:[`Current sync status: `,_jsx(_components.code,{children:`pending`}),`, `,_jsx(_components.code,{children:`syncing`}),`, `,_jsx(_components.code,{children:`completed`}),`, `,_jsx(_components.code,{children:`failed`}),`.`]})}),`\n`,_jsx(ResponseField,{name:`chunk_count`,type:`integer`,id:`param-chunk-count`,children:_jsx(_components.p,{children:`Number of text chunks created from the content.`})}),`\n`,_jsx(ResponseField,{name:`next_sync_at`,type:`string`,id:`param-next-sync-at`,children:_jsx(_components.p,{children:`When the next automatic sync will occur.`})}),`\n`,_jsxs(RequestExample,{children:[_jsx(CodeBlock,{filename:`cURL`,numberOfLines:`7`,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:`7`,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:` POST`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` https://api.magpipe.ai/functions/v1/knowledge-source-add`}),_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 YOUR_API_KEY\"`}),_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:` \"url\": \"https://example.com/help/faq\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"sync_period\": \"7d\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Node.js`,numberOfLines:`17`,language:`javascript`,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:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`17`,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:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` fetch`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` 'https://api.magpipe.ai/functions/v1/knowledge-source-add'`}),_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`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` method:`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` 'POST'`}),_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:` headers:`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` 'Authorization'`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` 'Bearer YOUR_API_KEY'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` 'Content-Type'`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` 'application/json'`}),_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`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` body:`}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:` JSON`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`stringify`}),_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:` url:`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` 'https://example.com/help/faq'`}),_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:` sync_period:`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` '7d'`})]}),`\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(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`);`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_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:` source`}),_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:` response`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`json`}),_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:`console`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'Added:'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`source`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`title`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`Python`,numberOfLines:`16`,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:`16`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` requests`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`response = requests.post(`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` 'https://api.magpipe.ai/functions/v1/knowledge-source-add'`}),_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:` headers`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`={`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` 'Authorization'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'Bearer YOUR_API_KEY'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` 'Content-Type'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'application/json'`}),_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`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` json`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`={`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` 'url'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'https://example.com/help/faq'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` 'sync_period'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'7d'`})]}),`\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(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`source = response.json()`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Added: `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`source[`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'title'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`]`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})})]}),`\n`,_jsxs(ResponseExample,{children:[_jsx(CodeBlock,{filename:`Success Response`,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:` \"id\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"f7a8b9c0-d1e2-3f4a-5b6c-789012def345\"`}),_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:` \"url\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"https://example.com/help/faq\"`}),_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:` \"title\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Frequently Asked Questions - Example Inc\"`}),_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:` \"description\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Find answers to common questions about our products and services.\"`}),_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:` \"sync_period\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"7d\"`}),_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:` \"sync_status\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"completed\"`}),_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:` \"chunk_count\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`24`}),_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:` \"last_synced_at\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"2024-01-15T10:35:00Z\"`}),_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:` \"next_sync_at\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"2024-01-22T10:35:00Z\"`}),_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:` \"created_at\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"2024-01-15T10:30:00Z\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Error Response`,numberOfLines:`6`,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:`6`,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:` \"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:`\"scrape_failed\"`}),_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:`\"Could not fetch content from URL. Make sure the page is publicly accessible.\"`})]}),`\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:`how-knowledge-works`,children:`How Knowledge Works`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Scraping`}),`: Content is extracted from the URL, removing navigation and boilerplate`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Chunking`}),`: Text is split into semantic chunks (~500 tokens each)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Embedding`}),`: Each chunk is converted to a vector embedding`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Storage`}),`: Chunks are stored in a vector database (pgvector)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Retrieval`}),`: During calls/chats, relevant chunks are retrieved and included in agent context`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`supported-content`,children:`Supported Content`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`HTML pages (blogs, FAQs, documentation)`}),`\n`,_jsx(_components.li,{children:`PDF files (product manuals, guides)`}),`\n`,_jsx(_components.li,{children:`Plain text files`}),`\n`]}),`\n`,_jsx(Note,{children:_jsx(_components.p,{children:`Dynamic content loaded via JavaScript may not be captured. For SPAs, consider providing direct links to static content or using server-side rendered pages.`})})]})}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":{"codeStyling":"dark","config":{},"pageMetadata":{"title":"Add Knowledge Source","api":"POST /knowledge-source-add","description":"Add a URL as a knowledge source for your AI agents","href":"/api-reference/endpoints/add-knowledge-source"}}}},"mdxExtracts":{"tableOfContents":[{"title":"Request Body","slug":"request-body","depth":2,"children":[]},{"title":"Response","slug":"response","depth":2,"children":[]},{"title":"How Knowledge Works","slug":"how-knowledge-works","depth":2,"children":[]},{"title":"Supported Content","slug":"supported-content","depth":2,"children":[]}],"codeExamples":{"request":{"type":"RequestExample","children":[{"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=\"7\">\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\"> POST\u003c/span>\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\"> https://api.magpipe.ai/functions/v1/knowledge-source-add\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 YOUR_API_KEY\"\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\"> \"url\": \"https://example.com/help/faq\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\"> \"sync_period\": \"7d\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\"> }'\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"Node.js","html":"\u003cpre class=\"shiki shiki-themes dark-plus dark-plus\" style=\"background-color:#0B0C0E;--shiki-dark-bg:#0B0C0E;color:#D4D4D4;--shiki-dark:#D4D4D4\" language=\"javascript\">\u003ccode language=\"javascript\" numberOfLines=\"17\">\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:#DCDCAA;--shiki-dark:#DCDCAA\"> fetch\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">(\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\"> 'https://api.magpipe.ai/functions/v1/knowledge-source-add'\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:#9CDCFE;--shiki-dark:#9CDCFE\"> method:\u003c/span>\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\"> 'POST'\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#9CDCFE;--shiki-dark:#9CDCFE\"> headers:\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\"> {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\"> 'Authorization'\u003c/span>\u003cspan style=\"color:#9CDCFE;--shiki-dark:#9CDCFE\">:\u003c/span>\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\"> 'Bearer YOUR_API_KEY'\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\"> 'Content-Type'\u003c/span>\u003cspan style=\"color:#9CDCFE;--shiki-dark:#9CDCFE\">:\u003c/span>\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\"> 'application/json'\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:#9CDCFE;--shiki-dark:#9CDCFE\"> body:\u003c/span>\u003cspan style=\"color:#4FC1FF;--shiki-dark:#4FC1FF\"> JSON\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#DCDCAA;--shiki-dark:#DCDCAA\">stringify\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">({\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#9CDCFE;--shiki-dark:#9CDCFE\"> url:\u003c/span>\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\"> 'https://example.com/help/faq'\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#9CDCFE;--shiki-dark:#9CDCFE\"> sync_period:\u003c/span>\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\"> '7d'\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\u003cspan class=\"line\">\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">);\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#569CD6;--shiki-dark:#569CD6\">const\u003c/span>\u003cspan style=\"color:#4FC1FF;--shiki-dark:#4FC1FF\"> source\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\"> response\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#DCDCAA;--shiki-dark:#DCDCAA\">json\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">();\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#9CDCFE;--shiki-dark:#9CDCFE\">console\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#DCDCAA;--shiki-dark:#DCDCAA\">log\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">(\u003c/span>\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\">'Added:'\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#9CDCFE;--shiki-dark:#9CDCFE\">source\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#9CDCFE;--shiki-dark:#9CDCFE\">title\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">);\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"Python","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=\"16\">\u003cspan class=\"line\">\u003cspan style=\"color:#C586C0;--shiki-dark:#C586C0\">import\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\"> requests\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">response = requests.post(\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\"> 'https://api.magpipe.ai/functions/v1/knowledge-source-add'\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#9CDCFE;--shiki-dark:#9CDCFE\"> headers\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">={\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\"> 'Authorization'\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\">'Bearer YOUR_API_KEY'\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\"> 'Content-Type'\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\">'application/json'\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:#9CDCFE;--shiki-dark:#9CDCFE\"> json\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">={\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\"> 'url'\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\">'https://example.com/help/faq'\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\"> 'sync_period'\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\">'7d'\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\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">source = response.json()\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#DCDCAA;--shiki-dark:#DCDCAA\">print\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">(\u003c/span>\u003cspan style=\"color:#569CD6;--shiki-dark:#569CD6\">f\u003c/span>\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\">\"Added: \u003c/span>\u003cspan style=\"color:#569CD6;--shiki-dark:#569CD6\">{\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">source[\u003c/span>\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\">'title'\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">]\u003c/span>\u003cspan style=\"color:#569CD6;--shiki-dark:#569CD6\">}\u003c/span>\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\">\"\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">)\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]},"response":{"type":"ResponseExample","children":[{"filename":"Success Response","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\"> \"id\"\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\">\"f7a8b9c0-d1e2-3f4a-5b6c-789012def345\"\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#9CDCFE;--shiki-dark:#9CDCFE\"> \"url\"\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\">\"https://example.com/help/faq\"\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#9CDCFE;--shiki-dark:#9CDCFE\"> \"title\"\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\">\"Frequently Asked Questions - Example Inc\"\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#9CDCFE;--shiki-dark:#9CDCFE\"> \"description\"\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\">\"Find answers to common questions about our products and services.\"\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#9CDCFE;--shiki-dark:#9CDCFE\"> \"sync_period\"\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\">\"7d\"\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#9CDCFE;--shiki-dark:#9CDCFE\"> \"sync_status\"\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\">\"completed\"\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#9CDCFE;--shiki-dark:#9CDCFE\"> \"chunk_count\"\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#B5CEA8;--shiki-dark:#B5CEA8\">24\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#9CDCFE;--shiki-dark:#9CDCFE\"> \"last_synced_at\"\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\">\"2024-01-15T10:35:00Z\"\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#9CDCFE;--shiki-dark:#9CDCFE\"> \"next_sync_at\"\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\">\"2024-01-22T10:35:00Z\"\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#9CDCFE;--shiki-dark:#9CDCFE\"> \"created_at\"\u003c/span>\u003cspan style=\"color:#D4D4D4;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#CE9178;--shiki-dark:#CE9178\">\"2024-01-15T10:30:00Z\"\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":"Error Response","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=\"6\">\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\"> \"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\">\"scrape_failed\"\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\">\"Could not fetch content from URL. Make sure the page is publicly accessible.\"\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":[]}},"endpoint":{"title":"Add Knowledge Source","path":"/knowledge-source-add","servers":[{"url":"https://api.magpipe.ai/functions/v1"}],"method":"post","request":{"security":[{"title":"Bearer Auth","parameters":{"header":{"Authorization":{"type":"http","scheme":"bearer","description":"Bearer authentication header of the form `Bearer \u003ctoken>`, where `\u003ctoken>` is your auth token."}},"query":{},"cookie":{}}}],"parameters":{"query":{},"header":{},"cookie":{},"path":{}},"body":{"application/json":{"schemaArray":[{"type":"object","properties":{"url":[{"type":"string","description":"URL to scrape and add to knowledge base. Must be publicly accessible or include auth headers. Example: `https://example.com/faq`","required":true}],"sync_period":[{"type":"string","description":"How often to re-sync content from the URL. Options: `24h` , `7d` , `1mo` , `3mo`"}],"crawl_mode":[{"type":"string","description":"How much of the website to crawl. Options: `single` - Fetch one page only (immediate) `sitemap` - Crawl all pages in sitemap.xml (async) `recursive` - Follow links from starting URL (async)"}],"max_pages":[{"type":"integer","description":"Maximum pages to crawl (for sitemap/recursive modes). Range: 1-500."}],"crawl_depth":[{"type":"integer","description":"How deep to follow links (recursive mode only). Range: 1-5."}],"respect_robots_txt":[{"type":"boolean","description":"Whether to honor robots.txt crawl restrictions."}],"auth_headers":[{"type":"object","properties":{},"description":"Authentication headers for protected pages. Example (Bearer): Example (Basic):"}]}}],"examples":{"example":{"value":{"url":"\u003cstring>","sync_period":"\u003cstring>","crawl_mode":"\u003cstring>","max_pages":123,"crawl_depth":123,"respect_robots_txt":true,"auth_headers":{}}}}}}},"response":{"200":{"application/json":{"schemaArray":[{"type":"object","properties":{"id":[{"type":"string","description":"Unique knowledge source identifier."}],"url":[{"type":"string","description":"The source URL."}],"title":[{"type":"string","description":"Extracted page title."}],"description":[{"type":"string","description":"Extracted meta description."}],"sync_status":[{"type":"string","description":"Current sync status: `pending` , `syncing` , `completed` , `failed` ."}],"chunk_count":[{"type":"integer","description":"Number of text chunks created from the content."}],"next_sync_at":[{"type":"string","description":"When the next automatic sync will occur."}]}}],"examples":{"example":{"value":{"id":"\u003cstring>","url":"\u003cstring>","title":"\u003cstring>","description":"\u003cstring>","sync_status":"\u003cstring>","chunk_count":123,"next_sync_at":"\u003cstring>"}}}}}},"deprecated":false}},"jsLinks":[],"subdomain":"snapsonic","siteName":"MAGPIPE","title":"Add Knowledge Source - MAGPIPE","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-24T17:35:56.548Z","originalFileLocation":"api-reference/endpoints/add-knowledge-source.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=\"light\"}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 a URL as a knowledge source for your AI agents\">\u003cmeta data-mint-head name=\"application-name\" content=\"MAGPIPE\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/snapsonic/_iBvdCPBUP4oMVg3/_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/snapsonic/_iBvdCPBUP4oMVg3/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/snapsonic/_iBvdCPBUP4oMVg3/_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/snapsonic/_iBvdCPBUP4oMVg3/_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/snapsonic/_iBvdCPBUP4oMVg3/_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/snapsonic/_iBvdCPBUP4oMVg3/_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/snapsonic/_iBvdCPBUP4oMVg3/_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/snapsonic/_iBvdCPBUP4oMVg3/_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/snapsonic/_iBvdCPBUP4oMVg3/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Add Knowledge Source - MAGPIPE\">\u003cmeta data-mint-head property=\"og:description\" content=\"Add a URL as a knowledge source for your AI agents\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"MAGPIPE\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.magpipe.ai/api-reference/endpoints/add-knowledge-source\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://snapsonic.mintlify.site/_mintlify/api/og/v2?division=Knowledge+Base\u0026amp;title=Add+Knowledge+Source\u0026amp;description=Add+a+URL+as+a+knowledge+source+for+your+AI+agents\u0026amp;theme=fd0d942f37c3ec7786fec782\u0026amp;signature=89e2e976a4dd66d06ea779d3c24631da5a771f381c0b822fc6b70a67964a7586\">\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=\"Add Knowledge Source - MAGPIPE\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Add a URL as a knowledge source for your AI agents\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://snapsonic.mintlify.site/_mintlify/api/og/v2?division=Knowledge+Base\u0026amp;title=Add+Knowledge+Source\u0026amp;description=Add+a+URL+as+a+knowledge+source+for+your+AI+agents\u0026amp;theme=fd0d942f37c3ec7786fec782\u0026amp;signature=89e2e976a4dd66d06ea779d3c24631da5a771f381c0b822fc6b70a67964a7586\">\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/snapsonic/_iBvdCPBUP4oMVg3/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"MAGPIPE\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#6366f1\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.magpipe.ai/api-reference/endpoints/add-knowledge-source\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/endpoints/add-knowledge-source.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.magpipe.ai/#organization\",\"name\":\"MAGPIPE\",\"url\":\"https://docs.magpipe.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/snapsonic/SKw4VJxnEGW2Rnt8/logo/light.svg?fit=max\u0026auto=format\u0026n=SKw4VJxnEGW2Rnt8\u0026q=85\u0026s=b85b853edd6df8f42faded36abf5dd91\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.magpipe.ai#website\",\"name\":\"MAGPIPE\",\"url\":\"https://docs.magpipe.ai\",\"publisher\":{\"@id\":\"https://docs.magpipe.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.magpipe.ai/api-reference/endpoints/add-knowledge-source#webpage\",\"url\":\"https://docs.magpipe.ai/api-reference/endpoints/add-knowledge-source\",\"name\":\"Add Knowledge Source\",\"description\":\"Add a URL as a knowledge source for your AI agents\",\"dateModified\":\"2026-11-24T17:35:56.548Z\",\"isPartOf\":{\"@id\":\"https://docs.magpipe.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.magpipe.ai/api-reference/endpoints/add-knowledge-source#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.magpipe.ai/api-reference/endpoints/add-knowledge-source#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"MAGPIPE\",\"item\":\"https://docs.magpipe.ai\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Add Knowledge Source\",\"item\":\"https://docs.magpipe.ai/api-reference/endpoints/add-knowledge-source\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.magpipe.ai/api-reference/endpoints/add-knowledge-source#apireference\",\"headline\":\"Add Knowledge Source\",\"name\":\"Add Knowledge Source\",\"description\":\"Add a URL as a knowledge source for your AI agents\",\"url\":\"https://docs.magpipe.ai/api-reference/endpoints/add-knowledge-source\",\"mainEntityOfPage\":{\"@id\":\"https://docs.magpipe.ai/api-reference/endpoints/add-knowledge-source#webpage\"},\"dateModified\":\"2026-11-24T17:35:56.548Z\",\"publisher\":{\"@id\":\"https://docs.magpipe.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.magpipe.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"MAGPIPE\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"MAGPIPE\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/endpoints/add-knowledge-source.md","siteName":"MAGPIPE","nav":{"global":null,"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":"/introduction"}]},{"tab":"API Reference","groups":[{"group":"API Reference","pages":[{"title":"API Introduction","href":"/api-reference/introduction"},{"title":"Authentication","href":"/api-reference/authentication"},{"title":"MCP Server","href":"/api-reference/mcp-server"}]},{"group":"Agents","pages":[{"title":"Create Agent","api":"POST https://api.magpipe.ai/functions/v1/create-agent","href":"/api-reference/endpoints/create-agent"},{"title":"Get Agent","api":"POST /get-agent","href":"/api-reference/endpoints/get-agent"},{"title":"Update Agent","api":"POST /update-agent","href":"/api-reference/endpoints/update-agent"},{"title":"List Agents","api":"POST /list-agents","href":"/api-reference/endpoints/list-agents"},{"title":"Delete Agent","api":"POST /delete-agent","href":"/api-reference/endpoints/delete-agent"}]},{"group":"Custom Functions","pages":[{"title":"Create Custom Function","api":"POST /custom-functions","href":"/api-reference/endpoints/create-custom-function"},{"title":"Get Custom Function","api":"GET /custom-functions/{id}","href":"/api-reference/endpoints/get-custom-function"},{"title":"Update Custom Function","api":"PATCH /custom-functions/{id}","href":"/api-reference/endpoints/update-custom-function"},{"title":"List Custom Functions","api":"GET /custom-functions","href":"/api-reference/endpoints/list-custom-functions"},{"title":"Delete Custom Function","api":"DELETE /custom-functions/{id}","href":"/api-reference/endpoints/delete-custom-function"}]},{"group":"Dynamic Variables","pages":[{"title":"Create Dynamic Variable","api":"POST /manage-dynamic-variables","href":"/api-reference/endpoints/create-dynamic-variable"},{"title":"Get Dynamic Variable","api":"GET /manage-dynamic-variables/{id}","href":"/api-reference/endpoints/get-dynamic-variable"},{"title":"Update Dynamic Variable","api":"PATCH /manage-dynamic-variables/{id}","href":"/api-reference/endpoints/update-dynamic-variable"},{"title":"List Dynamic Variables","api":"GET /manage-dynamic-variables","href":"/api-reference/endpoints/list-dynamic-variables"},{"title":"Delete Dynamic Variable","api":"DELETE /manage-dynamic-variables/{id}","href":"/api-reference/endpoints/delete-dynamic-variable"}]},{"group":"Memory","pages":[{"title":"List Memories","api":"POST /list-memories","href":"/api-reference/endpoints/list-memories"},{"title":"Get Memory","api":"POST /get-memory","href":"/api-reference/endpoints/get-memory"},{"title":"Update Memory","api":"POST /update-memory","href":"/api-reference/endpoints/update-memory"},{"title":"Delete Memory","api":"POST /delete-memory","href":"/api-reference/endpoints/delete-memory"}]},{"group":"Calls","pages":[{"title":"Create Phone Call","api":"POST /initiate-bridged-call","href":"/api-reference/endpoints/create-call"},{"title":"Get Call","api":"POST /get-call","href":"/api-reference/endpoints/get-call"},{"title":"List Calls","api":"POST /list-calls","href":"/api-reference/endpoints/list-calls"},{"title":"Transfer Call","api":"POST /transfer-call","href":"/api-reference/endpoints/transfer-call"},{"title":"End Call","api":"POST /terminate-call","href":"/api-reference/endpoints/end-call"},{"title":"Get Recording","api":"POST /get-signed-recording-url","href":"/api-reference/endpoints/get-recording"}]},{"group":"Call Whitelist","pages":[{"title":"List Whitelist Entries","api":"GET /manage-call-whitelist","href":"/api-reference/endpoints/list-whitelist-entries"},{"title":"Add Whitelist Entry","api":"POST /manage-call-whitelist","href":"/api-reference/endpoints/add-whitelist-entry"},{"title":"Delete Whitelist Entry","api":"DELETE /manage-call-whitelist","href":"/api-reference/endpoints/delete-whitelist-entry"}]},{"group":"Skills","pages":[{"title":"List Skill Definitions","api":"GET /manage-skills/definitions","href":"/api-reference/endpoints/list-skill-definitions"},{"title":"List Agent Skills","api":"GET /manage-skills","href":"/api-reference/endpoints/list-agent-skills"},{"title":"Enable Skill","api":"POST /manage-skills","href":"/api-reference/endpoints/enable-skill"},{"title":"Update Skill","api":"PATCH /manage-skills/{id}","href":"/api-reference/endpoints/update-skill"},{"title":"Delete Skill","api":"DELETE /manage-skills/{id}","href":"/api-reference/endpoints/delete-skill"},{"title":"Execute Skill","api":"POST /manage-skills/{id}/execute","href":"/api-reference/endpoints/execute-skill"},{"title":"List Skill Executions","api":"GET /manage-skills/{id}/executions","href":"/api-reference/endpoints/list-skill-executions"}]},{"group":"Batch Calls","pages":[{"title":"Create Batch Call","api":"POST /batch-calls","href":"/api-reference/endpoints/create-batch"},{"title":"List Batch Calls","api":"POST /batch-calls","href":"/api-reference/endpoints/list-batches"},{"title":"Get Batch Call","api":"POST /batch-calls","href":"/api-reference/endpoints/get-batch"},{"title":"Cancel Batch Call","api":"POST /batch-calls","href":"/api-reference/endpoints/cancel-batch"}]},{"group":"Testing","pages":[{"title":"List Test Suites","api":"GET /test-cases","href":"/api-reference/endpoints/list-test-suites"},{"title":"Create Test Suite","api":"POST /test-cases","href":"/api-reference/endpoints/create-test-suite"},{"title":"Create Test Case","api":"POST /test-cases","href":"/api-reference/endpoints/create-test-case"},{"title":"Run Test Case","api":"POST /run-test","href":"/api-reference/endpoints/run-test-case"},{"title":"List Test Runs","api":"GET /test-runs","href":"/api-reference/endpoints/list-test-runs"}]},{"group":"Messages","pages":[{"title":"Send SMS","api":"POST /send-sms","href":"/api-reference/endpoints/send-sms"},{"title":"Send WhatsApp Message","api":"POST /send-whatsapp-message","href":"/api-reference/endpoints/send-whatsapp-message"},{"title":"Send WhatsApp Template","api":"POST /send-whatsapp-template","href":"/api-reference/endpoints/send-whatsapp-template"},{"title":"Get Message","api":"POST /get-message","href":"/api-reference/endpoints/get-message"},{"title":"List Messages","api":"POST /list-messages","href":"/api-reference/endpoints/list-messages"}]},{"group":"Phone Numbers","pages":[{"title":"Search Available Numbers","api":"POST /search-phone-numbers","href":"/api-reference/endpoints/search-numbers"},{"title":"Provision Phone Number","api":"POST /provision-phone-number","href":"/api-reference/endpoints/provision-number"},{"title":"List Phone Numbers","api":"POST /list-phone-numbers","href":"/api-reference/endpoints/list-numbers"},{"title":"Release Phone Number","api":"POST /release-phone-number","href":"/api-reference/endpoints/release-number"},{"title":"Lookup Phone Number","api":"POST /lookup-phone-number","href":"/api-reference/endpoints/lookup-phone-number"}]},{"group":"Chat Widget","pages":[{"title":"Create Chat Widget","api":"POST /create-chat-widget","href":"/api-reference/endpoints/create-chat-widget"},{"title":"Send Chat Message","api":"POST /webhook-chat-message","href":"/api-reference/endpoints/send-chat-message"},{"title":"List Chat Sessions","api":"POST /list-chat-sessions","description":"List all chat sessions for your account","href":"/api-reference/endpoints/list-chat-sessions"}]},{"group":"Knowledge Base","pages":[{"title":"Add Knowledge Source","api":"POST /knowledge-source-add","href":"/api-reference/endpoints/add-knowledge-source"},{"title":"Add Knowledge (Manual)","api":"POST /knowledge-source-manual","description":"Add content directly without a URL","href":"/api-reference/endpoints/add-knowledge-manual"},{"title":"List Knowledge Sources","api":"POST /list-knowledge-sources","href":"/api-reference/endpoints/list-knowledge-sources"},{"title":"Delete Knowledge Source","api":"POST /delete-knowledge-source","href":"/api-reference/endpoints/delete-knowledge-source"}]},{"group":"Voice","pages":[{"title":"Clone Voice","api":"POST /clone-voice","href":"/api-reference/endpoints/clone-voice"},{"title":"List Voices","api":"POST /list-voices","href":"/api-reference/endpoints/list-voices"},{"title":"Delete Voice","api":"POST /delete-voice","href":"/api-reference/endpoints/delete-voice"}]},{"group":"Models","pages":[{"title":"List Models","api":"POST /list-models","href":"/api-reference/endpoints/list-models"}]},{"group":"Calendar","pages":[{"title":"Get Available Calendar Slots","api":"POST /cal-com-get-slots","href":"/api-reference/endpoints/get-calendar-slots"},{"title":"Create Calendar Booking","api":"POST /cal-com-create-booking","href":"/api-reference/endpoints/create-booking"},{"title":"Cancel Booking","api":"POST /cal-com-cancel-booking","href":"/api-reference/endpoints/cancel-booking"}]},{"group":"Contacts","pages":[{"title":"Create Contact","api":"POST /create-contact","href":"/api-reference/endpoints/create-contact"},{"title":"Get Contact","api":"POST /get-contact","href":"/api-reference/endpoints/get-contact"},{"title":"List Contacts","api":"POST /list-contacts","href":"/api-reference/endpoints/list-contacts"},{"title":"Update Contact","api":"POST /update-contact","href":"/api-reference/endpoints/update-contact"},{"title":"Delete Contact","api":"POST /delete-contact","href":"/api-reference/endpoints/delete-contact"}]},{"group":"Billing","pages":[{"title":"Get Credit Balance","api":"GET /get-credits-info","href":"/api-reference/endpoints/get-balance"},{"title":"Purchase Credits","api":"POST /stripe-add-credits","href":"/api-reference/endpoints/purchase-credits"}]},{"group":"Scheduled Actions","pages":[{"title":"Create Scheduled Action","api":"POST /scheduled-actions","href":"/api-reference/endpoints/create-scheduled-action"},{"title":"List Scheduled Actions","api":"GET /scheduled-actions","href":"/api-reference/endpoints/list-scheduled-actions"},{"title":"Cancel Scheduled Action","api":"PATCH /scheduled-actions/{id}","href":"/api-reference/endpoints/cancel-scheduled-action"}]},{"group":"API Keys \u0026 Webhooks","pages":[{"title":"Create API Key","api":"POST /manage-api-keys","href":"/api-reference/endpoints/create-api-key"},{"title":"List API Keys","api":"POST /manage-api-keys","href":"/api-reference/endpoints/list-api-keys"},{"title":"Set Webhook URL","api":"POST /manage-api-keys","href":"/api-reference/endpoints/set-webhook"},{"title":"Revoke API Key","api":"POST /manage-api-keys","href":"/api-reference/endpoints/revoke-api-key"}]}]}]},"basePath":"","title":"Add Knowledge Source - MAGPIPE","deploymentId":"dpl_HZVV42MMRSo9WnNHfTGZvby5jph9","buildId":"dpl_HZVV42MMRSo9WnNHfTGZvby5jph9","dynamics":["c2aa737661","2b790eda92","b0f84f53ff"],"chunks":["OpenApiReferenceProvider-BuieBNTB.js","snippetPresets-alIv9Yoc.js","utils-BS41p-Nj.js","style-to-object-BY3JEAdk.js","utils-D0Za9LU_.js","v4-DIgz8zy6.js","addTypeLabelsToSchema-Lx7TZ5XR.js","conditional-requirements-CFM0id0Q.js","cloneDeep-4e5CS5ZI.js","_Uint8Array-B2-W7EM3.js","isObject-FP1Yky1u.js","ApiExamples-sCe6z2hN.js","usePlaygroundInputsStore-cU_dFE5n.js","shallow-BwNCr__O.js","isEqual-Cnvzqd4L.js","CodeSnippets-CMIr49P8.js","CodeSnippet-BC-bKzyy.js","use-playground-group-access-c3bgmn-x.js","Page-Acw_JRP6.js","api-description-markdown-1o8U1kkQ.js","DynamicMarkdown-CvOkzads.js","SectionHeading-CJ97Kdt-.js","MethodPill-DynWltjQ.js","getPastedJson-CBCnXiWl.js","Check2Icon-CPHq_WNu.js","axios-CsQoIw0U.js"]}