Skip to main content
Credal | Documentation
current

Search documentation

Type to search this documentation.

Upload Document Contents

POST/v0/catalog/uploadDocumentContentsUpload Document Contents

Request body

application/json
object
allowedUsersEmailAddressesarray of stringrequired

Users allowed to access the document. Unlike Credal's out of the box connectors which reconcile various permissions models from 3rd party software, for custom uploads the caller is responsible for specifying who can access the document and currently flattening groups if applicable. Documents can also be marked as internal public.

Show child attributes
awaitVectorStoreSyncboolean

Document uploads are eventually consistent by default. If specified `true` the API will wait for the vector store to be updated before returning. This is useful if you want to ensure that the document is immediately searchable after this call returns.

collectionIdstring

If specified, the document will also be added to the provided document collection. This operation is eventually consistent, meaning the document does not immediately start appearing in searches of that collection due to an asynchronous embedding process. To achieve strong consistency use the `awaitVectorStoreSync` parameter.

customMetadataobject

Optional JSON representing any custom metadata for this document

documentContentsstringrequired

The full LLM-formatted text contents of the document you want to upload.

documentExternalIdstringrequired

The external ID of the document. This is typically the ID as it exists in its original external system. Uploads to the same external ID will update the document in Credal.

documentExternalUrlstring

The external URL of the document you want to upload. If provided Credal will link to this URL.

documentNamestringrequired

The name of the document you want to upload.

forceUpdateboolean

If specified, document contents will be re-uploaded and re-embedded even if the document already exists in Credal

internalPublicboolean

If specified, document will be accessible to everyone within the organization of the uploader

uploadAsUserEmailstringrequired

[Legacy] The user on behalf of whom the document should be uploaded. In most cases, this can simply be the email of the developer making the API call. This field will be removed in the future in favor of purely specifying permissions via allowedUsersEmailAddresses.

Example request
{
  "allowedUsersEmailAddresses": [
    "string"
  ],
  "awaitVectorStoreSync": true,
  "collectionId": "string",
  "customMetadata": {
    "additionalProp1": "string"
  },
  "documentContents": "string",
  "documentExternalId": "string",
  "documentExternalUrl": "string",
  "documentName": "string",
  "forceUpdate": true,
  "internalPublic": true,
  "uploadAsUserEmail": "string"
}

Responses

200Response with status 200application/json
objectdocumentCatalog_UploadDocumentResponse

UploadDocumentResponse

documentIdstring · uuidrequired
Example response
{
  "documentId": "00000000-0000-0000-0000-000000000000"
}
Documentation menu