---
title: Upload a Python Script with the POST Script Endpoint
slug: user-guide-10x/upload-a-python-script-with-the-post-script-endpoint
docTags: 
createdAt: 2025-06-18T11:01:38.787Z
---

﻿Many of the Swimlane RESTful API endpoints require JSON payloads. However, the POST /task/upload-script endpoint requires multipart/form-data.

You upload JSON files from accessing **Upload a task** on the Integrations/Tasks tab.

::Image[]{src="https://api.archbee.com/api/optimize/511c8QBH-VHiwWnyzIwUb/tGBfH68neVpg14wKfEeYg_upload-a-task.png" size="22" width="360" height="325" position="center" showCaption="false"}

Here is an example of a successful POST:

::Image[]{src="https://api.archbee.com/api/optimize/511c8QBH-VHiwWnyzIwUb/Q5Y-nNCEwqvn4SOXa6YNu_200response.png" size="50" width="1010" height="624" position="center" showCaption="false"}

Here is the POST body payload that needs to be replicated in client Python code:

::Image[]{src="https://api.archbee.com/api/optimize/511c8QBH-VHiwWnyzIwUb/qFkrGLOcFqhHNZQgkcesL_form-datadetail.png" size="46" width="1009" height="626" position="center" showCaption="false"}

This Python 2.7 code sample, which relies on the Swimlane Driver for authentication and for ease of retrieving the pertinent application’s ID value, illustrates how to make this POST:

:::BlockQuote
from swimlane import Swimlane host = 'https\://SWIMLANE-HOST' swimlane = Swimlane(host, 'USER', 'PASSWORD', verify\_ssl=False) app = swimlane.apps.get(name='APPLICATION-NAME') resp = swimlane.request( 'post', '/task/upload-script', data=\[ ("taskName", "do\_some\_cool\_secops.py"), ("scriptType", "Python"), ("appId", app.id) ], files=\{ "file": open(r'C:\Swimlane\shared\do\_some\_cool\_secops', 'rb'), "contentType": "text/plain" } ) print str(resp.status\_code) print resp.text
:::

Swimlane supports Python scripts and Powershell scripts.
