Get, Update, or Delete a Library

Retrieve (GET), update (PATCH), or delete (DELETE) data library.

Resource

1/einstein/data-libraries/libraryId

The libraryId is the 18 character library ID that has a prefix of 1JD.

HTTP Methods

GET, PATCH, DELETE

GET

Returns full details for one library: source type, dataspace scope, and groundingSource with type-specific details.

Request body

None.

Response body

HTTP 200 — LibraryOutputRepresentation

HTTP 404—Library not found.

PATCH

Updates an existing AI Grounding Library with PATCH semantics. All fields are optional; only set fields are updated.

Supported operations by source type:

  • SFDRIVE: update masterLabel, description (metadata only, no re-provisioning).
  • RETRIEVER: update masterLabel, description, or retrieverId (switch to a different retriever).
  • KNOWLEDGE: update masterLabel, description, or knowledge configuration fields (contentFields, isRestrictToPublicArticle, isDataCategoryRuleEnabled, dataCategorySelectionIds, dataCategorySelectionNames). primaryIndexField1 and primaryIndexField2 are immutable after creation.
  • SITEMAP: update masterLabel, description (metadata only, grounding source changes rejected).

Validation rules:

  • Attempting to change sourceType returns 400 with ADL_MISMATCH_SOURCE_TYPE.
  • Attempting to update primary index fields on KNOWLEDGE returns 400 with ADL_PRIMARY_FIELDS_IMMUTABLE.
  • Concurrent updates are blocked for KNOWLEDGE libraries during provisioning (returns 400 with ADL_UPDATE_IN_PROGRESS).

Returns updated library details with the same response shape as GET.

Request body

Required. UpdateLibraryInputRepresentation

Property Type Description Available Version
masterLabel string Updated master label (max 80). 66.0
description string Updated description (max 255). 66.0
groundingSource object GroundingSourceInputRepresentation. 66.0
Response body

HTTP 200 — LibraryOutputRepresentation

HTTP 400—Invalid request.

HTTP 404—Library not found.

DELETE

Deletes the library and associated entities (cascade): FileRefs, KnowledgeConfig, LibSrcRel, SourceStages, GroundingSource, Retriever, SearchIndex.

You can’t delete if the library is in use by an agent (400).

Request body

None.

Response body

HTTP 204—Library deleted; no content body.

HTTP 400—Library can’t be deleted because it is in use by agents.

HTTP 404—Library not found.