---
schema_version: "1"
id: 56495dd40afc58531ac42fb508ae0977ffec9d66e94bdc95044494e4f0b4642f
title: Agentforce Connect REST API
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/connect-rest/connect-rest-api/references/generated-api-specs/connect-rest-api-agentforce.md
canonical_url: https://developer.salesforce.com/docs/platform/connect-rest-api/references/connect-rest-api-agentforce
source_site: developer.salesforce.com
content_type: documentation
content_hash: f50b2e2590caf4de5c4843f746747874c8f679f006e39d21901c5fe8da803d52
products:
  - Connect REST API Developer Guide
  - Connect REST APIs
---
Agentforce Connect REST API

# Agentforce Connect REST API

> **Note**: The API Reference has a new three-panel layout. Browse grouped endpoints on the left, review endpoint details in the center, and access examples on the right.

**Important**: Where possible, we changed noninclusive terms to align with our company value of Equality. We maintained certain terms to avoid any effect on customer implementations.

**Version:** v67.0

## Servers

*   `https://{MyDomainName}.my.salesforce.com/services/data/v67.0` API server for your Salesforce org.
    *   ``MyDomainName (default None) Your org's My Domain name, which is used as a subdomain for the URLs that Salesforce uses to serve your org. For example, if your Lightning URL is `https://yourcompanyname.lightning.force.com`, then your My Domain name is `yourcompanyname`. Find your My Domain name and login URL on the My Domain page in Setup, or use the `getMyDomainName()` method in the Apex Domain class.``

## Tags

### Agentforce Data Libraries Resources

Agentforce Data Libraries enhance the accuracy of AI features like Agentforce Agents by connecting them to your trusted data sources. Data libraries use unstructured or semi-structured data so that they can take large sets of information that exist on the web, in documents, or as large text inputs in fields, and turn that into more useful, searchable information.

### Prompt Templates Resources

Get prompt template data and generate LLM responses using prompt templates.

## Operations

### GET List Libraries

`GET /einstein/data-libraries`

Operation ID: `listLibraries`. Tags: Agentforce Data Libraries Resources.

AI Grounding Library collection endpoint (GET list, POST create)

Get grounding libraries.

**Note:** Optional filtering by grounding source type is supported.

#### Parameters

*   `sourceType` (query, string)
    
    Filter the list by grounding source type. If omitted, all libraries are returned.
    
    _Available in: v66.0_
    

#### Responses

*   **200** _Library List Output Representation_ List of libraries
    
    Media type: `application/json`. Schema: `LibraryListOutput`.
    
*   **403** Insufficient permissions

### POST Create a Library

`POST /einstein/data-libraries`

Operation ID: `createLibrary`. Tags: Agentforce Data Libraries Resources.

AI Grounding Library collection endpoint (GET list, POST create)

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

*   `SFDRIVE` — File-based library. After creation, use the file upload workflow.
*   `KNOWLEDGE` — Knowledge article library. Specify `knowledgeConfig` with required fields.
*   `RETRIEVER` — Connect to an existing custom retriever by providing `retrieverId`. The retriever must be active; inactive retrievers are rejected with `ADL_RETRIEVER_NOT_ACTIVE`, and retrievers that can't be located are rejected with `ADL_RETRIEVER_NOT_FOUND`.

For SFDRIVE, after creation:

*   Poll `/einstein/data-libraries/{libraryId}/upload-readiness` until `ready=true` (the Unified Data Lake Object must be ACTIVE before upload)
*   POST to `/einstein/data-libraries/{libraryId}/file-upload-urls` with file names to get presigned S3 upload URLs
*   PUT files to the presigned URLs
*   POST to `/einstein/data-libraries/{libraryId}/indexing` with uploaded file paths and sizes.

For KNOWLEDGE, provisioning starts automatically after creation. Poll `/status` to track progress. For RETRIEVER, the library is immediately usable after creation (no upload workflow required).

#### Request body (required)

Media type: `application/json`. Schema: `CreateLibraryInput`.

#### Responses

*   **201** Library created successfully
    
    Media type: `application/json`. Schema: `LibraryOutput`.
    
*   **400**
    
    Invalid input. Error codes include but are not limited to:
    
    *   `ADL_MISSING_REQUIRED_FIELD` — a required field (e.g. `retrieverId`) is missing or blank
    *   `ADL_UNSUPPORTED_SOURCE_TYPE` — the supplied `sourceType` is not supported
    *   `ADL_INVALID_SOURCE_TYPE` — `groundingSource` is missing or its discriminator is invalid
    *   `ADL_RETRIEVER_NOT_ACTIVE` — for `RETRIEVER` source type, the referenced retriever has no active configuration
    *   `ADL_RETRIEVER_NOT_FOUND` — for `RETRIEVER` source type, the referenced retriever could not be located
    *   `ADL_INVALID_DEVELOPER_NAME` / `ADL_INVALID_MASTER_LABEL` — name or label fails validation
*   **403** Insufficient permissions

### GET Get a Library

`GET /einstein/data-libraries/{libraryId}`

Operation ID: `getLibrary`. Tags: Agentforce Data Libraries Resources.

Single AI Grounding Library endpoint (GET detail, PATCH update, DELETE remove)

Returns the type-specific details for one library.

#### Parameters

*   `libraryId` (path, string, required) AI Grounding Library ID (18-char Salesforce ID, key prefix 1JD)  
    Pattern: ^\[a-zA-Z0-9\]{18}$.

#### Responses

*   **200** _Library Output Representation_
    
    A representation of an Agentforce data library.
    
    Here are the properties.
    
    Media type: `application/json`. Schema: `LibraryOutput`.
    
*   **404** Library not found

### DELETE Delete a Library

`DELETE /einstein/data-libraries/{libraryId}`

Operation ID: `deleteLibrary`. Tags: Agentforce Data Libraries Resources.

Single AI Grounding Library endpoint (GET detail, PATCH update, DELETE remove)

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

#### Parameters

*   `libraryId` (path, string, required) AI Grounding Library ID (18-char Salesforce ID, key prefix 1JD)  
    Pattern: ^\[a-zA-Z0-9\]{18}$.

#### Responses

*   **204** Library deleted successfully
*   **400** Cannot delete — library is in use by agents
*   **404** Library not found

### PATCH Update a Library

`PATCH /einstein/data-libraries/{libraryId}`

Operation ID: `updateLibrary`. Tags: Agentforce Data Libraries Resources.

Single AI Grounding Library endpoint (GET detail, PATCH update, DELETE remove)

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.

#### Parameters

*   `libraryId` (path, string, required) AI Grounding Library ID (18-char Salesforce ID, key prefix 1JD)  
    Pattern: ^\[a-zA-Z0-9\]{18}$.

#### Request body (required)

Media type: `application/json`. Schema: `UpdateLibraryInput`.

#### Responses

*   **200** _Library Output Representation_
    
    A representation of an Agentforce data library.
    
    Here are the properties.
    
    Media type: `application/json`. Schema: `LibraryOutput`.
    
*   **400** Invalid request
*   **404** Library not found

### POST Generate URLs for Uploading Files

`POST /einstein/data-libraries/{libraryId}/file-upload-urls`

Operation ID: `generateFileUploadUrls`. Tags: Agentforce Data Libraries Resources.

Generate presigned URLs for file uploads to an existing SFDRIVE library

Generates presigned S3 URLs for uploading files to an existing SFDRIVE library.

#### Parameters

*   `libraryId` (path, string, required) AI Grounding Library ID (18-char Salesforce ID, key prefix 1JD)  
    Pattern: ^\[a-zA-Z0-9\]{18}$.

#### Request body (required)

Media type: `application/json`. Schema: `FileUploadUrlsInput`.

#### Responses

*   **200** _File Upload Urls Collection Output Representation_ Presigned URLs generated
    
    Media type: `application/json`. Schema: `FileUploadUrlsCollectionOutput`.
    
*   **400** Invalid request (e.g., not a SFDRIVE library, or UDLO not yet active)
*   **404** Library not found

### GET List Files in a Library

`GET /einstein/data-libraries/{libraryId}/files`

Operation ID: `listFiles`. Tags: Agentforce Data Libraries Resources.

Add files to existing SFDRIVE library

Returns a paginated list of file references for an SFDRIVE library. Includes per-file status for indexing visibility.

#### Parameters

*   `libraryId` (path, string, required) AI Grounding Library ID (18-char Salesforce ID, key prefix 1JD)  
    Pattern: ^\[a-zA-Z0-9\]{18}$.
*   `pageSize` (query, string)
    
    Number of files listed per page. Default `50` .
    
    _Available in: v67.0_
    
*   `offset` (query, integer)
    
    Offset into the result set. Default `0` .
    
    _Available in: v67.0_
    
*   `sortBy` (query, string)
    
    Sort field. Default `status` (errors first).
    
    _Available in: v67.0_
    
*   `sortOrder` (query, string)
    
    Sort direction.
    
    _Available in: v67.0_
    
*   `name` (query, string)
    
    Filter by file name (case-insensitive contains match).
    
    _Available in: v67.0_
    
*   `status` (query, string)
    
    Filter by file processing status.
    
    _Available in: v67.0_
    

#### Responses

*   **200** _File List Output Representation_ Paginated file list
    
    Media type: `application/json`. Schema: `FileListOutput`.
    
*   **400** Invalid parameters (pageSize, offset, sortBy, sortOrder)
*   **404** Library not found

### POST Add Files to a Library

`POST /einstein/data-libraries/{libraryId}/files`

Operation ID: `addFiles`. Tags: Agentforce Data Libraries Resources.

Add files to existing SFDRIVE library

Adds files to an existing SFDRIVE library and triggers SearchIndex re-hydration (day-2 incremental adds). At least one uploaded file is required. No duplicate file names in the batch are allowed. The total file count must not exceed 1000. SFDRIVE libraries only. Poll `/status` for progress.

#### Parameters

*   `libraryId` (path, string, required) AI Grounding Library ID (18-char Salesforce ID, key prefix 1JD)  
    Pattern: ^\[a-zA-Z0-9\]{18}$.

#### Request body (required)

Media type: `application/json`. Schema: `AddFilesInput`.

#### Responses

*   **200** _Add Files Output Representation_ Files accepted for addition
    
    Media type: `application/json`. Schema: `AddFilesOutput`.
    
*   **400** Invalid request (e.g., no files provided, not a SFDRIVE library)
*   **404** Library not found

### DELETE Delete a File from a Library

`DELETE /einstein/data-libraries/{libraryId}/files/{fileId}`

Operation ID: `deleteFile`. Tags: Agentforce Data Libraries Resources.

Delete a single file from an SFDRIVE library

Deletes a single file from an SFDRIVE library. Performs synchronous deletion of the file from S3 and removes the AiGroundingFileRef record.

**Note**: SFDRIVE libraries only. Attempting to call this endpoint on a non-SFDRIVE library returns 400 with `ADL_UNSUPPORTED_SOURCE_TYPE`.

#### Parameters

*   `libraryId` (path, string, required) AI Grounding Library ID (18-char Salesforce ID, key prefix 1JD)  
    Pattern: ^\[a-zA-Z0-9\]{18}$.
*   `fileId` (path, string, required) is the 18 character AiGroundingFileRef record ID.  
    Pattern: ^\[a-zA-Z0-9\]{18}$.

#### Responses

*   **204** File deleted successfully
*   **404** Library or file not found

### POST Index Library

`POST /einstein/data-libraries/{libraryId}/indexing`

Operation ID: `provisionPipeline`. Tags: Agentforce Data Libraries Resources.

Start async indexing of Data Cloud resources

Starts asynchronous indexing of Data Cloud resources (DLO, DMO, SearchIndex, Retriever).

**Note**: You can provision SFDRIVE libraries only with this endpoint. RETRIEVER libraries don’t need indexing. Attempting to provision a KNOWLEDGE or RETRIEVER library returns 400.

*   `SFDRIVE`: `uploadedFiles` must list uploaded files (paths and sizes).
*   The library must be upload-ready before calling this endpoint. Poll `/einstein/data-libraries/{libraryId}/upload-readiness` first.
*   Calling `/einstein/data-libraries/{libraryId}/indexing` before readiness returns 400 with "Library isn’t upload-ready yet."

#### Parameters

*   `libraryId` (path, string, required) AI Grounding Library ID (18-char Salesforce ID, key prefix 1JD)  
    Pattern: ^\[a-zA-Z0-9\]{18}$.

#### Request body (required)

Media type: `application/json`. Schema: `ProvisionInput`.

#### Responses

*   **200** _Provision Output Representation_ Provisioning started (async operation)
    
    Media type: `application/json`. Schema: `ProvisionOutput`.
    
*   **400** Invalid request (e.g., files not uploaded for SFDRIVE)
*   **404** Library not found

### GET Check Library Status

`GET /einstein/data-libraries/{libraryId}/status`

Operation ID: `getStatus`. Tags: Agentforce Data Libraries Resources.

Get library status

Returns current library status derived from the SearchIndex runtime with per-stage detail. Use for polling after provisioning or re-provisioning. Suggested polling interval: 5–30 seconds.

#### Parameters

*   `libraryId` (path, string, required) AI Grounding Library ID (18-char Salesforce ID, key prefix 1JD)  
    Pattern: ^\[a-zA-Z0-9\]{18}$.
*   `includeArtifacts` (query, boolean) When true, resolves Data 360 asset artifacts (DLO, DMO, SearchIndex, Retriever) with entity IDs and developer names on each stage. Requires additional queries. Default: false (stages returned without artifacts for fast polling).  
    Default: `false`.

#### Responses

*   **200** _Library Status Output Representation_ Library status
    
    Media type: `application/json`. Schema: `LibraryStatusOutput`.
    
*   **404** Library not found

### GET Check Upload Readiness

`GET /einstein/data-libraries/{libraryId}/upload-readiness`

Operation ID: `getUploadReadiness`. Tags: Agentforce Data Libraries Resources.

Check if UDLO is ACTIVE and ready for file uploads

Checks whether the UDLO (Unified Data Lake Object) is ACTIVE and ready for file uploads.

SFDRIVE libraries only. Attempting to call this endpoint on a non-SFDRIVE library returns 400 with `ADL_UNSUPPORTED_SOURCE_TYPE`.

With `waitMaxTime=0` (default), performs one check and returns immediately. With `waitMaxTime > 0`, the server polls internally until `ready=true` or the timeout, avoiding tight client polling loops.

#### Parameters

*   `libraryId` (path, string, required) AI Grounding Library ID (18-char Salesforce ID, key prefix 1JD)  
    Pattern: ^\[a-zA-Z0-9\]{18}$.
*   `waitMaxTime` (query, string)
    
    Max milliseconds to wait for UDLO readiness (server-side polling). Default `0` : single immediate check. Range `1` – `120000` for wait behavior. Values `< 0` or `> 120000` produce 400.
    
    _Available in: v66.0_
    

#### Responses

*   **200** _Upload Readiness Output Representation_ Upload readiness status
    
    Media type: `application/json`. Schema: `UploadReadinessOutput`.
    
*   **400** Invalid waitMaxTime value
*   **404** Library not found

### GET Get Prompt Templates

`GET /einstein/prompt-templates`

Operation ID: `getEinsteinPromptTemplateCollection`. Tags: Prompt Templates Resources.

Returns a list of prompt templates available based on the fields such as type and related object, filter, limit, pageLimit

Get a list of prompt templates based on specified filters.

_Available in: v62.0_

#### Parameters

*   `fields` (query, array of string)
    
    Comma-separated list of prompt template record fields to return, such as `createdDate` . If unspecified, all fields are returned.
    
    _Available in: v62.0_
    
*   `isActive` (query, boolean)
    
    Specifies whether to return active prompt templates only. The default is `false` .
    
    _Available in: v62.0_
    
*   `offset` (query, integer)
    
    Used for pagination. Number of rows to skip between returned prompt template records. The default value is `0` .
    
    _Available in: v62.0_
    
*   `pageLimit` (query, integer)
    
    Used for pagination. Maximum number of prompt template records returned per page. The default value is `50` .
    
    _Available in: v62.0_
    
*   `query` (query, string)
    
    User-entered search string. If unspecified, all prompt template records are returned.
    
    _Available in: v62.0_
    
*   `relatedEntity` (query, string)
    
    Related entity to filter records by, such as `Contact` . If unspecified, all records with all related entities are returned.
    
    _Available in: v62.0_
    
*   `sortBy` (query, string)
    
    Field to sort order the returned prompt template records by, such as `createdDate` . If unspecified, records are returned in the order they’re retrieved.
    
    _Available in: v62.0_
    
*   `type` (query, string)
    
    Prompt template type to filter records by, such as `einstein_gpt__salesEmail` . If unspecified, records of all types are returned.
    
    _Available in: v62.0_
    

#### Responses

*   **200** _Einstein Prompt Record Collection_ List of prompt template records.
    
    Media type: `application/json`. Schema: `EinsteinPromptRecordCollectionOutput`.
    

### POST Create Prompt Templates

`POST /einstein/prompt-templates`

Operation ID: `postEinsteinPromptTemplateCollection`. Tags: Prompt Templates Resources.

Returns a list of prompt templates available based on the fields such as type and related object, filter, limit, pageLimit

Create prompt templates based on the input data.

_Available in: v62.0_

#### Request body (required)

Input representation for creating a prompt template.

_Available in: v65.0_

Media type: `application/json`. Schema: `object`.

*   `templateInput` (_object_, required)
    
    EinsteinPromptRecordInput
    
    Representation of the payload of the template to be created.
    
    Includes all fields of `EinsteinPromptRecordInput`.
    

#### Responses

*   **200** _Einstein Prompt Template Representation_ Comprehensive representation for prompt template operations including creation, updates, and activation
    
    Media type: `application/json`. Schema: `EinsteinPromptTemplate`.
    

### POST Einstein Prompt Template Generations

`POST /einstein/prompt-templates/{promptTemplateDevName}/generations`

Operation ID: `postEinsteinPromptTemplateGenerations`. Tags: Prompt Templates Resources.

Generates a response based on the provided prompt template and parameters

Generates a response based on the specified prompt template and input parameters.

_Available in: v60.0_

#### Parameters

*   `promptTemplateDevName` (path, string, required) Developer name of the prompt template.
*   `versionId` (query, string)

#### Request body

Prompt template input parameters and LLM provider to use for generation.

Media type: `application/json`. Schema: `EinsteinPromptTemplateGenerationsInput`.

_Example: example\_1_ Payload 1

```
{
  "isPreview": false,
  "inputParams": {
    "valueMap": {
      "Input:String1": {
        "value": "Value of String1"
      },
      "Input:String2": {
        "value": "Value of String2"
      },
      "Input:Account": {
        "value": {
          "id": "001SB000004nerfYAA"
        }
      }
    }
  },
  "additionalConfig": {
    "applicationName": "PromptTemplateGenerationsInvocable"
  }
}
```

#### Responses

*   **200** _Einstein Prompt Template Generations_ Generated response from the specified LLM provider and resolved prompt template text.
    
    Media type: `application/json`. Schema: `EinsteinPromptTemplateGenerations`.
    

### GET Prompt Template Versions

`GET /einstein/prompt-templates/{promptTemplateDevName}/versions`

Operation ID: `getEinsteinPromptTemplateVersion`. Tags: Prompt Templates Resources.

Create a prompt template version

Get a prompt template version.

_Available in: v65.0_

#### Alternate paths

*   `/einstein/prompt-templates/{promptTemplateDevName}/versions/{versionId}` - By Prompt Template Dev Name and Version ID

#### Parameters

*   `promptTemplateDevName` (path, string, required) Developer name of the prompt template.
*   `includingContent` (query, boolean)
    
    If `true` , returns the version content.
    
    _Available in: v65.0_
    
*   `includingVersionDetail` (query, boolean)
    
    If `true` , returns version children details, such as input and data provider.
    
    _Available in: v65.0_
    

#### Responses

*   **200** _Einstein Prompt Template Representation_ Comprehensive representation for prompt template operations including creation, updates, and activation
    
    Media type: `application/json`. Schema: `EinsteinPromptRecord`.
    

### PUT Prompt Template Versions

`PUT /einstein/prompt-templates/{promptTemplateDevName}/versions`

Operation ID: `putEinsteinPromptTemplateVersion`. Tags: Prompt Templates Resources.

Create a prompt template version

Create (POST) and update (PUT) a prompt template version.

_Available in: v65.0_

#### Alternate paths

*   `/einstein/prompt-templates/{promptTemplateDevName}/versions/{versionId}` - By Prompt Template Dev Name and Version ID

#### Parameters

*   `promptTemplateDevName` (path, string, required) Developer name of the prompt template.

#### Request body (required)

Input representation for creating a prompt template.

_Available in: v65.0_

Media type: `application/json`. Schema: `object`.

*   `templateInput` (_object_, required)
    
    EinsteinPromptRecordInput
    
    Representation of the payload of the template to be created.
    
    Includes all fields of `EinsteinPromptRecordInput`.
    

#### Responses

*   **200** _Einstein Prompt Template Representation_ Comprehensive representation for prompt template operations including creation, updates, and activation
    
    Media type: `application/json`. Schema: `EinsteinPromptTemplate`.
    

### POST Prompt Template Versions

`POST /einstein/prompt-templates/{promptTemplateDevName}/versions`

Operation ID: `postEinsteinPromptTemplateVersion`. Tags: Prompt Templates Resources.

Create a prompt template version

Create (POST).

_Available in: v65.0_

#### Alternate paths

*   `/einstein/prompt-templates/{promptTemplateDevName}/versions/{versionId}` - By Prompt Template Dev Name and Version ID

#### Parameters

*   `promptTemplateDevName` (path, string, required) Developer name of the prompt template.

#### Request body (required)

Input representation for creating a prompt template.

_Available in: v65.0_

Media type: `application/json`. Schema: `object`.

*   `templateInput` (_object_, required)
    
    EinsteinPromptRecordInput
    
    Representation of the payload of the template to be created.
    
    Includes all fields of `EinsteinPromptRecordInput`.
    

#### Responses

*   **200** _Einstein Prompt Template Representation_ Comprehensive representation for prompt template operations including creation, updates, and activation
    
    Media type: `application/json`. Schema: `EinsteinPromptTemplate`.
    

### GET Prompt Template Versions (By Prompt Template Dev Name and Version ID)

`GET /einstein/prompt-templates/{promptTemplateDevName}/versions/{versionId}`

Operation ID: `getEinsteinPromptTemplateVersionByPromptTemplateDevNameAndVersionId`. Tags: Prompt Templates Resources.

Create a prompt template version

_Available in: v65.0_

Alternate path for `Prompt Template Versions`. Variant: By Prompt Template Dev Name and Version ID. Canonical documentation path: `/einstein/prompt-templates/{promptTemplateDevName}/versions`.

#### Parameters

*   `promptTemplateDevName` (path, string, required) Developer name of the prompt template.
*   `versionId` (path, string, required) ID of the version.
*   `includingContent` (query, boolean)
    
    If `true` , returns the version content.
    
    _Available in: v65.0_
    
*   `includingVersionDetail` (query, boolean)
    
    If `true` , returns version children details, such as input and data provider.
    
    _Available in: v65.0_
    

#### Responses

*   **200** _Einstein Prompt Template Representation_ Comprehensive representation for prompt template operations including creation, updates, and activation
    
    Media type: `application/json`. Schema: `EinsteinPromptRecord`.
    

### PUT Prompt Template Versions (By Prompt Template Dev Name and Version ID)

`PUT /einstein/prompt-templates/{promptTemplateDevName}/versions/{versionId}`

Operation ID: `putEinsteinPromptTemplateVersionByPromptTemplateDevNameAndVersionId`. Tags: Prompt Templates Resources.

Create a prompt template version

_Available in: v65.0_

Alternate path for `Prompt Template Versions`. Variant: By Prompt Template Dev Name and Version ID. Canonical documentation path: `/einstein/prompt-templates/{promptTemplateDevName}/versions`.

#### Parameters

*   `promptTemplateDevName` (path, string, required) Developer name of the prompt template.
*   `versionId` (path, string, required) ID of the version.

#### Request body

Media type: `application/json`. Schema: `object`.

*   `templateInput` (_object_, required)
    
    EinsteinPromptRecordInput
    
    Representation of the payload of the template to be created.
    
    Includes all fields of `EinsteinPromptRecordInput`.
    

#### Responses

*   **200** _Einstein Prompt Template Representation_ Comprehensive representation for prompt template operations including creation, updates, and activation
    
    Media type: `application/json`. Schema: `EinsteinPromptTemplate`.
    

### POST Prompt Template Versions (By Prompt Template Dev Name and Version ID)

`POST /einstein/prompt-templates/{promptTemplateDevName}/versions/{versionId}`

Operation ID: `postEinsteinPromptTemplateVersionByPromptTemplateDevNameAndVersionId`. Tags: Prompt Templates Resources.

Create a prompt template version

_Available in: v65.0_

Alternate path for `Prompt Template Versions`. Variant: By Prompt Template Dev Name and Version ID. Canonical documentation path: `/einstein/prompt-templates/{promptTemplateDevName}/versions`.

#### Parameters

*   `promptTemplateDevName` (path, string, required) Developer name of the prompt template.
*   `versionId` (path, string, required) ID of the version.

#### Request body

Media type: `application/json`. Schema: `object`.

*   `templateInput` (_object_, required)
    
    EinsteinPromptRecordInput
    
    Representation of the payload of the template to be created.
    
    Includes all fields of `EinsteinPromptRecordInput`.
    

#### Responses

*   **200** _Einstein Prompt Template Representation_ Comprehensive representation for prompt template operations including creation, updates, and activation
    
    Media type: `application/json`. Schema: `EinsteinPromptTemplate`.
    

## Schemas

### LibraryListOutput

Collection of AI Grounding Libraries

*   `libraries` (_array of LibraryOutput_)
    
    List of `LibraryOutputRepresentation` summaries.
    
    _Available in: v66.0_
    
*   `totalSize` (_integer_)
    
    Total number of libraries.
    
    _Available in: v66.0_
    

### CreateLibraryInput

Input for creating an AI Grounding Library. Source type is determined by the groundingSource discriminator (sourceType field): SFDRIVE, KNOWLEDGE, or RETRIEVER.

*   `masterLabel` (_string_, required)
    
    Master label.
    
    _Available in: v66.0_
    
      
    Maximum length: 80. Example: `Product Documentation`.
*   `developerName` (_string_, required)
    
    Unique developer name (pattern `^[a-zA-Z][a-zA-Z0-9_]*$` ).
    
    _Available in: v66.0_
    
      
    Maximum length: 80. Pattern: ^\[a-zA-Z\]\[a-zA-Z0-9\_\]\*$. Example: `Product_Documentation`.
*   `description` (_string_)
    
    Description.
    
    _Available in: v66.0_
    
      
    Maximum length: 255. Example: `Product manuals and guides for RAG grounding`.
*   `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` .
    
    _Available in: v66.0_
    
      
    Example: `9gTSG0000037LPN2A2`.
*   `groundingSource` (_object_)
    
    GroundingSourceInput
    
    `GroundingSourceInputRepresentation` — infers SFDRIVE / KNOWLEDGE / RETRIEVER.
    
    _Available in: v66.0_
    
    Includes all fields of `GroundingSourceInput`.
    

### LibraryOutput

A representation of an Agentforce data library.

Here are the properties.

*   `libraryId` (_string_)
    
    Library ID.
    
    _Available in: v66.0_
    
      
    Example: `1JDSG000007IbWX4A0`.
*   `masterLabel` (_string_)
    
    Master label.
    
    _Available in: v66.0_
    
      
    Example: `Product Documentation`.
*   `developerName` (_string_)
    
    API name for library.
    
    _Available in: v66.0_
    
      
    Example: `Product_Documentation`.
*   `description` (_string_)
    
    Library description.
    
    _Available in: v66.0_
    
*   `sourceType` (_string_) _Available in: v66.0_  
    Allowed values: `SFDRIVE`, `KNOWLEDGE`, `RETRIEVER`, `SITEMAP`.
*   `dataSpaceScopeId` (_string_)
    
    DataSpaceScope ID.
    
    _Available in: v66.0_
    
*   `createdDate` (_string_)
    
    Date the library was created (populated on POST response).
    
    _Available in: v66.0_
    
*   `status` (_object_)
    
    LibraryStatusEnum
    
    Overall status.
    
    _Available in: v66.0_
    
    Includes all fields of `LibraryStatusEnum`.
    
*   `retrieverId` (_string_, deprecated)
    
    Retriever ID (present when applicable).
    
    _Available in: v66.0_
    
*   `retrieverLabel` (_string_, deprecated)
    
    Retriever label (present when applicable).
    
    _Available in: v66.0_
    
*   `retriever` (_object_)
    
    RetrieverDetail
    
    Structured retriever details (v67.0+)
    
    Includes all fields of `RetrieverDetail`.
    
*   `retrieverAction` (_object_)
    
    RetrieverActionDetail
    
    Structured retriever action details (v67.0+)
    
    Includes all fields of `RetrieverActionDetail`.
    
*   `groundingSource` (_object_)
    
    GroundingSourceOutputRepresentation
    
    _Available in: v66.0_
    
    Includes all fields of `GroundingSourceOutput`.
    
*   `fileAdlMode` (_integer_, nullable)
    
    Reserved for internal use
    
    _Available in: v66.0_
    
*   `featureAssignments` (_array of string_)
    
    Features this library is assigned to (for example, `SERVICE_REPLIES` , `EINSTEIN_BOTS` ). Returns an empty array when no assignments are found.
    
    _Available in: v67.0_
    

### UpdateLibraryInput

Input for updating an AI Grounding Library (PATCH semantics). All fields are optional — only set fields are updated.

*   `masterLabel` (_string_) Updated master label.  
    Maximum length: 80.
*   `description` (_string_) Updated description.  
    Maximum length: 255.
*   `groundingSource` (_object_)
    
    GroundingSourceInput
    
    `GroundingSourceInputRepresentation` .
    
    Includes all fields of `GroundingSourceInput`.
    

### FileUploadUrlsInput

Input for generating presigned file upload URLs

*   `files` (_array of FileInfoInput_, required)
    
    List of `FileInfoInputRepresentation` objects.
    
    _Available in: v66.0_
    

### FileUploadUrlsCollectionOutput

Collection of presigned URLs

*   `libraryId` (_string_)
    
    Library ID.
    
    _Available in: v66.0_
    
*   `uploadUrls` (_array of FileUploadUrlOutput_)
    
    `FileUploadUrlOutputRepresentation` items.
    
    _Available in: v66.0_
    

### FileListOutput

Paginated list of file references

*   `files` (_array of GroundingFileRefOutput_)
    
    Current page of `GroundingFileRefOutputRepresentation` items.
    
    _Available in: v67.0_
    
*   `totalSize` (_integer_)
    
    Total number of file references for this library.
    
    _Available in: v67.0_
    
*   `currentPageUrl` (_string_)
    
    URL for the current page.
    
    _Available in: v67.0_
    
*   `nextPageUrl` (_string_)
    
    URL for the next page ( `null` if last page).
    
    _Available in: v67.0_
    

### AddFilesInput

Input for adding files to an existing SFDRIVE library

*   `uploadedFiles` (_array of UploadedFileInfoInput_, required)
    
    At least one `UploadedFileInfoInputRepresentation` .
    
    _Available in: v66.0_
    

### AddFilesOutput

Response from adding files to an existing library

*   `libraryId` (_string_)
    
    Library ID.
    
    _Available in: v66.0_
    
*   `filesAccepted` (_integer_)
    
    Number of files accepted.
    
    _Available in: v66.0_
    
*   `groundingFileRefs` (_array of GroundingFileRefOutput_)
    
    `GroundingFileRefOutputRepresentation` for the new files.
    
    _Available in: v66.0_
    

### ProvisionInput

Input for starting provision

*   `uploadedFiles` (_array of UploadedFileInfoInput_) `UploadedFileInfoInputRepresentation` entries. Required for SFDRIVE to confirm uploads.

### ProvisionOutput

Response from starting provision. The `sourceType` field is the discriminator; type-specific fields are populated accordingly:

*   SFDRIVE: includes `filesAccepted`
*   KNOWLEDGE: no file-specific fields

Discriminator: `sourceType` selects the concrete type. Mapping: `SFDRIVE` → `FileProvisionOutput`, `KNOWLEDGE` → `KnowledgeProvisionOutput`.

*   `libraryId` (_string_)
    
    Library ID.
    
    _Available in: v66.0_
    
*   `sourceType` (_string_)
    
    Discriminator.
    
    _Available in: v66.0_
    
      
    Allowed values: `SFDRIVE`, `KNOWLEDGE`.
*   `status` (_object_)
    
    LibraryStatusEnum
    
    Indexing status ( `LibraryStatusEnum` ).
    
    _Available in: v66.0_
    
    Includes all fields of `LibraryStatusEnum`.
    
*   `message` (_string_)
    
    Human-readable message.
    
    _Available in: v66.0_
    
      
    Example: `Indexing pipeline started asynchronously. Poll /status for updates.`.
*   `filesAccepted` (_integer_)
    
    Present only for `FileProvisionOutputRepresentation` ( `sourceType=SFDRIVE` ).
    
    _Available in: v66.0_
    

### LibraryStatusOutput

Library status wrapper with nested indexing details

*   `indexingStatus` (_object_)
    
    ProvisionStatusOutput
    
    `ProvisionStatusOutputRepresentation` .
    
    _Available in: v66.0_
    
    Includes all fields of `ProvisionStatusOutput`.
    

### UploadReadinessOutput

Upload readiness status for a library

*   `libraryId` (_string_)
    
    Library ID.
    
    _Available in: v66.0_
    
      
    Example: `1JDSG000007IbWX4A0`.
*   `ready` (_boolean_)
    
    `true` if UDLO is ACTIVE and uploads are allowed.
    
    _Available in: v66.0_
    
      
    Example: `true`.
*   `sourceType` (_string_)
    
    Source type (example: `SFDRIVE` ).
    
    _Available in: v66.0_
    
      
    Example: `SFDRIVE`.
*   `message` (_string_)
    
    Human-readable status.
    
    _Available in: v66.0_
    
      
    Example: `UDLO is ACTIVE. Ready for file uploads.`.

### EinsteinPromptRecordCollectionOutput

List of prompt template records.

*   `hasMoreRecords` (_boolean_)
    
    Specifies whether the query returned more prompt template records `(true)` or not `(false)`.
    
    _Available in: v62.0_
    
    _Filter group: Medium_
    
*   `promptRecords` (_array of EinsteinPromptRecord_)
    
    List of prompt template records returned.
    
    _Available in: v62.0_
    
    _Filter group: Small_
    
*   `totalPromptRecords` (_integer_)
    
    Number of prompt template records returned.
    
    _Available in: v62.0_
    
    _Filter group: Medium_
    

### EinsteinPromptRecordInput

Input representation for creating a prompt template.

*   `apiName` (_string_)
    
    The API name for the prompt template
    
    _Available in: v65.0_
    
*   `childRelationships` (_array of EinsteinPromptRecordInput_)
    
    A list of child relationships for the prompt record
    
    _This property is recursive: each item has the same structure as `EinsteinPromptRecordInput`._
    
    _Available in: v65.0_
    
*   `fields` (_object_)
    
    A map of field values
    
    _Available in: v65.0_
    
    Additional properties: `WrappedValue`.
    
*   `id` (_string_)
    
    The ID of the prompt template
    
    _Available in: v65.0_
    
*   `isStandard` (_boolean_)
    
    Boolean indicating whether the prompt template is standard
    
    _Available in: v65.0_
    

### EinsteinPromptTemplate

Comprehensive representation for prompt template operations including creation, updates, and activation

*   `additionalData` (_object_)
    
    WrappedMap
    
    Additional data, such as references
    
    _Available in: v65.0_
    
    _Filter group: Medium_
    
    Includes all fields of `WrappedMap`.
    
*   `errorMessages` (_array of string_)
    
    A list of error Messages
    
    _Available in: v65.0_
    
    _Filter group: Medium_
    
*   `hasWarning` (_boolean_)
    
    Boolean indicating if there are warning messages
    
    _Available in: v65.0_
    
    _Filter group: Medium_
    
*   `isSuccessful` (_boolean_)
    
    Boolean indicating if operation was successful
    
    _Available in: v65.0_
    
    _Filter group: Medium_
    
*   `statusCode` (_string_)
    
    The status code
    
    _Available in: v65.0_
    
    _Filter group: Medium_
    
*   `templateId` (_string_)
    
    The template Id
    
    _Available in: v65.0_
    
    _Filter group: Medium_
    
*   `templateType` (_string_)
    
    The template type
    
    _Available in: v65.0_
    
    _Filter group: Medium_
    
*   `versionId` (_string_)
    
    The version ID
    
    _Available in: v65.0_
    
    _Filter group: Medium_
    
*   `warningMessages` (_array of string_)
    
    A list of warning messages
    
    _Available in: v65.0_
    
    _Filter group: Medium_
    

### EinsteinPromptTemplateGenerationsInput

Prompt template input parameters and LLM provider to use for generation.

*   `additionalConfig` (_object_, required)
    
    EinsteinLlmAdditionalConfigInput
    
    Configuration information for the LLM provider.
    
    _Available in: v60.0_
    
    Includes all fields of `EinsteinLlmAdditionalConfigInput`.
    
*   `citationMode` (_string_)
    
    Mode of citations for the specified prompt template. Valid values are:
    
    *   `post_generation` —Citations are generated after the generated response for the specified prompt template.
    *   `off` —Citations aren't generated for the specified prompt template.
    
    _Available in: v62.0_
    
      
    Allowed values: `post_generation`, `off`.
*   `inputParams` (_object_, required)
    
    Parameters and values to resolve the specified prompt template.
    
    _Available in: v60.0_
    
    Additional properties: `WrappedValue`.
    
*   `isPreview` (_boolean_, required)
    
    Specifies whether to only resolve the prompt template (`true`) or to resolve the prompt template and generate an LLM response (`false`).
    
    _Available in: v60.0_
    
*   `outputLanguage` (_string_)
    
    Language code for the language to generate the LLM response in. See [Supported Languages in Prompt Template Responses](https://help.salesforce.com/s/articleView?id=ai.prompt_builder_localize_responses.htm&type=5).
    
    _Available in: v61.0_
    
*   `tags` (_object_)
    
    Map of wrapped values, such as free-form user feedback, that can be used to resolve a specified prompt template.
    
    _Available in: v62.0_
    
    Additional properties: `WrappedValue`.
    

### EinsteinPromptTemplateGenerations

Generated response from the specified LLM provider and resolved prompt template text.

*   `citations` (_object_)
    
    EinsteinLlmGenerationCitation
    
    Source information associated with the generated responses.
    
    _Available in: v62.0_
    
    _Filter group: Medium_
    
    Includes all fields of `EinsteinLlmGenerationCitation`.
    
*   `fileData` (_array of EinsteinPromptTemplateAttachment_)
    
    File data of the input files used in generation.
    
    _Available in: v63.0_
    
    _Filter group: Medium_
    
*   `generationErrors` (_array of EinsteinPromptTemplateGenerationsError_)
    
    List of errors associated with the generated responses, if any.
    
    _Available in: v60.0_
    
    _Filter group: Medium_
    
*   `generations` (_array of EinsteinLlmGenerationItem_)
    
    List of generated responses from the LLM provider.
    
    _Available in: v60.0_
    
    _Filter group: Small_
    
*   `isSummarized` (_boolean_)
    
    Specifies whether the generated response contains summarized text `(true)` or not `(false)`.
    
    _Available in: v61.0_
    
    _Filter group: Medium_
    
*   `mergeFieldInformation` (_object_)
    
    Merge field information mapping used for annotations in the resolved prompt.
    
    _Available in: v64.0_
    
    Additional properties: `EinsteinPromptTemplateMergeFieldInformationContext`.
    
*   `parameters` (_object_)
    
    WrappedMap
    
    Map of parameters and values for the LLM provider parameters.
    
    _Available in: v60.0_
    
    _Filter group: Medium_
    
    Includes all fields of `WrappedMap`.
    
*   `prompt` (_string_)
    
    Prompt template text with resolved inputs.
    
    _Available in: v60.0_
    
    _Filter group: Medium_
    
*   `promptTemplateDevName` (_string_)
    
    Developer name or ID of the prompt template record.
    
    _Available in: v60.0_
    
    _Filter group: Medium_
    
*   `renderConfiguration` (_object_)
    
    Render configuration used for rendering output in embeddable prompt display component.
    
    _Available in: v65.0_
    
    Additional properties: `string`.
    
*   `requestId` (_string_)
    
    ID of the generation request sent to the LLM provider.
    
    _Available in: v60.0_
    
    _Filter group: Small_
    
*   `requestMessages` (_array of EinsteinPromptTemplateMaskContent_)
    
    List of resolved prompt templates with masked data and masking information.
    
    _Available in: v61.0_
    
    _Filter group: Medium_
    
*   `responseMessages` (_array of EinsteinPromptTemplateMaskContent_)
    
    List of generated responses with masked data and masking information for the specified prompt template.
    
    _Available in: v61.0_
    
    _Filter group: Medium_
    
*   `slotsMaskingInformation` (_array of EinsteinPromptTemplateMaskData_)
    
    List of original and placeholder values of the masked data.
    
    _Available in: v61.0_
    
    _Filter group: Medium_
    

### EinsteinPromptRecord

Prompt template record.

*   `apiName` (_string_)
    
    API name of the prompt template record.
    
    _Available in: v62.0_
    
    _Filter group: Medium_
    
*   `childRelationships` (_object_)
    
    Map of prompt template name and prompt template records that are versions of the prompt template.
    
    _Available in: v62.0_
    
    _Filter group: Medium_
    
    Additional properties: `EinsteinPromptRecord`.
    
*   `fields` (_object_)
    
    Map of field name and prompt template record fields.
    
    _Available in: v62.0_
    
    _Filter group: Medium_
    
    Additional properties: `EinsteinPromptRecordField`.
    
*   `id` (_string_)
    
    ID of the prompt template record.
    
    _Available in: v62.0_
    
    _Filter group: Small_
    
*   `isStandard` (_boolean_)
    
    Specifies whether the prompt template record is a standard prompt template `(true)` or user-created prompt template `(false)`.
    
    _Available in: v62.0_
    
    _Filter group: Medium_
    

### GroundingSourceInput

Grounding source configuration. The `sourceType` field is the discriminator; the remaining fields apply conditionally based on its value:

*   SFDRIVE: file-based library (optionally set `indexMode`)
*   KNOWLEDGE: knowledge article library (set `knowledgeConfig`)
*   RETRIEVER: existing retriever (set `retrieverId`)

Discriminator: `sourceType` selects the concrete type. Mapping: `SFDRIVE` → `FileGroundingSourceInput`, `KNOWLEDGE` → `KnowledgeGroundingSourceInput`, `RETRIEVER` → `RetrieverGroundingSourceInput`.

*   `sourceType` (_string_) Source type discriminator: SFDRIVE, KNOWLEDGE, or RETRIEVER.  
    Allowed values: `SFDRIVE`, `KNOWLEDGE`, `RETRIEVER`.
*   `knowledgeConfig` (_KnowledgeConfigInput_)
*   `retrieverId` (_string_) Existing retriever ID (implies sourceType=RETRIEVER)  
    Example: `0pmSG000000001K`.
*   `indexMode` (_string_) Index mode: BASIC or ENHANCED. Only applicable when sourceType=SFDRIVE.  
    Allowed values: `BASIC`, `ENHANCED`. Default: `BASIC`.

### LibraryStatusEnum

Indexing status ( `LibraryStatusEnum` ). `READY` , `IN_PROGRESS` , `FAILED` , `UNKNOWN` , `INCOMPLETE` , or `NO_SOURCES` .

_Available in: v66.0_

Type: `string`.

Allowed values: `READY`, `IN_PROGRESS`, `FAILED`, `UNKNOWN`, `INCOMPLETE`, `NO_SOURCES`.

### RetrieverDetail

Structured retriever details

*   `apiName` (_string_, nullable) Retriever developer name. Currently not populated (Reserved for future use.)
*   `label` (_string_, nullable) Retriever display label
*   `id` (_string_, nullable) Retriever ID

### RetrieverActionDetail

Structured retriever action details

*   `apiName` (_string_, nullable) Retriever Action developer name
*   `label` (_string_, nullable) Retriever Action display label
*   `id` (_string_, nullable) Retriever Action asset ID

### GroundingSourceOutput

Grounding source details. The `groundingSourceType` field determines which type-specific fields are populated (nulls are suppressed):

*   `SFDRIVE` → `indexMode`, `groundingFileRefs`
*   `KNOWLEDGE` → `knowledgeConfig`
*   `RETRIEVER` → `retrieverId`, `retrieverLabel`
*   `SITEMAP` → (no additional fields)

Discriminator: `groundingSourceType` selects the concrete type.

*   `groundingSourceType` (_string_) Grounding source type discriminator.  
    Allowed values: `SFDRIVE`, `KNOWLEDGE`, `RETRIEVER`, `SITEMAP`.
*   `indexMode` (_string_) Index mode: BASIC or ENHANCED (only when groundingSourceType is SFDRIVE)  
    Allowed values: `BASIC`, `ENHANCED`.
*   `knowledgeConfig` (_KnowledgeConfigOutput_)
*   `retrieverId` (_string_) Retriever ID (if groundingSourceType=RETRIEVER)
*   `retrieverLabel` (_string_) Retriever label (if groundingSourceType=RETRIEVER)
*   `totalFileCount` (_integer_) Total number of file references in this grounding source
*   `groundingFileRefs` (_array of GroundingFileRefOutput_) Grounding file references associated with this grounding source (populated on GET, only when groundingSourceType is SFDRIVE)

### FileInfoInput

File metadata for upload URL generation

*   `fileName` (_string_, required) File name with extension (e.g., 'document.pdf'). Max 195 characters.  
    Maximum length: 195. Example: `user_manual.pdf`.

### FileUploadUrlOutput

Presigned URL for file upload

*   `fileName` (_string_)
    
    File name.
    
    _Available in: v66.0_
    
      
    Example: `user_manual.pdf`.
*   `uploadUrl` (_string_)
    
    Presigned S3 PUT URL. Contains raw `&` separators (not HTML-encoded); use this URL directly for PUT upload (no decoding needed).
    
    _Available in: v66.0_
    
      
    Example: `https://s3.amazonaws.com/bucket/path?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...`.
*   `filePath` (_string_)
    
    S3 file path (example: `$agentforce_data_library$/1JDSG000007IbWX4A0/user_manual.pdf` ).
    
    _Available in: v66.0_
    
      
    Example: `$agentforce_data_library$/1JDSG000007IbWX4A0/user_manual.pdf`.
*   `headers` (_object_)
    
    String map with the required headers for the upload (for example, BYOK encryption).
    
    _Available in: v66.0_
    
    Additional properties: `string`.
    

### GroundingFileRefOutput

File reference within a grounding source

*   `fileId` (_string_) File reference record ID
*   `fileName` (_string_) File name
*   `filePath` (_string_) File path in storage  
    Example: `$agentforce_data_library$/1JDSG000007IbWX4A0/user_manual.pdf`.
*   `fileSize` (_number (double)_) File size in bytes
*   `status` (_string_) File processing status: UPLOADED, INDEXING, INDEXED, UPLOAD\_FAILED, INDEX\_FAILED, DELETING, DELETE\_FAILED.  
    Allowed values: `UPLOADED`, `INDEXING`, `INDEXED`, `UPLOAD_FAILED`, `INDEX_FAILED`, `DELETING`, `DELETE_FAILED`.
*   `groundingSourceId` (_string_) Grounding source ID this file belongs to
*   `createdDate` (_string_) Date the file reference was created
*   `createdBy` (_string_) Name of user who created the file reference
*   `createdById` (_string_) ID of user who created the file reference

### UploadedFileInfoInput

Confirmation of an uploaded file

*   `filePath` (_string_, required) File path returned by /file-upload-urls: $agentforce\_data\_library$//. Must reference the current library — cross-library file paths are rejected with 400.  
    Example: `$agentforce_data_library$/1JDSG000007IbWX4A0/user_manual.pdf`.
*   `fileSize` (_integer (int64)_, required) File size in bytes  
    Example: `2500000`.

### ProvisionStatusOutput

Current library provision status with per-stage breakdown

*   `libraryId` (_string_)
    
    Library ID.
    
    _Available in: v66.0_
    
*   `status` (_object_)
    
    LibraryStatusEnum
    
    Overall status.
    
    _Available in: v66.0_
    
    Includes all fields of `LibraryStatusEnum`.
    
*   `currentStage` (_string_)
    
    Current stage ( `GroundingSourceStageEnum` ). Values are `DATA_STREAM` , `FILE_MIGRATION` , `DATA_LAKE_OBJECT` , `DATA_MODEL_OBJECT` , `SEARCH_INDEX` , `RETRIEVER` .
    
    _Available in: v66.0_
    
*   `stages` (_object_)
    
    Deprecated. Use `stageDetails` instead. Map of per-stage status details.
    
    _Available in: v66.0_
    
*   `stageDetails` (_array of StageDetail_)
    
    Ordered array of `StageDetail` objects (execution order).
    
    _Available in: v67.0_
    
*   `lastUpdatedAt` (_integer (int64)_)
    
    Last update time (Unix epoch milliseconds).
    
    _Available in: v66.0_
    

### WrappedValue

Value wrapped for use as an object.

*   `value` (_object_, required)
    
    Value to wrap.
    
    _Available in: v60.0_
    

### WrappedMap

Map of a parameter name and value.

*   `wrappedMap` (_object_)
    
    Map of parameter name and value.
    
    _Available in: v60.0_
    
    _Filter group: Small_
    
    Additional properties: `object`.
    

### EinsteinLlmAdditionalConfigInput

Additional configuration information for the LLM provider.

*   `additionalParameters` (_object_)
    
    Map of parameters and values for the LLM provider.
    
    _Available in: v60.0_
    
    Additional properties: `WrappedValue`.
    
*   `applicationName` (_string_, required)
    
    Name of the application.
    
    _Available in: v60.0_
    
*   `enablePiiMasking` (_boolean_)
    
    Specifies whether to mask personally identifiable information (PII) (`true`) or not (`false`).
    
    _Available in: v60.0_
    
*   `frequencyPenalty` (_number (double)_)
    
    Use to reduce the repetitiveness of generated tokens. The higher the value, the stronger a penalty is applied to previously present tokens, proportional to how many times they already appeared in the prompt or in prior generations. Minimum value is `0.0`. Maximum value is `1.0`.
    
    _Available in: v60.0_
    
*   `maxTokens` (_integer_)
    
    Maximum number of tokens to generate.
    
    _Available in: v60.0_
    
*   `numGenerations` (_integer_)
    
    Number of generation requests to send to the LLM provider.
    
    _Available in: v60.0_
    
*   `presencePenalty` (_number (double)_)
    
    Use to reduce the repetitiveness of generated tokens. This value is similar to frequency penalty, except that this penalty is applied equally to all tokens that already appeared, regardless of their exact frequencies. Minimum value is `0.0`, and maximum value is `1.0`.
    
    _Available in: v60.0_
    
*   `stopSequences` (_array of string_)
    
    Generated text is cut at the end of the earliest occurrence of a stop sequence.
    
    _Available in: v60.0_
    
*   `temperature` (_number (double)_)
    
    Sampling temperature to use. Higher values mean the model takes more risks. Lower temperatures mean that generations are less random. Minimum value is `0.0`, and maximum value is `1.0`
    
    _Available in: v60.0_
    

### EinsteinLlmGenerationCitation

Source information associated with a generated response.

*   `citedReferences` (_array of EinsteinLlmGenerationGenAiCitedReference_)
    
    List of metadata for the sources that are cited in the generated response.
    
    _Available in: v62.0_
    
    _Filter group: Small_
    
*   `sourceReferences` (_array of EinsteinLlmGenAiSourceReference_)
    
    List of sources from one or more data providers.
    
    _Available in: v62.0_
    
    _Filter group: Small_
    

### EinsteinPromptTemplateAttachment

Data for file attachments to prompts.

*   `exclusionInfo` (_object_)
    
    EinsteinPromptTemplateAttachmentExclusionInfo
    
    Information about file attachments that cannot be processed.
    
    _Available in: v64.0_
    
    _Filter group: Medium_
    
    Includes all fields of `EinsteinPromptTemplateAttachmentExclusionInfo`.
    
*   `fileExtension` (_string_)
    
    Extension of the file attachment.
    
    _Available in: v63.0_
    
    _Filter group: Small_
    
*   `id` (_string_)
    
    Content document ID of the file attachment.
    
    _Available in: v63.0_
    
    _Filter group: Small_
    
*   `latestPublishedVersion` (_string_)
    
    Content version ID of the file attachment.
    
    _Available in: v63.0_
    
    _Filter group: Small_
    
*   `parentName` (_string_)
    
    ParentName of the file attachment.
    
    _Available in: v64.0_
    
    _Filter group: Small_
    
*   `title` (_string_)
    
    Title of the file attachment.
    
    _Available in: v63.0_
    
    _Filter group: Small_
    

### EinsteinPromptTemplateGenerationsError

Error response to a prompt template generation request.

*   `errorMessage` (_string_)
    
    Message stating the reason for the error, if any.
    
    _Available in: v60.0_
    
    _Filter group: Medium_
    
*   `httpErrorCode` (_string_)
    
    HTTP status code, if any.
    
    _Available in: v60.0_
    
    _Filter group: Medium_
    
*   `localizedErrorMessage` (_string_)
    
    Translated error message, if available.
    
    _Available in: v60.0_
    
    _Filter group: Medium_
    
*   `messageCode` (_string_)
    
    Message code associated with the error message, if any.
    
    _Available in: v60.0_
    
    _Filter group: Medium_
    

### EinsteinLlmGenerationItem

Generated response from the LLM provider.

*   `contentQualityRepresentation` (_object_)
    
    EinsteinLlmGenerationsContentQuality
    
    Specifies whether the generated response contains toxic language `(true)` or not `(false)`.
    
    _Available in: v61.0_
    
    _Filter group: Medium_
    
    Includes all fields of `EinsteinLlmGenerationsContentQuality`.
    
*   `parameters` (_string_)
    
    Parameter values for the LLM provider.
    
    _Available in: v60.0_
    
    _Filter group: Medium_
    
*   `responseId` (_string_)
    
    ID of the generated response.
    
    _Available in: v60.0_
    
    _Filter group: Medium_
    
*   `safetyScoreRepresentation` (_object_)
    
    EinsteinLlmGenerationsSafetyScore
    
    Safety score information related to the generated response.
    
    _Available in: v60.0_
    
    _Filter group: Medium_
    
    Includes all fields of `EinsteinLlmGenerationsSafetyScore`.
    
*   `structuredResponse` (_string_)
    
    Structured response representation of the generated response.
    
    _Available in: v64.0_
    
    _Filter group: Small_
    
*   `text` (_string_)
    
    Text of generated response.
    
    _Available in: v60.0_
    
    _Filter group: Small_
    

### EinsteinPromptTemplateMergeFieldInformationContext

Representation for merge field information context

*   `value` (_string_)
    
    Value of the merge field
    
    _Available in: v64.0_
    
    _Filter group: Small_
    

### EinsteinPromptTemplateMaskContent

Generated response for a prompt template or resolved prompt template with masked data and masking information.

*   `content` (_string_)
    
    Text of generated response or resolved prompt template with masked data.
    
    _Available in: v61.0_
    
    _Filter group: Medium_
    
*   `moderationSettings` (_object_)
    
    EinsteinPromptTemplateMaskSettings
    
    Data masking settings for the specified prompt template.
    
    _Available in: v61.0_
    
    _Filter group: Medium_
    
    Includes all fields of `EinsteinPromptTemplateMaskSettings`.
    
*   `role` (_string_)
    
    Role in the Salesforce role hierarchy of the user executing the prompt template.
    
    _Available in: v61.0_
    
    _Filter group: Medium_
    

### EinsteinPromptTemplateMaskData

Information about masked data for a prompt template.

*   `originalValue` (_string_)
    
    Original value of the masked data.
    
    _Available in: v61.0_
    
    _Filter group: Medium_
    
*   `placeHolder` (_string_)
    
    Placeholder value of the masked data.
    
    _Available in: v61.0_
    
    _Filter group: Medium_
    
*   `recognizers` (_array of string_)
    
    Reserved for internal use.
    
    _Available in: v61.0_
    
    _Filter group: Medium_
    

### EinsteinPromptRecordField

Field values for the specified prompt template record field.

*   `displayValue` (_string_)
    
    Visible value of a prompt template record field.
    
    _Available in: v62.0_
    
    _Filter group: Small_
    
*   `value` (_string | boolean | integer_)
    
    Raw data value of a prompt template record field.
    
    _Available in: v62.0_
    
    _Filter group: Small_
    
    One of: `string`, `boolean`, `integer`.
    

### KnowledgeConfigInput

Knowledge article grounding configuration. **For CREATE:** Both primaryIndexField1 and primaryIndexField2 are REQUIRED. **For UPDATE (PATCH):** Primary fields cannot be changed after creation (immutable). Only contentFields and boolean flags can be updated.

*   `primaryIndexField1` (_string_, required) Primary field for indexing (e.g., 'Title'). REQUIRED for CREATE, immutable after creation.  
    Example: `Title`.
*   `primaryIndexField2` (_string_, required) Secondary field for indexing (e.g., 'Summary'). REQUIRED for CREATE, immutable after creation.  
    Example: `Summary`.
*   `contentFields` (_array of string_) Content fields to include for grounding (e.g., \['Detail\_\_c', 'UrlName'\]). Can be updated after creation.
    
    _Example_
    
    ```
    [
      "Detail__c",
      "Summary"
    ]
    ```
    
*   `isRestrictToPublicArticle` (_boolean_) Only use published articles. Default false. Can be updated after creation.  
    Default: `false`.
*   `isDataCategoryRuleEnabled` (_boolean_) Enable data category filtering. Default false. Can be updated after creation.  
    Default: `false`.
*   `dataCategorySelectionIds` (_array of string_) Data category IDs to filter Knowledge articles (15 or 18 character Salesforce IDs). You can provide dataCategorySelectionIds, dataCategorySelectionNames, or both — they will be merged. Only articles matching these categories will be indexed in the library.
    
    _Example_
    
    ```
    [
      "0GRxx000000001AAA",
      "0GRxx000000002BBB"
    ]
    ```
    
*   `dataCategorySelectionNames` (_array of string_)
    
    Data category names in qualified format: `groupDeveloperName.categoryDeveloperName`
    
    This is a human-readable alternative to using category IDs. The qualified format makes it easy to specify categories without looking up their IDs.
    
    **Format:** `groupDeveloperName.categoryDeveloperName`
    
    **Examples:**
    
    *   `"Products.Electronics"` — Electronics category in Products group
    *   `"Geography.NorthAmerica"` — North America category in Geography group
    *   `"Services.Support"` — Support category in Services group
    
    **How to find the qualified names:**
    
    1.  Go to Setup → Data Category Groups
    2.  Find your group (e.g., "Products") — this is the groupDeveloperName
    3.  Click into the group and find the category (e.g., "Electronics") — this is the categoryDeveloperName
    4.  Combine them: "Products.Electronics"
    
    **Note:** You can provide dataCategorySelectionIds, dataCategorySelectionNames, or both — they will be merged. Names are automatically converted to IDs before storage.
    
    _Example_
    
    ```
    [
      "Products.Electronics",
      "Geography.NorthAmerica",
      "Services.Support"
    ]
    ```
    

### KnowledgeConfigOutput

Knowledge article configuration (read-only)

*   `primaryIndexField1` (_string_) Primary index field
*   `primaryIndexField2` (_string_) Secondary index field
*   `contentFields` (_array of string_) Content fields included for grounding
*   `isRestrictToPublicArticle` (_boolean_) Public articles only flag
*   `isDataCategoryRuleEnabled` (_boolean_) Data category filtering enabled
*   `dataCategorySelectionIds` (_array of string_) Selected data category IDs (15 or 18 character Salesforce IDs). These are the IDs of the data categories that filter which Knowledge articles are indexed in this library.
    
    _Example_
    
    ```
    [
      "0GRxx000000001AAA",
      "0GRxx000000002BBB"
    ]
    ```
    
*   `dataCategorySelectionNames` (_array of string_)
    
    Selected data category names in qualified format: `groupDeveloperName.categoryDeveloperName`
    
    This field provides human-readable category names corresponding to the IDs returned in dataCategorySelectionIds. The qualified format shows both the category group and the category name for clarity.
    
    **Examples:**
    
    *   `"Products.Electronics"` — Electronics category in Products group
    *   `"Geography.NorthAmerica"` — North America category in Geography group
    *   `"Services.Support"` — Support category in Services group
    
    **Note:** This field is automatically populated by converting the stored category IDs to their qualified names. You can use these names directly when updating the library configuration.
    
    _Example_
    
    ```
    [
      "Products.Electronics",
      "Geography.NorthAmerica",
      "Services.Support"
    ]
    ```
    

### StageDetail

Details for a single grounding source stage

*   `name` (_string_)
    
    Stage name (for example, `DATA_LAKE_OBJECT` , `SEARCH_INDEX` ).
    
    _Available in: v67.0_
    
*   `status` (_string_)
    
    `SUCCESS` , `IN_PROGRESS` , `FAILED` , or `SCHEDULED` .
    
    _Available in: v67.0_
    
*   `completedAt` (_integer (int64)_)
    
    Completion timestamp (Unix epoch milliseconds). Present only when status is `SUCCESS` .
    
    _Available in: v67.0_
    
*   `startedAt` (_integer (int64)_)
    
    Start timestamp (Unix epoch milliseconds). Present only when status is `IN_PROGRESS` .
    
    _Available in: v67.0_
    
*   `error` (_string_)
    
    Error message. Present only when status is `FAILED` .
    
    _Available in: v67.0_
    
*   `errorCode` (_string_) Error code constant (only present if status is FAILED)
*   `artifacts` (_array of StageArtifact_)
    
    Artifacts produced by this stage. Only populated when `?includeArtifacts=true` is passed. Null/omitted when the parameter is false (default), for stages without artifacts (e.g., INDEXING, DATA\_STREAM), or when the stage has not yet completed.
    
    When populated, DLO and DMO artifacts include both `apiName` and `id` (resolved via targeted SOQL). SearchIndex and Retriever artifacts include `apiName`/`label` and `id` from the Retriever SOQL relationship.
    

### EinsteinLlmGenerationGenAiCitedReference

Metadata from an input source that is cited in a generated response.

*   `link` (_string_)
    
    URL for the source that is cited in a generated response.
    
    _Available in: v62.0_
    
    _Filter group: Small_
    
*   `sourceObjectApiName` (_string_)
    
    API name of the source record that is cited in a generated response.
    
    _Available in: v62.0_
    
    _Filter group: Small_
    
*   `sourceObjectRecordId` (_string_)
    
    ID of the source record that is cited in a generated response.
    
    _Available in: v62.0_
    
    _Filter group: Small_
    

### EinsteinLlmGenAiSourceReference

Source from a data provider.

*   `contents` (_array of EinsteinLlmGenerationGenAiSourceContentInfo_)
    
    List of values from the source that are used for grounding a generated response.
    
    _Available in: v62.0_
    
    _Filter group: Small_
    
*   `metadata` (_array of EinsteinLlmGenerationGenAiSourceReferenceInfo_)
    
    List of metadata for the source, such as URLs or record IDs.
    
    _Available in: v62.0_
    
    _Filter group: Small_
    

### EinsteinPromptTemplateAttachmentExclusionInfo

Representation for info of file exclusion from LLM requests

*   `exclusionReason` (_string_)
    
    Reason for file exclusion from LLM request
    
    _Available in: v64.0_
    
    _Filter group: Small_
    
*   `isExcluded` (_boolean_)
    
    True if the file is excluded from LLM request, false otherwise
    
    _Available in: v64.0_
    
    _Filter group: Small_
    

### EinsteinLlmGenerationsContentQuality

Quality information about the generated response.

*   `isToxicityDetected` (_boolean_)
    
    Specifies whether the generated response contains toxic language `(true)` or not `(false)`.
    
    _Available in: v61.0_
    
    _Filter group: Medium_
    

### EinsteinLlmGenerationsSafetyScore

Safety score information related to the LLM response.

*   `hateScore` (_number (double)_)
    
    A higher value means the generated response is more likely to contain text that expresses, incites, or promotes hatred, violence, or severe harm towards the targeted group. Minimum value of `0.0`. Maximum value of `1.0`.
    
    _Available in: v60.0_
    
    _Filter group: Medium_
    
*   `physicalScore` (_number (double)_)
    
    A higher value means the generated response is more likely to contain text with unsafe advice that may harm the user or others physically, or text that promotes, encourages, or depicts acts of self-harm. Minimum value of `0.0`. Maximum value of `1.0`.
    
    _Available in: v60.0_
    
    _Filter group: Medium_
    
*   `profanityScore` (_number (double)_)
    
    A higher value means the generated response is more likely to contain swear words, curse words, or obscene or profane language. Minimum value of `0.0`. Maximum value of `1.0`.
    
    _Available in: v60.0_
    
    _Filter group: Medium_
    
*   `safetyScore` (_number (double)_)
    
    Overall safety score based on the `hateScore`, `physicalScore`, `profanityScore`, `sexualScore`, `toxicityScore`, and `violenceScore`. A higher value means the generated response is more likely to be safe. Minimum value of `0.0`. Maximum value of `1.0`.
    
    _Available in: v60.0_
    
    _Filter group: Medium_
    
*   `sexualScore` (_number (double)_)
    
    A higher value means the generated response is more likely to contain text meant to arouse sexual excitement or promote sexual services. Minimum value of `0.0`. Maximum value of `1.0`.
    
    _Available in: v60.0_
    
    _Filter group: Medium_
    
*   `toxicityScore` (_number (double)_)
    
    A higher value means the generated response is more likely to contain text that is rude, disrespectful, or unreasonable. Minimum value of `0.0`. Maximum value of `1.0`.
    
    _Available in: v60.0_
    
    _Filter group: Medium_
    
*   `violenceScore` (_number (double)_)
    
    A higher value means the generated response is more likely to contain text that promotes or glorifies violence or celebrates the suffering or humiliation of others. Minimum value of `0.0`. Maximum value of `1.0`.
    
    _Available in: v60.0_
    
    _Filter group: Medium_
    

### EinsteinPromptTemplateMaskSettings

Data masking settings for a prompt template.

*   `enableModeration` (_boolean_)
    
    Specifies whether data masking is enabled `(true)` or not `(false)`.
    
    _Available in: v61.0_
    
    _Filter group: Medium_
    

### StageArtifact

Artifact produced by a provisioning stage

*   `assetType` (_StageAssetTypeEnum_)
*   `apiName` (_string_, nullable) Developer name / API name of the asset
*   `label` (_string_, nullable) Display label of the asset
*   `id` (_string_, nullable) Entity ID of the asset

### EinsteinLlmGenerationGenAiSourceContentInfo

Values from a source that is cited in a generated response.

*   `content` (_string_)
    
    Text from the source that is cited in the generated response.
    
    _Available in: v62.0_
    
    _Filter group: Small_
    
*   `fieldName` (_string_)
    
    API name of the field that is cited in the generated response, such as `Opportunity.Amount`.
    
    _Available in: v62.0_
    
    _Filter group: Small_
    
*   `objectName` (_string_)
    
    API name of the object that is cited in the generated response, such as `Opportunity`.
    
    _Available in: v62.0_
    
    _Filter group: Small_
    

### EinsteinLlmGenerationGenAiSourceReferenceInfo

Metadata from a source from a data provider.

*   `link` (_string_)
    
    URL for the source from the data provider.
    
    _Available in: v62.0_
    
    _Filter group: Small_
    
*   `sourceObjectApiName` (_string_)
    
    API name of the source record.
    
    _Available in: v62.0_
    
    _Filter group: Small_
    
*   `sourceObjectRecordId` (_string_)
    
    ID of the source record.
    
    _Available in: v62.0_
    
    _Filter group: Small_
    

### StageAssetTypeEnum

Type of asset produced by a provisioning stage

Type: `string`.

Allowed values: `DLO`, `DMO`, `SEARCH_INDEX`, `RETRIEVER`, `RETRIEVER_ACTION`.

### FileGroundingSourceInput

Grounding source variant for SFDRIVE (file-based) libraries.

*   `sourceType` (_string_) Always SFDRIVE for this variant  
    Allowed values: `SFDRIVE`.
*   `indexMode` (_string_) Index mode: BASIC or ENHANCED. Defaults to BASIC.  
    Allowed values: `BASIC`, `ENHANCED`. Default: `BASIC`.

### KnowledgeGroundingSourceInput

Grounding source variant for KNOWLEDGE article libraries.

*   `sourceType` (_string_) Always KNOWLEDGE for this variant  
    Allowed values: `KNOWLEDGE`.
*   `knowledgeConfig` (_KnowledgeConfigInput_)

### RetrieverGroundingSourceInput

Grounding source variant for RETRIEVER libraries (existing custom retriever).

*   `sourceType` (_string_) Always RETRIEVER for this variant  
    Allowed values: `RETRIEVER`.
*   `retrieverId` (_string_) Existing retriever ID. The retriever must be active (have an active configuration) at the time of creation; otherwise the request is rejected with `ADL_RETRIEVER_NOT_ACTIVE` (exists but inactive) or `ADL_RETRIEVER_NOT_FOUND` (cannot be located).  
    Example: `0pmSG000000001K`.

### FileProvisionOutput

Provision response variant for SFDRIVE (file-based) libraries.

*   `libraryId` (_string_) Library ID
*   `sourceType` (_string_) Always SFDRIVE for this variant  
    Allowed values: `SFDRIVE`.
*   `status` (_object_)
    
    LibraryStatusEnum
    
    Indexing status
    
    Includes all fields of `LibraryStatusEnum`.
    
*   `message` (_string_) Status message
*   `filesAccepted` (_integer_) Number of files accepted

### KnowledgeProvisionOutput

Provision response variant for KNOWLEDGE article libraries.

*   `libraryId` (_string_) Library ID
*   `sourceType` (_string_) Always KNOWLEDGE for this variant  
    Allowed values: `KNOWLEDGE`.
*   `status` (_object_)
    
    LibraryStatusEnum
    
    Indexing status
    
    Includes all fields of `LibraryStatusEnum`.
    
*   `message` (_string_) Status message

### EinsteinPromptTemplateBase

Base comprehensive representation for prompt template operations including creation, updates, and activation/deactivation

*   `additionalData` (_object_)
    
    WrappedMap
    
    Additional data, such as references
    
    _Available in: v65.0_
    
    _Filter group: Medium_
    
    Includes all fields of `WrappedMap`.
    
*   `errorMessages` (_array of string_)
    
    A list of error Messages
    
    _Available in: v65.0_
    
    _Filter group: Medium_
    
*   `hasWarning` (_boolean_)
    
    Boolean indicating if there are warning messages
    
    _Available in: v65.0_
    
    _Filter group: Medium_
    
*   `isSuccessful` (_boolean_)
    
    Boolean indicating if operation was successful
    
    _Available in: v65.0_
    
    _Filter group: Medium_
    
*   `statusCode` (_string_)
    
    The status code
    
    _Available in: v65.0_
    
    _Filter group: Medium_
    
*   `templateId` (_string_)
    
    The template Id
    
    _Available in: v65.0_
    
    _Filter group: Medium_
    
*   `templateType` (_string_)
    
    The template type
    
    _Available in: v65.0_
    
    _Filter group: Medium_
    
*   `warningMessages` (_array of string_)
    
    A list of warning messages
    
    _Available in: v65.0_
    
    _Filter group: Medium_