POST
/
data-sources
Index a new data source
curl --request POST \
  --url https://apigcp.trynia.ai/v2/data-sources \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "url": "https://docs.example.com",
  "url_patterns": [
    "https://docs.example.com/api/*",
    "https://docs.example.com/guides/*"
  ],
  "exclude_patterns": [
    "/blog/*",
    "/changelog/*"
  ],
  "project_id": "<string>",
  "max_age": 123,
  "formats": [
    "markdown",
    "html"
  ],
  "only_main_content": true,
  "limit": 10000,
  "max_depth": 20,
  "crawl_entire_domain": true,
  "wait_for": 2000,
  "include_screenshot": true,
  "check_llms_txt": true,
  "llms_txt_strategy": "prefer"
}'
{
  "id": "<string>",
  "url": "<string>",
  "file_name": "<string>",
  "directory_path": "<string>",
  "status": "pending",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "page_count": 0,
  "chunk_count": 0,
  "project_id": "<string>",
  "source_type": "web",
  "is_active": true,
  "display_name": "<string>",
  "error": "<string>",
  "error_code": "<string>"
}

Authorizations

Authorization
string
header
required

API key must be provided in the Authorization header

Body

application/json

Response

200
application/json

Data source indexing started successfully

The response is of type object.