Introduction
This article walks through how to replace a file in Wdata using the Workiva APIs. You will retrieve the existing file, unimport and delete it, and then upload a new version.
Prerequisites
Before beginning, ensure you have completed all steps in the Importing Workiva API Collections into Postman guide. This ensures your API collection and environment variables are correctly configured.
Authentication
- Open your Postman workspace and confirm you are using the correct environment.
- Expand the IAM Services collection, open the oauth2 folder, and select the Retrieve a token request.
- Click Send to generate your authentication token. The token is automatically stored in the {{access_token}} environment variable and will be used in all subsequent API calls.
Note: Tokens expire after 600 seconds (10 minutes). When this happens, simply repeat this step to generate a new one.
Retrieve the File ID Using the Retrieve a List of Files API
Before uploading or replacing a file in a Wdata table, confirm whether the file already exists. You can do this using the Retrieve a List of Files API to locate the file and obtain its File ID.
Follow the steps below.
-
Open the API endpoint
- Go to Wdata API → File → Retrieve a List of Files.
-
Enter the required parameters
- TableId: your Wdata table ID
-
SearchText: the file name (e.g.,
Control Table (3).csv)
-
Run the request
- The API will return all files matching your search.
-
Find the File ID
- In the JSON response, look for:
-
id→ the File ID -
name→ confirms the correct file
-
- In the JSON response, look for:
(Optional) Verify in Wdata
Open the dataset in the UI and confirm the File ID matches.
Unimport the file using the File ID
Use the Unimport a single file endpoint to remove an imported file from a Wdata table. This step prepares the table to receive a replacement file.
- In Postman, open the Unimport a single file request.
- In Path Variables, set:
- Click Send to run the request.
- In the response body, confirm the file record now shows an updated status (for example, moved back to staged).
- In Wdata → Datasets, open the dataset and verify the file is no longer displayed as imported.
Delete the file using the File ID
- In Postman, open the Delete a single file request.
- In Path Variables, paste the same fileId.
- Send the request.
- Confirm the response body returns that fileId , this confirms the file has been deleted from the table.
Optional: Unimport and delete the file in one step using force=true
By default, when a file is unimported, it is removed from the table and returned to staged mode, but it is not deleted. To permanently remove the file as part of a single operation, include the force query parameter.
When force=true is specified, the file is unimported and deleted in a single request. A separate Delete a single file API call is not required.
Example:
DELETE /api/v1/table/{tableId}/import/{fileId}?force=true
Upload the new file
After removing the previous file, follow the steps in the Upload and Import a File guide to upload and import the new version.