---
title: "GET /scripts/code"
method: GET
path: "/scripts/code"
tags: ["scripts"]
---

# GET /scripts/code

`GET /scripts/code`

Gets the code of a script.

## Query parameters

- `script` string, required
- `org` string, nullable
- `branch` string, nullable
- `environment` 'staging' | 'release', nullable

## Headers

- `X-Phantombuster-Org` string

## Response `200`

OK

- object
  - `code` string, required

## Other responses

- `400` — No such org, script, branch or environment.
- `401` — Script is not from your org and isn't public or is in staging.
- `412` — Script does not exist in the specified branch.

---

[API](https://skmtc.net/phantombuster/apis/phantombuster-api-v2.md) · [All operations](https://skmtc.net/phantombuster/apis/phantombuster-api-v2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/phantombuster/phantombuster-api-v2/versions/acf0049d7c7f/schema)
