Create a new script#

Description#

Creates a new script. Requires name. Use the container field to place the script in a specific folder. Only python3.13 is accepted as a runtime value; python3.9 is deprecated and cannot be used for new scripts.

POST /scripts

Required OAuth Scopes

file:write

Parameters#

Parameter

In

Type

Required

Description

X-Version

header

string

true

Version of the API (2026-09-01.scripting.preview)

body

body

Script

true

The properties of the script to create

Body parameter example#

{
  "description": "Checks each row in a spreadsheet and hides rows with a value of zero",
  "name": "Hide Rows with Value of Zero",
  "runtime": "python3.13"
}

Code Samples#

curl -X POST https://api.app.wdesk.com/scripts \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer {access-token}' \
    -H 'X-Version: 2026-09-01.scripting.preview'
http POST https://api.app.wdesk.com/scripts \
    X-Version:2026-09-01.scripting.preview \
    Content-Type:application/json \
    Accept:application/json \
    Authorization:"Bearer {access-token}"
wget --method=POST "https://api.app.wdesk.com/scripts" \
    --output-document - \
    --header 'Content-Type: application/json' \
    --header 'Accept: application/json' \
    --header 'Authorization: Bearer {access-token}' \
    --header 'X-Version: 2026-09-01.scripting.preview'
import requests

headers = {
  'X-Version': '2026-09-01.scripting.preview',
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('https://api.app.wdesk.com/scripts', headers = headers)

print(r.json())

Returns#

201 - Created#

Returns a Script object containing details for the newly created Script.

400 - Bad Request#

Error response that indicates that the service is not able to process the incoming request. The reason is provided in the error message.

401 - Unauthorized#

Error response that indicates that the service is not able to process the incoming request. The reason is provided in the error message.

403 - Forbidden#

Error response that indicates that the service is not able to process the incoming request. The reason is provided in the error message.

404 - Not Found#

Error response that indicates that the service is not able to process the incoming request. The reason is provided in the error message.

429 - Too Many Requests#

Error response that indicates that the service is not able to process the incoming request. The reason is provided in the error message.

500 - Internal Server Error#

Error response that indicates that the service is not able to process the incoming request. The reason is provided in the error message.

503 - Service Unavailable#

Error response that indicates that the service is not able to process the incoming request. The reason is provided in the error message.

Example Responses#

{
  "created": {
    "dateTime": "2026-04-05T20:50:52Z",
    "user": {
      "id": "V3ZVc2VyFzV3NiQ5NDA2NjIzNxk2njH"
    }
  },
  "description": "This is a demo script.",
  "id": "11140fc0-d3af-356d-abcb-b43a06daa453",
  "modified": {
    "dateTime": "2026-04-05T20:50:52Z",
    "user": {
      "id": "V3ZVc2VyFzV3NiQ5NDA2NjIzNxk2njH"
    }
  },
  "name": "Demo script",
  "runtime": "python3.13",
  "state": "active"
}
{
  "code": "400BadRequest",
  "message": "The request was unacceptable, often due to a missing or invalid parameter"
}
{
  "code": "401Unauthorized",
  "message": "No valid API token provided"
}
{
  "code": "403Forbidden",
  "message": "The API token does not have permissions to perform the request"
}
{
  "code": "404NotFound",
  "message": "The requested resource could not be found"
}
{
  "code": "429TooManyRequests",
  "message": "Too many requests have been made against the API in too short a time"
}
{
  "code": "500InternalServerError",
  "message": "The server encountered an unexpected condition that prevented it from fulfilling the request"
}
{
  "code": "503ServiceUnavailable",
  "message": "The server cannot handle the request due to a temporary overload or scheduled maintenance"
}