---
title: "Add Content to Chatbot"
method: POST
path: "/v1/chatbots/{chatbotId}/links"
tags: ["Chatbot Links"]
---

# Add Content to Chatbot

`POST /v1/chatbots/{chatbotId}/links`

## Request

- Base URL: `https://sitegpt.ai/api`
- URL: `https://sitegpt.ai/api/v1/chatbots/{chatbotId}/links`
- Auth: HTTP bearer

Unified endpoint to add content to a chatbot. Supports multiple source types:
- **URLS_LIST**: Add a list of URLs directly
- **WEBSITE**: Crawl a website with configurable depth and filters
- **SITEMAP**: Extract URLs from an XML sitemap
- **YOUTUBE**: Add YouTube video or channel transcripts

This endpoint provides full control over crawling behavior, scraping options, and auto-sync configuration.

## Request body

- union
  - object: Add URLs from a list
    - `sourceType` 'URLS_LIST', required
    - `config` object, required
      - `urls` string[], required: List of URLs to add (max 1000)
    - `scrapeOptions` ScrapeOptions: Options for web scraping
      - `onlyMainContent` boolean: When enabled, only the main content of the page is extracted, excluding headers, footers, sidebars, and navigation elements
      - `includeSelectors` string[]: CSS selectors to include when scraping (e.g., "main", ".content")
      - `excludeSelectors` string[]: CSS selectors to exclude when scraping (e.g., "footer", ".sidebar")
      - `headers` object: Custom HTTP headers to use when fetching pages (e.g., {"Authorization": "Bearer token"})
    - `syncFrequency` 'NEVER' | 'DAILY' | 'WEEKLY' | 'MONTHLY': Frequency for automatic content re-sync (requires feature flag)
  - object: Crawl a website
    - `sourceType` 'WEBSITE', required
    - `config` object, required
      - `url` string, uri, required: Starting URL for the website crawl
      - `recursionDepth` integer: How many levels deep to crawl (1-5)
      - `maxLinks` integer, required: Maximum number of pages to scrape
      - `includePaths` string[]: Only include URLs matching these path patterns
      - `excludePaths` string[]: Exclude URLs matching these path patterns
      - `allowedDomains` string[]: Allow crawling these additional domains
    - `scrapeOptions` ScrapeOptions: Options for web scraping
      - `onlyMainContent` boolean: When enabled, only the main content of the page is extracted, excluding headers, footers, sidebars, and navigation elements
      - `includeSelectors` string[]: CSS selectors to include when scraping (e.g., "main", ".content")
      - `excludeSelectors` string[]: CSS selectors to exclude when scraping (e.g., "footer", ".sidebar")
      - `headers` object: Custom HTTP headers to use when fetching pages (e.g., {"Authorization": "Bearer token"})
    - `syncFrequency` 'NEVER' | 'DAILY' | 'WEEKLY' | 'MONTHLY': Frequency for automatic content re-sync (requires feature flag)
  - object: Extract URLs from a sitemap
    - `sourceType` 'SITEMAP', required
    - `config` object, required
      - `url` string, uri, required: URL of the XML sitemap
      - `maxLinks` integer, required: Maximum number of URLs to extract from sitemap
      - `includePaths` string[]: Only include URLs matching these path patterns
      - `excludePaths` string[]: Exclude URLs matching these path patterns
    - `scrapeOptions` ScrapeOptions: Options for web scraping
      - `onlyMainContent` boolean: When enabled, only the main content of the page is extracted, excluding headers, footers, sidebars, and navigation elements
      - `includeSelectors` string[]: CSS selectors to include when scraping (e.g., "main", ".content")
      - `excludeSelectors` string[]: CSS selectors to exclude when scraping (e.g., "footer", ".sidebar")
      - `headers` object: Custom HTTP headers to use when fetching pages (e.g., {"Authorization": "Bearer token"})
    - `syncFrequency` 'NEVER' | 'DAILY' | 'WEEKLY' | 'MONTHLY': Frequency for automatic content re-sync (requires feature flag)
    - `scanFrequency` 'NEVER' | 'DAILY' | 'WEEKLY' | 'MONTHLY': Frequency for automatic content re-sync (requires feature flag)
  - object: Add YouTube video or channel
    - `sourceType` 'YOUTUBE', required
    - `config` object, required
      - `url` string, uri, required: YouTube video or channel URL
    - `syncFrequency` 'NEVER' | 'DAILY' | 'WEEKLY' | 'MONTHLY': Frequency for automatic content re-sync (requires feature flag)

## Response `200`

OK - Content added successfully

- object
  - `success` boolean
  - `message` string
  - `data` object
    - `ingestJobId` string: ID of the ingestion job created
    - `documentsQueued` integer: Number of documents queued for processing

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `429`: Too Many Requests - Quota Exceeded
- `500`: Internal Server Error

---

[API](https://skmtc.dev/sitegpt/apis/sitegpt-api-collection.md) · [All operations](https://skmtc.dev/sitegpt/apis/sitegpt-api-collection/llms.txt) · [OpenAPI document](https://skmtc.dev/sitegpt/apis/sitegpt-api-collection/revisions/aec0de1a00af?raw)
