v1

latestOpenAPI 3.0.22026-07-174617345.8 KB
Sources

Create a new agent source.

Create a new data source for a given agent (formerly known as project), allowing you to add additional context by specifying a sitemap URL or uploading a file. This endpoint enables you to enrich the agent's information by incorporating relevant data sources. Here is an example to add a new source to agent: API SDK.

post/api/v1/projects/{projectId}/sources

Path parameters

projectIdinteger required

The unique identifier of the agent (formerly known as project).

Response

Successfully created a new agent source.

status'error' | 'success'

The status of the response

Example response

{
  "status": "success",
  "data": {
    "id": 1,
    "created_at": "2021-01-01 00:00:00",
    "updated_at": "2021-01-01 00:00:00",
    "type": "sitemap",
    "settings": {
      "executive_js": true,
      "data_refresh_frequency": "never",
      "create_new_pages": true,
      "refresh_existing_pages": "never",
      "sitemap_path": "https://example.com/sitemap.xml"
    },
    "pages": [
      {
        "id": 1,
        "page_url": "https://example.com",
        "page_url_hash": "d41d8cd98f00b204e9800998ecf8427e",
        "project_id": 1,
        "s3_path": "project-1/page-1/file.pdf",
        "crawl_status": "queued",
        "index_status": "queued",
        "is_file": true,
        "is_refreshable": true,
        "is_file_kept": true,
        "filename": "file.pdf",
        "filesize": 100,
        "created_at": "2021-01-01 00:00:00",
        "updated_at": "2021-01-01 00:00:00",
        "deleted_at": "2021-01-01 00:00:00"
      }
    ]
  }
}