Workiva supports both Python's standard library and the Python Package Index (PyPI). Dependencies can be generated automatically using the built-in script editor or manually created on your local machine.
Workiva Scripting is included with Customize Workiva. To use Scripting, your workspace must have Customize Workiva/Scripting enabled, and users will need the appropriate Scripting role(s) and file permissions.
Supported libraries
Workiva scripts support Python's standard library out-of-the-box; you can simply import the module in your code and start using it. This library contains built-in modules that provide access to system functionality like file I/O, as well as many standardized solutions for common programming problems.
In addition to the standard library, there is a growing collection of components available from the Python Package Index. You will need to generate the dependencies into your script that include the PyPI components you want to use.
One of the PyPI components that we commonly use is the "requests" component, which allows you to interact with the Workiva platform through the Workiva Public APIs.
Note: PyPI components that require additional installations may not be supported.
Generate dependencies with the script editor
The script editor can automatically build your dependencies.
Here's how:
- From Home, open a script file (or create a new one).
- Go to the Sources panel on the left side, right-click in the blank space just below the current sources, and select + Add Source File.
- Create a new source named: requirements.txt.
- In the center canvas, add a line specifying the library and version to install. (This is the requests==2.28.1 line in our example image.)
- Click Save at the top left.
- Reload your screen. Don't skip this step!
Once saved and refreshed, Workiva automatically generates a dependency bundle called dependencies.zip. You can now use the library in your code.
Generate dependencies from your local machine
To manually create dependencies, you must build a package locally and upload it to the script editor. For example, you may have a project that needs to access the "requests" library to run a script:
import requests
print (requests.get('https://api.github.com').text)
This can be done using a pip-compatible package manager:
-
Define the version of the
requestslibrary to access as a pip-compatible format; it should be saved as a.txtfile:echo requests==2.28.1 > requirements.txt
-
Install the dependency into a new dependencies directory:
pip3 install --target ./dependencies --requirement requirements.txt
-
Create a
dependencies.zipfile:cd dependencies
zip -r ../dependencies.zip .
cd ..
-
Request an access token:
curl -X POST https://api.app.wdesk.com/iam/v1/oauth2/token \ -H 'Content-Type: application/x-www-form-urlencoded;charset=UTF-8' \ -H 'Accept: application/json' \ -d "client_id=$CLIENT_ID&client_secret=$CLIENT_SECRET&grant_type=client_credentials"
Pick up the
access_tokenfrom the response and use it as$BEARER_TOKENbelow. -
In your Workiva Scripting project, create a new source for
dependencies.zip:curl -X POST https://api.app.wdesk.com/prototype/platform/scripts/<scriptId>/sources \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -H "Authorization: Bearer $BEARER_TOKEN" \ -H "X-Version: 2022-01-01" \ -d '{"path":"dependencies.zip"}'The response returns the new source, including its id:
{"id":"<sourceId>","path":"dependencies.zip"} -
To get a list of the source IDs in your script, make a GET request:
curl -X GET https://api.app.wdesk.com/prototype/platform/scripts/<scriptId>/sources \ -H "Accept: application/json" \ -H "Authorization: Bearer $BEARER_TOKEN" \ -H "X-Version: 2022-01-01" -
Initiate a content upload for that source, then PUT the
dependencies.zipto the returned uploadUrl:curl -X POST https://api.app.wdesk.com/prototype/platform/scripts/<scriptId>/sources/<sourceId>/contentUpload \ -H "Accept: application/json" \ -H "Authorization: Bearer $BEARER_TOKEN" \ -H "X-Version: 2022-01-01"
The response returns the upload target:
{"uploadUrl":"<uploadUrl>"}Then upload the binary to that URL:
curl -X PUT "<uploadUrl>" \ -H "Authorization: Bearer $BEARER_TOKEN" \ --data-binary @dependencies.zip
-
To test the
requestslibrary, run a script with the following code:import requests print(requests.get('https://api.github.com').text)
FAQ
Which APIs and libraries are supported?
Workiva Scripting currently supports:
- Workiva Public APIs
- Non-Workiva APIs
- Python's Standard Library
- The Python Package Index (PyPI)
Workiva Scripting supports Python only at this time.
Learn more: Supported Workiva Scripting libraries and dependencies
Which version of Python is used in Workiva Scripting?
New scripts run on Python 3.13. Workiva Scripting still supports existing Python 3.9 scripts, but support for Python 3.9 ends in October 2027 — so you should migrate any Python 3.9 scripts to Python 3.13 as soon as possible.
Learn more: Migrating scripts to Python 3.13 in Workiva
Does Workiva provide API clients with popular languages like Python or Java?
We do not currently provide public SDKs for Python or Java.
However, we provide open API specifications for Workiva APIs so you can generate these libraries yourself. For example, you can obtain the Workiva Platform API's OAS file and generate a client library.
Are there scripting-specific APIs available?
Yes. Scripting API endpoints are currently available as prototype endpoints within Workiva's Prototype Platform API.
Public Scripting API endpoints will be available in Summer 2026. Once they're available, you'll be expected to migrate to the public endpoints — support for Workiva Scripting non-public endpoints (including prototype) will end in October 2027.
How do I create and view API grants for the Workiva Public APIs?
You'll need to obtain a client ID and secret by following the instructions here.
How do I authorize into the Workiva Public APIs using Python?
The following code snippet makes a call to the IAM service to generate an access token that is then used to authenticate into the Scripting prototype endpoints. It will get a list of all the scripts that the API grant (i.e., client) has access to in the workspace where the grant was created.
import requests
import json
import os
AUTH_URL = "https://api.app.wdesk.com/iam/v1/oauth2/token"
SCRIPTING_API_URL = "https://api.app.wdesk.com/prototype/platform/scripts/"
CLIENT_ID = os.getenv('CLIENT_ID')
CLIENT_SECRET = os.getenv('CLIENT_SECRET')
tokenResponse = requests.post(
AUTH_URL,
data = 'client_id=' + CLIENT_ID +
'&client_secret=' + CLIENT_SECRET +
'&grant_type=client_credentials',
headers = {'Content-Type':
'application/x-www-form-urlencoded; \
charset=UTF-8'})
accessToken = 'Bearer ' + json.loads(tokenResponse.text)['access_token']
dataRes = requests.get(SCRIPTING_API_URL, headers = {'Authorization': accessToken})
print(json.loads(dataRes.text))
How do I update the format of cells using Python?
You can update cell formatting from a script by calling the Workiva Platform API's Update sheet content endpoint (POST /spreadsheets/{spreadsheetId}/sheets/{sheetId}/update). Use the applyFormats field to apply formats such as bold, number and currency formatting, and shading, and applyBorders to apply borders. Batch multiple format operations into a single request — each field accepts an array of operations, and the endpoint is rate-limited — rather than sending one request per range.
Learn more: Update sheet content and the Spreadsheet Data Guide.
Can I read/write or upload non-Workiva files stored in Workiva?
Yes. Using Workiva's Files Management APIs, you can upload non-Workiva files — such as PDFs, images, or other arbitrary file types — into the platform as Supporting Documents, which preserve the original file as-is. To upload one, use the import file endpoint with kind set to SupportingDocument. Supporting Documents appear alongside your other Workiva files and can be listed, moved, copied, exported (downloaded), and trashed like any other file.
Learn more: Introduction to Files Management APIs
Can I programmatically create and manage automations?
At this time, there are no endpoints available to programmatically create or manage automations.