Newer Version Available

This content describes an older version of this product. View Latest

List Libraries or Create a Library

Return (GET) all AI grounding libraries available to the current user, or create (POST) a new AI Grounding Library.

Resource

1/einstein/data-libraries

HTTP Methods

GET, POST

GET

Get grounding libraries.

Request parameters for GET

Optional filtering by grounding source type is supported.

Parameter Type / Values Description Required Available Version
sourceType SFDRIVE, KNOWLEDGE, RETRIEVER Filter the list by grounding source type. If omitted, all libraries are returned. No 66.0
Request body

None.

Response body

HTTP 200 — LibraryListOutputRepresentation

Property Type Description Available Version
libraries array List of LibraryOutputRepresentation summaries. 66.0
totalSize integer Total number of libraries. 66.0

HTTP 403—Insufficient permissions. No response body.

POST

Creates an AI Grounding Library. The source type is inferred from groundingSource (discriminator sourceType, or from populated fields).

Currently supported: Only SFDRIVE (file-based library) is supported. KNOWLEDGE and RETRIEVER source types are not supported and return 400 with ADL_UNSUPPORTED_SOURCE_TYPE.

For SFDRIVE, after creation:

  1. Poll /einstein/data-libraries/{libraryId}/upload-readiness until ready=true (the Unified Data Lake Object must be ACTIVE before upload)
  2. PUT files to the presigned URLs
  3. POST to /einstein/data-libraries/{libraryId}/indexing with uploaded file paths and sizes.
Request body

Required. CreateLibraryInputRepresentation

Property Type Description Required Available Version
masterLabel string Master label (max 80). Yes 66.0
developerName string Unique developer name (max 80; pattern ^[a-zA-Z][a-zA-Z0-9_]*$). Yes 66.0
description string Description (max 255). No 66.0
dataSpaceScopeId string DataSpaceScope ID; defaults to the org’s default dataspace if omitted. Only the default dataspace is supported. Providing a non-default dataspace ID returns 400 with ADL_NON_DEFAULT_DATASPACE_NOT_SUPPORTED. No 66.0
groundingSource object GroundingSourceInputRepresentation — infers SFDRIVE / KNOWLEDGE / RETRIEVER. No 66.0

GroundingSourceInputRepresentation (polymorphic; sourceType optional, can be inferred):

Property Type Description Available Version
sourceType string SFDRIVE, KNOWLEDGE, or RETRIEVER. 66.0
knowledgeConfig object For KNOWLEDGE: KnowledgeConfigInputRepresentation (primaryIndexField1 required; optional primaryIndexField2, contentFields, isRestrictToPublicArticle, isDataCategoryRuleEnabled, dataCategorySelectionIds). 66.0
retrieverId string For RETRIEVER: existing retriever ID. 66.0
Response body

HTTP 201 — LibraryOutputRepresentation

HTTP 400 — Invalid input.

HTTP 403 — Insufficient permissions.