---
title: "Get SWML Script"
method: GET
path: "/api/fabric/resources/swml_scripts/{id}"
tags: ["SWML Scripts"]
---

# Get SWML Script

`GET /api/fabric/resources/swml_scripts/{id}`

Returns a SWML Script by ID

#### Permissions

The API token used to authenticate must have the following scope(s) enabled to make a successful request: _Voice_, _Messaging_, _Fax_, or _Video_.

[Learn more about API scopes](/docs/platform/your-signalwire-api-space).

## Path parameters

- `id` string, uuid, required — Universal Unique Identifier.

## Response `200`

The request has succeeded.

- SwmlScriptResponse
  - `id` string, uuid, required — Universal Unique Identifier.
  - `project_id` string, uuid, required — Universal Unique Identifier.
  - `display_name` string, required — Display name of the SWML Script Fabric Resource
  - `type` 'swml_script', required — Type of the Fabric Resource
  - `created_at` string, date-time, required — Date and time when the resource was created.
  - `updated_at` string, date-time, required — Date and time when the resource was updated.
  - `swml_script` union, required — A SWML Script — either a [Calling Script](#schema/CallingSwmlScript) for inbound or outbound calls, or a [Messaging Script](#schema/MessagingSwmlScript) for inbound SMS or MMS messages. The `script_type` field on each script (`"calling"` or `"messaging"`) identifies which kind it is.
    - CallingSwmlScript — A SWML Script that handles inbound or outbound calls. The `contents` field carries a [calling SWML document](/docs/swml/reference/calling).
      - `id` string, uuid, required — Universal Unique Identifier.
      - `display_name` string, required — The displayed name of the SWML script.
      - `script_type` 'calling', required — Set to `calling` for SWML Scripts that handle inbound or outbound calls.
      - `request_url` string, uri, required — URL where this SWML Script is hosted.
      - `contents` SWMLCallingSWMLObject, required — A SWML document for handling inbound and outbound calls. Contains a `sections` map where each section holds an array of methods that run sequentially. Execution starts at `sections.main`. See the [Calling SWML reference](/docs/swml/reference/calling) for the full list of available methods.
        - `version` '1.0.0'
        - `sections` SWMLCallingSection, required
          - `main` SWMLCallingSWMLMethod[], required
            - union
              - …
      - `status_callback_url` string, uri — URL that receives status callbacks for messages sent or calls made by this script.
      - `status_callback_method` 'POST' — HTTP method used for status callbacks.
    - MessagingSwmlScript — A SWML Script that handles inbound SMS or MMS messages. The `contents` field carries a [messaging SWML document](/docs/swml/reference/messaging).
      - `id` string, uuid, required — Universal Unique Identifier.
      - `display_name` string, required — The displayed name of the SWML script.
      - `script_type` 'messaging', required — Set to `messaging` for SWML Scripts that handle inbound SMS or MMS messages.
      - `request_url` string, uri, required — URL where this SWML Script is hosted.
      - `contents` SWMLMessagingSWMLObject, required — A SWML document for handling inbound SMS or MMS messages. The document has a top-level `sections` map; execution starts at `sections.main`, and each section is an ordered array of methods. Additional sections can be invoked via `execute`, `transfer`, or `goto`. See the [Messaging SWML reference](/docs/swml/reference/messaging) for the full list of available methods.
        - `version` '1.0.0'
        - `sections` SWMLMessagingSection, required
          - `main` SWMLMessagingSWMLMethod[], required
            - union
              - …

## Other responses

- `401` — Access is unauthorized.
- `404` — The server cannot find the requested resource.
- `500` — An internal server error occurred.

---

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