> For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

# get

> Retrieve a single SWML webhook resource.

Retrieve a single SWML webhook resource.

### Schema

```yaml
openapi: 3.1.0
info:
  title: API
  version: 1.0.0
paths:
  /api/fabric/resources/swml_webhooks/{id}:
    get:
      operationId: get_swml_webhook
      summary: Get SWML webhook
      description: >-
        Returns an SWML Webhook 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).
      tags:
        - subpackage_swmlWebhook
      parameters:
        - name: id
          in: path
          description: Unique ID of a SWML Webhook.
          required: true
          schema:
            $ref: '#/components/schemas/uuid'
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SWMLWebhookResponse'
        '401':
          description: Access is unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Types.StatusCodes.StatusCode401'
        '404':
          description: The server cannot find the requested resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Types.StatusCodes.StatusCode404'
        '500':
          description: An internal server error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Types.StatusCodes.StatusCode500'
servers:
  - url: https://%7BYour_Space_Name%7D.signalwire.com
    description: SignalWire API
components:
  schemas:
    uuid:
      type: string
      format: uuid
      description: Universal Unique Identifier.
      title: uuid
    SwmlWebhookResponseType:
      type: string
      enum:
        - swml_webhook
      description: Type of the Fabric Resource
      title: SwmlWebhookResponseType
    SwmlWebhookUsedFor:
      type: string
      enum:
        - calling
        - messaging
      description: >-
        Indicates whether this SWML Webhook handles inbound calls or inbound
        messages. Determines the payload SignalWire POSTs to
        `primary_request_url`.
      title: SwmlWebhookUsedFor
    RequestUrlMethodType:
      type: string
      enum:
        - GET
        - POST
      description: The method type to use for the URL
      title: RequestUrlMethodType
    SWMLWebhook:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/uuid'
          description: Unique ID of the SWML Webhook.
        name:
          type: string
          description: Name of the SWML Webhook.
        used_for:
          $ref: '#/components/schemas/SwmlWebhookUsedFor'
          description: >-
            Indicates whether this SWML Webhook handles inbound calls or inbound
            messages. Determines the payload SignalWire POSTs to
            `primary_request_url`.
        primary_request_url:
          type: string
          format: uri
          description: >-
            Primary URL SignalWire fetches the SWML document from when the
            webhook fires. The webhook payload depends on `used_for`: for
            `calling`, see the [SWML inbound call
            webhook](/docs/apis/rest/swml-webhook/webhooks/inbound-call-webhook);
            for `messaging`, see the [SWML inbound message
            webhook](/docs/apis/rest/swml-webhook/webhooks/inbound-message-webhook).
        primary_request_method:
          $ref: '#/components/schemas/RequestUrlMethodType'
          description: Primary request method of the SWML Webhook.
        fallback_request_url:
          type:
            - string
            - 'null'
          format: uri
          description: >-
            Fallback URL SignalWire fetches the SWML document from if the
            primary URL fails. Receives the same payload as
            `primary_request_url` — see the [SWML inbound call
            webhook](/docs/apis/rest/swml-webhook/webhooks/inbound-call-webhook)
            or [SWML inbound message
            webhook](/docs/apis/rest/swml-webhook/webhooks/inbound-message-webhook)
            depending on `used_for`.
        fallback_request_method:
          $ref: '#/components/schemas/RequestUrlMethodType'
          description: Fallback request method of the SWML Webhook.
        status_callback_url:
          type:
            - string
            - 'null'
          format: uri
          description: >-
            URL to receive message status callback events for outbound messages
            sent by this webhook (`reply` or `send_sms`). See the [Message
            status
            callback](/docs/apis/rest/messages/webhooks/message-status-callback)
            webhook for the payload your URL will receive.
        status_callback_method:
          $ref: '#/components/schemas/RequestUrlMethodType'
          description: Status callback method of the SWML Webhook.
      required:
        - id
        - name
        - used_for
        - primary_request_url
        - primary_request_method
        - fallback_request_url
        - fallback_request_method
        - status_callback_url
        - status_callback_method
      title: SWMLWebhook
    SWMLWebhookResponse:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/uuid'
          description: Unique ID of the SWML Webhook.
        project_id:
          $ref: '#/components/schemas/uuid'
          description: Unique ID of the Project.
        display_name:
          type: string
          description: Display name of the SWML Webhook Fabric Resource
        type:
          $ref: '#/components/schemas/SwmlWebhookResponseType'
          description: Type of the Fabric Resource
        created_at:
          type: string
          format: date-time
          description: Date and time when the resource was created.
        updated_at:
          type: string
          format: date-time
          description: Date and time when the resource was updated.
        swml_webhook:
          $ref: '#/components/schemas/SWMLWebhook'
          description: SWML Webhook data.
      required:
        - id
        - project_id
        - display_name
        - type
        - created_at
        - updated_at
        - swml_webhook
      title: SWMLWebhookResponse
    TypesStatusCodesStatusCode401Error:
      type: string
      enum:
        - Unauthorized
      title: TypesStatusCodesStatusCode401Error
    Types.StatusCodes.StatusCode401:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/TypesStatusCodesStatusCode401Error'
      required:
        - error
      description: Access is unauthorized.
      title: Types.StatusCodes.StatusCode401
    TypesStatusCodesStatusCode404Error:
      type: string
      enum:
        - Not Found
      title: TypesStatusCodesStatusCode404Error
    Types.StatusCodes.StatusCode404:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/TypesStatusCodesStatusCode404Error'
      required:
        - error
      description: The server cannot find the requested resource.
      title: Types.StatusCodes.StatusCode404
    TypesStatusCodesStatusCode500Error:
      type: string
      enum:
        - Internal Server Error
      title: TypesStatusCodesStatusCode500Error
    Types.StatusCodes.StatusCode500:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/TypesStatusCodesStatusCode500Error'
      required:
        - error
      description: An internal server error occurred.
      title: Types.StatusCodes.StatusCode500

```

## **Response Example**

### Response (200)

```json
{
  "id": "a87db7ed-8ebe-42e4-829f-8ba5a4152f54",
  "project_id": "99151cf8-9548-4860-ba70-a8de824f3312",
  "display_name": "Booking Assistant",
  "type": "swml_webhook",
  "created_at": "2024-05-06T12:20:00Z",
  "updated_at": "2024-05-06T12:20:00Z",
  "swml_webhook": {
    "id": "a87db7ed-8ebe-42e4-829f-8ba5a4152f54",
    "name": "My SWML Webhook",
    "used_for": "calling",
    "primary_request_url": "https://primary.com",
    "primary_request_method": "GET",
    "fallback_request_url": "https://fallback.com",
    "fallback_request_method": "GET",
    "status_callback_url": "https://callback.com",
    "status_callback_method": "POST"
  }
}
```

## **Example**

```python {9}
from signalwire.rest import RestClient

client = RestClient(
    project="your-project-id",
    token="your-api-token",
    host="your-space.signalwire.com",
)

webhook = client.fabric.swml_webhooks.get("webhook-id")
print(f"Swml Webhook: {webhook['display_name']}, ID: {webhook['id']}")
```