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

# GET /scripts/fetch

`GET /scripts/fetch`

Gets a script by id.

## Query parameters

- `id` string, required
- `branch` string, nullable
- `environment` 'staging' | 'release', nullable
- `withCode` 'staging' | 'release', nullable

## Headers

- `X-Phantombuster-Org` string

## Response `200`

OK

- object
  - `id` string, required
  - `name` string, required
  - `orgId` string, required
  - `orgSlug` string, required
  - `description` string
  - `markdownRender` unknown
  - `markdown` string, nullable
  - `code` string, nullable
  - `branch` string
  - `environment` 'staging' | 'release', required
  - `visibility` 'private' | 'semi public' | 'public' | 'semi open source' | 'open source', required
  - `accessList` string[], nullable
  - `slug` string
  - `inputIcon` string
  - `outputIcon` string
  - `categories` string[]
  - `branches` object[], required
    - `id` string, required
    - `name` string, required
    - `visibility` 'private' | 'semi public' | 'public' | 'semi open source' | 'open source', required
    - `accessList` string[], nullable
    - `environment` 'staging' | 'release'
    - `inputTypes` string[], nullable
    - `outputTypes` string[], nullable
  - `outputDescription` object
  - `outputTypes` object
  - `argumentTypes` object
  - `unlisted` boolean
  - `status` object
    - `type` string
    - `description` string
  - `reservedAgentSlots` number
  - `reservedAgentSlotsFactor` number
  - `isDeprecated` boolean
  - `argumentSchema` object
    - `type` 'object'
    - `properties` object
  - `argumentForm` object
    - `enabled` boolean
    - `steps` object[]
      - `slug` string, required
      - `title` string, required
      - `headerTitle` string
      - `fields` object, required
      - `helper` string
      - `helpers` union
        - string[]
        - string
  - `recommenderMetadata` object — Configuration for the AI recommender (campaign_agent) system to provide better phantoms suggestions
    - `workers` string[]
    - `standalone` boolean
    - `description` string
  - `visibleInChat` string[]

## Other responses

- `400` — No such script or other bad request.
- `412` — Cannot fulfill branch or environment constraint.

---

[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)
