# ◉ Script Endpoints ## Create a script in a project - [POST /projects/{project_id}/scripts](https://testpad-api.redocly.app/openapi/script-endpoints/paths/~1projects~1%7Bproject_id%7D~1scripts/post.md): Creates a new script in the top level of the project project_id. If you want to create a script within a particular folder, please refer to Create a script in a folder POST /projects/:p/folders/:f/script, a nearly identical endpoint but for the specifying which folder to put the script in. ## Create a script in a folder - [POST /projects/{project_id}/folders/{folder_id}/scripts](https://testpad-api.redocly.app/openapi/script-endpoints/paths/~1projects~1%7Bproject_id%7D~1folders~1%7Bfolder_id%7D~1scripts/post.md): Creates a new script in the folder folder_id within the project project_id. The new script is supplied as a JSON object in the request body and can contain tests, runs, run headers, results and custom fields. ### URL Parameters insert enum or integer Controls where the script will be created within the specified folder. first (default) — the script is placed at the top of the folder. last — the script is placed at the end of the folder. as integer, N — the script is placed after the Nth item in the folder. ### POST data name string — The name of the new script. description string (OPTIONAL) — The description for the new script. comments string (OPTIONAL) — The report comments for the new script. tests — See Supplying Test Text. fields — Order/visibility/definition of run header fields. runs — List of test run objects as defined in Supplying Test Runs. ### Returns JSON response payload containing: script object — Summary of the new script. context object — Project and folderPath context. ### Defaults for common parameters (no common parameters are used). ## Get a script - [GET /scripts/{script_id}](https://testpad-api.redocly.app/openapi/script-endpoints/paths/~1scripts~1%7Bscript_id%7D/get.md): Retrieves information about the script specified by the script ID, script_id. Script IDs are integers and are unique across projects. To find the ID of a script via the app, browse to the relevant script and inspect the page URL. By default, most information about the script is returned, including its tests, fields, run headers and results. Use the common URL Parameters to modify the contents of the response object. Takes Common URL Parameters for controlling the contents of contained objects. Defaults for common parameters: - subfolders (not relevant) - scripts=full - tests=full - fields=full - runs=full - results=full - progress=terse