Skip to content

Use the following endpoint to bulk import case narratives into Veeva Safety:

POST/api/{version}/app/safety/import-narrative/batch/

This request imports text to create multiple narrative documents, in the format of the E2B import narrative template. This request can import primary narratives as well as narrative translations. Narrative translations can optionally be imported to a Localized Case in addition to the global Case.

If a Case narrative or translation already exists for the given language, the request creates a new version of the document populated with the text sent through the request.

This endpoint is asynchronous. The following limits apply to this endpoint:

  • The maximum batch size is 500
  • The maximum CSV input file size is 100 MB
  • Maximum characters per narrative is 200k
  • The CSV file cannot contain duplicate rows with the same caseId and narrativeLanguage
NameDescription
content-typemultipart/form-data
accepttext/csv
X-VaultAPI-IntegrityCheckOptional: Set to true to perform additional integrity checks on the CSV file. If omitted, defaults to false.
X-VaultAPI-MigrationModeOptional: Set to true to perform additional verifications on the localizedCaseId, including checking that the caseId refers to the related global Case and the narrativeLanguage matches the language on the Localized Case. If omitted, defaults to false.
X-VaultAPI-ArchiveDocumentOptional: If the Vault Document Archive feature is enabled, set to true to send the imported narrative documents directly to the document archive, or false to create the imported documents as active narratives. If omitted and the Vault Document Archive feature is enabled, the imported narrative documents are sent directly to the document archive.

The request is sent through a CSV file.

NameDescription
narrativesThe CSV file containing the narratives to be imported.

Click the button below to download a sample CSV file:

Download Sample CSV

Consider the following requirements when preparing the CSV file:

  • The values in the input file must be UTF-8 encoded.
  • CSVs must follow the standard format.
  • The file must use a comma (,) as the delimiter
  • If the narrative text contains commas, enclose each comma within double-quotation marks (“,”)
  • If the narrative text contains double-quotation marks, they must be escaped (\”example\“)

The CSV file must have the following columns:

ColumnDescription
caseIdThe Case record ID.
localizedCaseIdOptional: If you are importing a localized narrative, specify the Localized Case record ID. The narrative document will be linked to both the global Case ( caseId) and Localized Case. The following requirements apply:
  • narrativeType must be translation
  • narrativeLanguage must match the language on the destination Localized Case.
  • caseId must match the global Case
Note: The localizedCaseId column is required, even when empty.
narrativeTypeThe following types are accepted:
  • primary: The primary Case narrative, used to populate the Narrative Text and Narrative Preview fields on the Case.
  • translation: A narrative Translation.
narrativeLanguageThe three-letter ISO language code for the narrative language. For example, eng is english.
narrativeText of the narrative document.
curl --location --request POST 'https://myvault.veevavault.com/api/v25.3/app/safety/import-narrative/batch' --header 'Content-Type: multipart/form-data' --header 'Accept: text/csv' --header 'Authorization: {SESSION_ID}' --form 'narratives=@"/directory/bulk-narrative-import.csv"'
{ "responseStatus": "success__v", "responseDetails": { "import_id": "dc2daf9d-8549-4701-805a-c3f62a2aefa5", "result_uri": "/api/v25.3/app/safety/import-narrative/batch/dc2daf9d-8549-4701-805a-c3f62a2aefa5" } }

On SUCCESS, the response includes the following information:

NameDescription
import_idThe ID of the import request, which you can use along with the Retrieve Bulk Import Status endpoint to check the status of the operation.
result_uriThe URI path to retrieve the status of the operation with the Retrieve Bulk Import Status endpoint.

On FAILURE, the response returns an error message describing the reason for the failure.