Bulk Import Narrative
Use the following endpoint to bulk import case narratives into Veeva Safety:
/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
caseIdandnarrativeLanguage
Headers
Section link for Headers| Name | Description |
|---|---|
content-type | multipart/form-data |
accept | text/csv |
X-VaultAPI-IntegrityCheck | Optional: Set to true to perform additional integrity checks on the CSV file. If omitted, defaults to false. |
X-VaultAPI-MigrationMode | Optional: 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-ArchiveDocument | Optional: 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. |
Body Parameter
Section link for Body ParameterThe request is sent through a CSV file.
| Name | Description |
|---|---|
narratives | The CSV file containing the narratives to be imported. |
Click the button below to download a sample CSV file:
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:
| Column | Description |
|---|---|
caseId | The Case record ID. |
localizedCaseId | Optional: 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:
localizedCaseId column is required, even when empty. |
narrativeType | The following types are accepted:
|
narrativeLanguage | The three-letter ISO language code for the narrative language. For example, eng is english. |
narrative | Text of the narrative document. |
Request
Section link for Requestcurl --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"'Response
Section link for Response{
"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"
}
}Response Details
Section link for Response DetailsOn SUCCESS, the response includes the following information:
| Name | Description |
|---|---|
import_id | The 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_uri | The 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.