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 the example image below.)
- 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:
Before you begin, ensure that your API grant includes the
script:writescope. For instructions on creating or updating an API grant, see Workiva API Setup.curl -X POST https://api.app.wdesk.com/oauth2/token \ -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" \ -H "Accept: application/json" \ -H "X-Version: 2026-01-01" \ -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/scripts/${SCRIPT_ID}/sources" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -H "Authorization: Bearer $BEARER_TOKEN" \ -H "X-Version: 2026-01-01" \ -d '{"path":"dependencies.zip"}'The response returns the new source. Save its
idasSOURCE_IDfor the content-upload request.{ "id": "<sourceId>", "path": "dependencies.zip" } -
Initiate a content upload for the
dependencies.zipsource. Include-ito display the response headers:curl -i -X POST \ "https://api.app.wdesk.com/scripts/${SCRIPT_ID}/sources/${SOURCE_ID}/contentUpload" \ -H "Accept: application/json" \ -H "Authorization: Bearer $BEARER_TOKEN" \ -H "X-Version: 2026-01-01"Save the
uploadUrlfrom the response body and the operation URL from theLocationresponse header. -
Upload
dependencies.zipto the returneduploadUrl:curl -X PUT "<uploadurl>" \ -H "Authorization: Bearer $BEARER_TOKEN" \ --data-binary @dependencies.zipThen poll the operation URL:
curl -X GET "<operationlocation>" \ -H "Authorization: Bearer $BEARER_TOKEN" \ -H "X-Version: 2026-01-01"Honor the
Retry-Afterresponse header and repeat the polling request untilstatusiscompleted,failed, orcancelled. Do not run the script unless the operation completes successfully. -
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.
To learn more, see the Workiva Support page 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.
To learn more, see the Workiva Support page 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. The public Scripting API is available through the 2026-01-01 Workiva API version. Send X-Version: 2026-01-01 with every request.
See the Scripting API guide for supported operations, scopes, and requirements.
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 example obtains an access token and retrieves the scripts accessible to the API grant in its workspace. The API grant requires the script:read scope. For instructions on creating or updating an API grant, see Workiva API Setup.
import os
import requests
AUTH_URL = "https://api.app.wdesk.com/oauth2/token"
SCRIPTING_API_URL = "https://api.app.wdesk.com/scripts"
API_VERSION = "2026-01-01"
CLIENT_ID = os.environ["CLIENT_ID"]
CLIENT_SECRET = os.environ["CLIENT_SECRET"]
token_response = requests.post(
AUTH_URL,
headers={
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
"X-Version": API_VERSION,
},
data={
"client_id": CLIENT_ID,
"client_secret": CLIENT_SECRET,
"grant_type": "client_credentials",
},
timeout=30,
)
token_response.raise_for_status()
headers = {
"Authorization": f"Bearer {token_response.json()['access_token']}",
"X-Version": API_VERSION,
}
scripts_response = requests.get(
SCRIPTING_API_URL,
headers=headers,
timeout=30,
)
scripts_response.raise_for_status()
print(scripts_response.json())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
applyFormatsfield to apply formats such as bold, number and currency formatting, and shading, andapplyBordersto apply borders. - We recommend that you 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.
For more information, refer to the following Workiva Developer pages:
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.