POST
/
api
/
corpora
/
{corpus_id}
/
sources
curl --request POST \
  --url https://api.ultravox.ai/api/corpora/{corpus_id}/sources \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '{
  "corpusId": "<string>",
  "sourceId": "<string>",
  "created": "2023-11-07T05:31:56Z",
  "name": "<string>",
  "description": "<string>",
  "stats": {
    "status": "SOURCE_STATUS_UNSPECIFIED",
    "lastUpdated": "2023-11-07T05:31:56Z",
    "numDocs": 123
  },
  "loadSpec": {
    "maxDocuments": 123,
    "maxDocumentBytes": 123,
    "relevantDocumentTypes": {
      "include": {
        "mimeTypes": [
          "<string>"
        ]
      },
      "exclude": {
        "mimeTypes": [
          "<string>"
        ]
      }
    },
    "startUrls": [
      "<string>"
    ],
    "maxDepth": 123
  },
  "crawl": {
    "maxDocuments": 123,
    "maxDocumentBytes": 123,
    "relevantDocumentTypes": {
      "include": {
        "mimeTypes": [
          "<string>"
        ]
      },
      "exclude": {
        "mimeTypes": [
          "<string>"
        ]
      }
    },
    "startUrls": [
      "<string>"
    ],
    "maxDepth": 123
  },
  "upload": {
    "documentIds": [
      "<string>"
    ]
  }
}'
{
  "corpusId": "<string>",
  "sourceId": "<string>",
  "created": "2023-11-07T05:31:56Z",
  "name": "<string>",
  "description": "<string>",
  "stats": {
    "status": "SOURCE_STATUS_UNSPECIFIED",
    "lastUpdated": "2023-11-07T05:31:56Z",
    "numDocs": 123
  },
  "loadSpec": {
    "maxDocuments": 123,
    "maxDocumentBytes": 123,
    "relevantDocumentTypes": {
      "include": {
        "mimeTypes": [
          "<string>"
        ]
      },
      "exclude": {
        "mimeTypes": [
          "<string>"
        ]
      }
    },
    "startUrls": [
      "<string>"
    ],
    "maxDepth": 123
  },
  "crawl": {
    "maxDocuments": 123,
    "maxDocumentBytes": 123,
    "relevantDocumentTypes": {
      "include": {
        "mimeTypes": [
          "<string>"
        ]
      },
      "exclude": {
        "mimeTypes": [
          "<string>"
        ]
      }
    },
    "startUrls": [
      "<string>"
    ],
    "maxDepth": 123
  },
  "upload": {
    "documentIds": [
      "<string>"
    ]
  }
}

Authorizations

X-API-Key
string
header
required

API key

Path Parameters

corpus_id
string
required

Body

application/json

A source of documents for building a corpus. A source defines where documents are pulled from.

corpusId
string

The id of this source's corpus.

sourceId
string

The unique ID of this source.

created
string

When this source was created.

name
string

The name of this source.

description
string

A description of this source.

stats
object

The current stats for this source.

loadSpec
object

DEPRECATED. Prefer setting crawl instead. If either crawl or upload is set, this field will be ignored.

crawl
object

Allows loading documents by crawling the web.

upload
object

Allows loading from a uploaded document.

Response

201 - application/json

A source of documents for building a corpus. A source defines where documents are pulled from.

corpusId
string

The id of this source's corpus.

sourceId
string

The unique ID of this source.

created
string

When this source was created.

name
string

The name of this source.

description
string

A description of this source.

stats
object

The current stats for this source.

loadSpec
object

DEPRECATED. Prefer setting crawl instead. If either crawl or upload is set, this field will be ignored.

crawl
object

Allows loading documents by crawling the web.

upload
object

Allows loading from a uploaded document.