Skip to main content
POST
/
knowledge-base
/
sources
curl --request POST \
  --url https://api.anyreach.ai/knowledge-base/sources \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
[
  {
    "name": "https://docs.example.com/getting-started",
    "type": "URL",
    "chunking_strategy": {
      "method": "structure_based"
    }
  }
]
'
[
  {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "organization_id": "<string>",
    "name": "<string>",
    "domain": "<string>",
    "chunking_strategy": {
      "chunk_size": 1000
    },
    "file_size": 123,
    "description": "<string>",
    "created_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z",
    "presigned_url": "<string>",
    "content_type": "<string>"
  }
]

Authorizations

Authorization
string
header
required

Personal access token. See Authentication.

Body

application/json
name
string
required

File name (e.g. faq.md) for FILE, or a valid URL for URL.

type
enum<string>
required

Whether the source is an uploaded file or a crawled URL.

Available options:
FILE,
URL
chunking_strategy
object
required

How the source's content is split into chunks before embedding.

id
string<uuid>

Optional client-supplied ID. Generated if omitted.

domain
string

Domain, for URL sources.

file_size
integer

Size in bytes, for file sources.

Response

The created sources. File sources include an upload URL.

id
string<uuid>

Unique source ID.

organization_id
string
type
enum<string>

Whether the source is an uploaded file or a crawled URL.

Available options:
FILE,
URL
name
string

File name (FILE) or URL (URL).

domain
string | null

Domain, for URL sources.

file_upload_status
enum<string>

Upload/ingestion status of the source's content.

Available options:
PENDING,
IN_PROGRESS,
COMPLETE,
FAILED
chunking_strategy
object

How the source's content is split into chunks before embedding.

file_size
integer | null

Size in bytes, for file sources.

description
string | null
created_at
string<date-time>
updated_at
string<date-time>
presigned_url
string | null

For file sources: upload the file bytes here, then mark the source COMPLETE.

content_type
string | null

The MIME type to use when uploading to presigned_url.