Upload Document Contents

POST

Request

This endpoint expects an object.
documentNamestringRequired

The name of the document you want to upload.

documentContentsstringRequired

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

allowedUsersEmailAddresseslist of stringsRequired

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.

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.

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.

documentExternalUrlstringOptional

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

customMetadataanyOptional

Optional JSON representing any custom metdata for this document

collectionIdstringOptional

If specified, document will also be added to a particular document collection

forceUpdatebooleanOptional

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

internalPublicbooleanOptional

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

Response

This endpoint returns an object.
documentIdUUID