POST
/
api
/
corpora
/
{corpus_id}
/
sources
cURL
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<uuid>
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<date-time>

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. The current stats for a source.

loadSpec
object

DEPRECATED. Prefer setting crawl instead. If either crawl or upload is set, this field will be ignored. The specification of how to acquire documents for this source.

crawl
object

Allows loading documents by crawling the web. The specification of how to acquire documents for this source.

upload
object

Allows loading from a uploaded document. The specification of how to acquire documents for uploaded documents source.

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<date-time>

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. The current stats for a source.

loadSpec
object

DEPRECATED. Prefer setting crawl instead. If either crawl or upload is set, this field will be ignored. The specification of how to acquire documents for this source.

crawl
object

Allows loading documents by crawling the web. The specification of how to acquire documents for this source.

upload
object

Allows loading from a uploaded document. The specification of how to acquire documents for uploaded documents source.