---
title: "Get a source swap policy"
method: GET
path: "/v2/sourceSwapPolicies/{policyId}"
tags: ["Source swap policies"]
---

# Get a source swap policy

`GET /v2/sourceSwapPolicies/{policyId}`

## Request

- Base URL: `https://api.sigmacomputing.com`
- URL: `https://api.sigmacomputing.com/v2/sourceSwapPolicies/{policyId}`
- Auth: HTTP bearer

Get a source swap policy by policy ID.

  **Beta**: Getting details for a **Connection** source swap policy is in private beta and must be enabled for your organization. This documentation is subject to the [Beta features](/docs/sigma-product-releases#beta-features) disclaimer.

  ### Usage notes
  - Retrieve the **policyId** by calling the [/v2/sourceSwapPolicies](https://help.sigmacomputing.com/reference/list-source-swap-policies) endpoint.

## Path parameters

- `policyId` string, required

## Response `200`

Get source swap policy response

- union: Get source swap policy response
  - SourceSwapPoliciesGetSourceSwapPolicyResponse2000
    - `type` 'connection', required
    - `name` string, required: Name of the source swap policy.
    - `fromConnectionId` string, required: ID of the connection to swap.
    - `swaps` V2SourceSwapPoliciesPolicyIdGetResponsesContentApplicationJsonSchemaOneOf0Swaps, required
      - `connectionSwaps` V2SourceSwapPoliciesPolicyIdGetResponsesContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItems[], required: Swap paths to a different location in the same connection.
        - `to` V2SourceSwapPoliciesPolicyIdGetResponsesContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsTo, required: Specify how to swap each segment of a path to a table in your database, catalog, or project. `path0` is equivalent to a database, catalog, or project. `path` is equivalent to a schema or dataset, and `path2` is equivalent to a table or view.
          - `path0` union, required: The rule used to update this specific path value when the swap is performed. If the specified path (when resolved) does not exist, the swap is not performed.
            - V2SourceSwapPoliciesPolicyIdGetResponsesContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath00
              - …
            - V2SourceSwapPoliciesPolicyIdGetResponsesContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath01
              - …
            - V2SourceSwapPoliciesPolicyIdGetResponsesContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath02
              - …
          - `path1` union, required: The rule used to update this specific path value when the swap is performed. If the specified path (when resolved) does not exist, the swap is not performed.
            - V2SourceSwapPoliciesPolicyIdGetResponsesContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath10
              - …
            - V2SourceSwapPoliciesPolicyIdGetResponsesContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath11
              - …
            - V2SourceSwapPoliciesPolicyIdGetResponsesContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath12
              - …
          - `path2` union: The rule used to update this specific path value when the swap is performed. If the specified path (when resolved) does not exist, the swap is not performed.
            - V2SourceSwapPoliciesPolicyIdGetResponsesContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath20
              - …
            - V2SourceSwapPoliciesPolicyIdGetResponsesContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath21
              - …
            - V2SourceSwapPoliciesPolicyIdGetResponsesContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath22
              - …
    - `policyId` string, required
  - SourceSwapPoliciesGetSourceSwapPolicyResponse2001
    - `type` 'deployment', required
    - `name` string, required: Name of the source swap policy.
    - `fromConnectionId` string, required: ID of the connection to swap.
    - `swaps` V2SourceSwapPoliciesPolicyIdGetResponsesContentApplicationJsonSchemaOneOf1Swaps, required
      - `toConnection` V2SourceSwapPoliciesPolicyIdGetResponsesContentApplicationJsonSchemaOneOf1SwapsToConnection, required
        - `swapType` 'attribute', required: Specify a user attribute to use the value of the user attribute as the value to swap.
        - `userAttributeId` string, required
      - `deploymentSwaps` V2SourceSwapPoliciesPolicyIdGetResponsesContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItems[], required
        - `from` V2SourceSwapPoliciesPolicyIdGetResponsesContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFrom, required
          - `path0` union, required
            - V2SourceSwapPoliciesPolicyIdGetResponsesContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFromPath00
              - …
            - V2SourceSwapPoliciesPolicyIdGetResponsesContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFromPath01
              - …
          - `path1` union, required
            - V2SourceSwapPoliciesPolicyIdGetResponsesContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFromPath10
              - …
            - V2SourceSwapPoliciesPolicyIdGetResponsesContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFromPath11
              - …
          - `path2` union
            - V2SourceSwapPoliciesPolicyIdGetResponsesContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFromPath20
              - …
            - V2SourceSwapPoliciesPolicyIdGetResponsesContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFromPath21
              - …
        - `to` V2SourceSwapPoliciesPolicyIdGetResponsesContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsTo, required
          - `path0` union, required: The rule used to update this specific path value when the swap is performed. If the specified path (when resolved) does not exist, the swap is not performed.
            - V2SourceSwapPoliciesPolicyIdGetResponsesContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath00
              - …
            - V2SourceSwapPoliciesPolicyIdGetResponsesContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath01
              - …
            - V2SourceSwapPoliciesPolicyIdGetResponsesContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath02
              - …
          - `path1` union, required: The rule used to update this specific path value when the swap is performed. If the specified path (when resolved) does not exist, the swap is not performed.
            - V2SourceSwapPoliciesPolicyIdGetResponsesContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath10
              - …
            - V2SourceSwapPoliciesPolicyIdGetResponsesContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath11
              - …
            - V2SourceSwapPoliciesPolicyIdGetResponsesContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath12
              - …
          - `path2` union: The rule used to update this specific path value when the swap is performed. If the specified path (when resolved) does not exist, the swap is not performed.
            - V2SourceSwapPoliciesPolicyIdGetResponsesContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath20
              - …
            - V2SourceSwapPoliciesPolicyIdGetResponsesContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath21
              - …
            - V2SourceSwapPoliciesPolicyIdGetResponsesContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath22
              - …
    - `policyId` string, required

---

[API](https://skmtc.dev/sigmacomputing/apis/sigma-rest-api.md) - [All operations](https://skmtc.dev/sigmacomputing/apis/sigma-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/sigmacomputing/apis/sigma-rest-api/revisions/fb6036208c49?raw)
