Document Catalog

Upload Document Contents

POST

Request

This endpoint expects an object.
documentName
stringRequired

/ The name of the document you want to upload.

documentContents
stringRequired

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

allowedUsersEmailAddresses
list 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.

documentExternalId
stringRequired

/ 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.

documentExternalUrl
stringOptional

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

customMetadata
anyOptional

/ Optional JSON representing any custom metdata for this document

collectionId
stringOptional

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

forceUpdate
booleanOptional

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

internalPublic
booleanOptional

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

Response

This endpoint returns an object
documentId
UUID
POST
$curl -X POST https://api.credal.ai/api/v0/catalog/uploadDocumentContents \
> -H "Authorization: Bearer <apiKey>" \
> -H "Content-Type: application/json" \
> -d '{
> "documentName": "My Document",
> "documentContents": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
> "allowedUsersEmailAddresses": [
> "jack@credal.ai",
> "ravin@credal.ai"
> ],
> "documentExternalId": "73eead26-d124-4940-b329-5f068a0a8db9"
>}'
Response
1{
2 "documentId": "82e4b12a-6990-45d4-8ebd-85c00e030c24"
3}