> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://help.sigmacomputing.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://help.sigmacomputing.com/_mcp/server.

# Create a source swap policy (Beta)

POST https://api.sigmacomputing.com/v2/sourceSwapPolicies
Content-Type: application/json

Create a source swap policy.

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

  ### Usage notes
  - Retrieve the **connectionId** to use as the **fromConnectionId** by calling the [/v2/connections](https://help.sigmacomputing.com/reference/list-connections) endpoint.
  - Retrieve the **userAttributeId** to use in the **swaps** object by calling the [/v2/user-attributes](https://help.sigmacomputing.com/reference/list-user-attributes) endpoint.
  

Reference: https://help.sigmacomputing.com/reference/create-source-swap-policy

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: sigma-rest-api
  version: 1.0.0
paths:
  /v2/sourceSwapPolicies:
    post:
      operationId: createSourceSwapPolicy
      summary: Create a source swap policy (Beta)
      description: |-
        Create a source swap policy.

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

          ### Usage notes
          - Retrieve the **connectionId** to use as the **fromConnectionId** by calling the [/v2/connections](https://help.sigmacomputing.com/reference/list-connections) endpoint.
          - Retrieve the **userAttributeId** to use in the **swaps** object by calling the [/v2/user-attributes](https://help.sigmacomputing.com/reference/list-user-attributes) endpoint.
          
      tags:
        - sourceSwapPolicies
      parameters:
        - name: Authorization
          in: header
          description: OAuth authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: The response body.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/sourceSwapPolicies_createSourceSwapPolicy_Response_200
      requestBody:
        description: The request body.
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/sourceSwapPolicies_createSourceSwapPolicy_Request
servers:
  - url: https://api.sigmacomputing.com
    description: Server for GCP (US) hosted organizations
  - url: https://api.sa.gcp.sigmacomputing.com
    description: Server for GCP (KSA) hosted organizations
  - url: https://aws-api.sigmacomputing.com
    description: Server for AWS US (West) hosted organizations
  - url: https://api.us-a.aws.sigmacomputing.com
    description: Server for AWS US (East) hosted organizations
  - url: https://api.ca.aws.sigmacomputing.com
    description: Server for AWS Canada hosted organizations
  - url: https://api.eu.aws.sigmacomputing.com
    description: Server for AWS Europe hosted organizations
  - url: https://api.au.aws.sigmacomputing.com
    description: Server for AWS Australia and APAC hosted organizations
  - url: https://api.uk.aws.sigmacomputing.com
    description: Server for AWS UK hosted organizations
  - url: https://api.us.azure.sigmacomputing.com
    description: Server for Azure US hosted organizations
  - url: https://api.eu.azure.sigmacomputing.com
    description: Server for Azure Europe hosted organizations
  - url: https://api.ca.azure.sigmacomputing.com
    description: Server for Azure Canada hosted organizations
  - url: https://api.uk.azure.sigmacomputing.com
    description: Server for Azure United Kingdom hosted organizations
  - url: https://api.au.azure.sigmacomputing.com
    description: Server for Azure Australia hosted organizations
components:
  schemas:
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0Type:
      type: string
      enum:
        - connection
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0Type
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath0OneOf0SwapType:
      type: string
      enum:
        - attribute
      description: >-
        Specify a user attribute to use the value of the user attribute as the
        value to swap.
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath0OneOf0SwapType
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath00:
      type: object
      properties:
        swapType:
          $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath0OneOf0SwapType
          description: >-
            Specify a user attribute to use the value of the user attribute as
            the value to swap.
        userAttributeId:
          type: string
      required:
        - swapType
        - userAttributeId
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath00
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath0OneOf1SwapType:
      type: string
      enum:
        - exact
      description: Specify the value in the path to swap to
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath0OneOf1SwapType
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath01:
      type: object
      properties:
        swapType:
          $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath0OneOf1SwapType
          description: Specify the value in the path to swap to
        catalogObject:
          type: string
      required:
        - swapType
        - catalogObject
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath01
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath0OneOf2SwapType:
      type: string
      enum:
        - all
      description: Keep the current path value.
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath0OneOf2SwapType
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath02:
      type: object
      properties:
        swapType:
          $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath0OneOf2SwapType
          description: Keep the current path value.
      required:
        - swapType
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath02
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath0:
      oneOf:
        - $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath00
        - $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath01
        - $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath02
      description: >-
        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.
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath0
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath1OneOf0SwapType:
      type: string
      enum:
        - attribute
      description: >-
        Specify a user attribute to use the value of the user attribute as the
        value to swap.
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath1OneOf0SwapType
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath10:
      type: object
      properties:
        swapType:
          $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath1OneOf0SwapType
          description: >-
            Specify a user attribute to use the value of the user attribute as
            the value to swap.
        userAttributeId:
          type: string
      required:
        - swapType
        - userAttributeId
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath10
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath1OneOf1SwapType:
      type: string
      enum:
        - exact
      description: Specify the value in the path to swap to
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath1OneOf1SwapType
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath11:
      type: object
      properties:
        swapType:
          $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath1OneOf1SwapType
          description: Specify the value in the path to swap to
        catalogObject:
          type: string
      required:
        - swapType
        - catalogObject
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath11
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath1OneOf2SwapType:
      type: string
      enum:
        - all
      description: Keep the current path value.
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath1OneOf2SwapType
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath12:
      type: object
      properties:
        swapType:
          $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath1OneOf2SwapType
          description: Keep the current path value.
      required:
        - swapType
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath12
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath1:
      oneOf:
        - $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath10
        - $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath11
        - $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath12
      description: >-
        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.
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath1
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath2OneOf0SwapType:
      type: string
      enum:
        - attribute
      description: >-
        Specify a user attribute to use the value of the user attribute as the
        value to swap.
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath2OneOf0SwapType
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath20:
      type: object
      properties:
        swapType:
          $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath2OneOf0SwapType
          description: >-
            Specify a user attribute to use the value of the user attribute as
            the value to swap.
        userAttributeId:
          type: string
      required:
        - swapType
        - userAttributeId
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath20
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath2OneOf1SwapType:
      type: string
      enum:
        - exact
      description: Specify the value in the path to swap to
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath2OneOf1SwapType
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath21:
      type: object
      properties:
        swapType:
          $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath2OneOf1SwapType
          description: Specify the value in the path to swap to
        catalogObject:
          type: string
      required:
        - swapType
        - catalogObject
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath21
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath2OneOf2SwapType:
      type: string
      enum:
        - all
      description: Keep the current path value.
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath2OneOf2SwapType
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath22:
      type: object
      properties:
        swapType:
          $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath2OneOf2SwapType
          description: Keep the current path value.
      required:
        - swapType
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath22
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath2:
      oneOf:
        - $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath20
        - $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath21
        - $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath22
      description: >-
        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.
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath2
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsTo:
      type: object
      properties:
        path0:
          $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath0
          description: >-
            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.
        path1:
          $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath1
          description: >-
            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.
        path2:
          $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsToPath2
          description: >-
            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.
      required:
        - path0
        - path1
      description: >-
        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.
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsTo
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItems:
      type: object
      properties:
        to:
          $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItemsTo
          description: >-
            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.
      required:
        - to
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItems
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0Swaps:
      type: object
      properties:
        connectionSwaps:
          type: array
          items:
            $ref: >-
              #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0SwapsConnectionSwapsItems
          description: Swap paths to a different location in the same connection.
      required:
        - connectionSwaps
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0Swaps
    SourceSwapPoliciesCreateSourceSwapPolicyRequest0:
      type: object
      properties:
        type:
          $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0Type
        name:
          type: string
          description: Name of the source swap policy.
        fromConnectionId:
          type: string
          description: ID of the connection to swap.
        swaps:
          $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf0Swaps
      required:
        - type
        - name
        - fromConnectionId
        - swaps
      title: SourceSwapPoliciesCreateSourceSwapPolicyRequest0
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1Type:
      type: string
      enum:
        - deployment
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1Type
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsToConnectionSwapType:
      type: string
      enum:
        - attribute
      description: >-
        Specify a user attribute to use the value of the user attribute as the
        value to swap.
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsToConnectionSwapType
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsToConnection:
      type: object
      properties:
        swapType:
          $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsToConnectionSwapType
          description: >-
            Specify a user attribute to use the value of the user attribute as
            the value to swap.
        userAttributeId:
          type: string
      required:
        - swapType
        - userAttributeId
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsToConnection
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFromPath0OneOf0SwapType:
      type: string
      enum:
        - all
      description: Keep the current path value.
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFromPath0OneOf0SwapType
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFromPath00:
      type: object
      properties:
        swapType:
          $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFromPath0OneOf0SwapType
          description: Keep the current path value.
      required:
        - swapType
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFromPath00
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFromPath0OneOf1SwapType:
      type: string
      enum:
        - exact
      description: Specify the value in the path to swap to
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFromPath0OneOf1SwapType
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFromPath01:
      type: object
      properties:
        swapType:
          $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFromPath0OneOf1SwapType
          description: Specify the value in the path to swap to
        catalogObject:
          type: string
      required:
        - swapType
        - catalogObject
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFromPath01
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFromPath0:
      oneOf:
        - $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFromPath00
        - $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFromPath01
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFromPath0
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFromPath1OneOf0SwapType:
      type: string
      enum:
        - all
      description: Keep the current path value.
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFromPath1OneOf0SwapType
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFromPath10:
      type: object
      properties:
        swapType:
          $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFromPath1OneOf0SwapType
          description: Keep the current path value.
      required:
        - swapType
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFromPath10
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFromPath1OneOf1SwapType:
      type: string
      enum:
        - exact
      description: Specify the value in the path to swap to
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFromPath1OneOf1SwapType
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFromPath11:
      type: object
      properties:
        swapType:
          $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFromPath1OneOf1SwapType
          description: Specify the value in the path to swap to
        catalogObject:
          type: string
      required:
        - swapType
        - catalogObject
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFromPath11
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFromPath1:
      oneOf:
        - $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFromPath10
        - $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFromPath11
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFromPath1
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFromPath2OneOf0SwapType:
      type: string
      enum:
        - all
      description: Keep the current path value.
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFromPath2OneOf0SwapType
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFromPath20:
      type: object
      properties:
        swapType:
          $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFromPath2OneOf0SwapType
          description: Keep the current path value.
      required:
        - swapType
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFromPath20
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFromPath2OneOf1SwapType:
      type: string
      enum:
        - exact
      description: Specify the value in the path to swap to
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFromPath2OneOf1SwapType
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFromPath21:
      type: object
      properties:
        swapType:
          $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFromPath2OneOf1SwapType
          description: Specify the value in the path to swap to
        catalogObject:
          type: string
      required:
        - swapType
        - catalogObject
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFromPath21
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFromPath2:
      oneOf:
        - $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFromPath20
        - $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFromPath21
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFromPath2
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFrom:
      type: object
      properties:
        path0:
          $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFromPath0
        path1:
          $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFromPath1
        path2:
          $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFromPath2
      required:
        - path0
        - path1
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFrom
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath0OneOf0SwapType:
      type: string
      enum:
        - attribute
      description: >-
        Specify a user attribute to use the value of the user attribute as the
        value to swap.
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath0OneOf0SwapType
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath00:
      type: object
      properties:
        swapType:
          $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath0OneOf0SwapType
          description: >-
            Specify a user attribute to use the value of the user attribute as
            the value to swap.
        userAttributeId:
          type: string
      required:
        - swapType
        - userAttributeId
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath00
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath0OneOf1SwapType:
      type: string
      enum:
        - exact
      description: Specify the value in the path to swap to
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath0OneOf1SwapType
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath01:
      type: object
      properties:
        swapType:
          $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath0OneOf1SwapType
          description: Specify the value in the path to swap to
        catalogObject:
          type: string
      required:
        - swapType
        - catalogObject
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath01
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath0OneOf2SwapType:
      type: string
      enum:
        - all
      description: Keep the current path value.
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath0OneOf2SwapType
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath02:
      type: object
      properties:
        swapType:
          $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath0OneOf2SwapType
          description: Keep the current path value.
      required:
        - swapType
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath02
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath0:
      oneOf:
        - $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath00
        - $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath01
        - $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath02
      description: >-
        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.
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath0
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath1OneOf0SwapType:
      type: string
      enum:
        - attribute
      description: >-
        Specify a user attribute to use the value of the user attribute as the
        value to swap.
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath1OneOf0SwapType
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath10:
      type: object
      properties:
        swapType:
          $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath1OneOf0SwapType
          description: >-
            Specify a user attribute to use the value of the user attribute as
            the value to swap.
        userAttributeId:
          type: string
      required:
        - swapType
        - userAttributeId
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath10
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath1OneOf1SwapType:
      type: string
      enum:
        - exact
      description: Specify the value in the path to swap to
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath1OneOf1SwapType
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath11:
      type: object
      properties:
        swapType:
          $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath1OneOf1SwapType
          description: Specify the value in the path to swap to
        catalogObject:
          type: string
      required:
        - swapType
        - catalogObject
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath11
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath1OneOf2SwapType:
      type: string
      enum:
        - all
      description: Keep the current path value.
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath1OneOf2SwapType
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath12:
      type: object
      properties:
        swapType:
          $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath1OneOf2SwapType
          description: Keep the current path value.
      required:
        - swapType
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath12
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath1:
      oneOf:
        - $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath10
        - $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath11
        - $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath12
      description: >-
        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.
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath1
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath2OneOf0SwapType:
      type: string
      enum:
        - attribute
      description: >-
        Specify a user attribute to use the value of the user attribute as the
        value to swap.
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath2OneOf0SwapType
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath20:
      type: object
      properties:
        swapType:
          $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath2OneOf0SwapType
          description: >-
            Specify a user attribute to use the value of the user attribute as
            the value to swap.
        userAttributeId:
          type: string
      required:
        - swapType
        - userAttributeId
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath20
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath2OneOf1SwapType:
      type: string
      enum:
        - exact
      description: Specify the value in the path to swap to
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath2OneOf1SwapType
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath21:
      type: object
      properties:
        swapType:
          $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath2OneOf1SwapType
          description: Specify the value in the path to swap to
        catalogObject:
          type: string
      required:
        - swapType
        - catalogObject
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath21
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath2OneOf2SwapType:
      type: string
      enum:
        - all
      description: Keep the current path value.
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath2OneOf2SwapType
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath22:
      type: object
      properties:
        swapType:
          $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath2OneOf2SwapType
          description: Keep the current path value.
      required:
        - swapType
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath22
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath2:
      oneOf:
        - $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath20
        - $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath21
        - $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath22
      description: >-
        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.
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath2
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsTo:
      type: object
      properties:
        path0:
          $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath0
          description: >-
            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.
        path1:
          $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath1
          description: >-
            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.
        path2:
          $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsToPath2
          description: >-
            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.
      required:
        - path0
        - path1
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsTo
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItems:
      type: object
      properties:
        from:
          $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsFrom
        to:
          $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItemsTo
      required:
        - from
        - to
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItems
    V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1Swaps:
      type: object
      properties:
        toConnection:
          $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsToConnection
        deploymentSwaps:
          type: array
          items:
            $ref: >-
              #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1SwapsDeploymentSwapsItems
      required:
        - toConnection
        - deploymentSwaps
      title: >-
        V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1Swaps
    SourceSwapPoliciesCreateSourceSwapPolicyRequest1:
      type: object
      properties:
        type:
          $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1Type
        name:
          type: string
          description: Name of the source swap policy.
        fromConnectionId:
          type: string
          description: ID of the connection to swap.
        swaps:
          $ref: >-
            #/components/schemas/V2SourceSwapPoliciesPostRequestBodyContentApplicationJsonSchemaOneOf1Swaps
      required:
        - type
        - name
        - fromConnectionId
        - swaps
      title: SourceSwapPoliciesCreateSourceSwapPolicyRequest1
    sourceSwapPolicies_createSourceSwapPolicy_Request:
      oneOf:
        - $ref: >-
            #/components/schemas/SourceSwapPoliciesCreateSourceSwapPolicyRequest0
        - $ref: >-
            #/components/schemas/SourceSwapPoliciesCreateSourceSwapPolicyRequest1
      title: sourceSwapPolicies_createSourceSwapPolicy_Request
    sourceSwapPolicies_createSourceSwapPolicy_Response_200:
      type: object
      properties:
        policyId:
          type: string
          description: Unique identifier of the source swap policy.
      required:
        - policyId
      description: Source Swap Policy Response
      title: sourceSwapPolicies_createSourceSwapPolicy_Response_200
  securitySchemes:
    OAuth:
      type: http
      scheme: bearer
      description: OAuth 2.0 authentication

```

## Examples



**Request**

```json
{
  "fromConnectionId": "string",
  "name": "string",
  "swaps": {
    "connectionSwaps": [
      {
        "to": {
          "path0": {
            "swapType": "attribute",
            "userAttributeId": "string"
          },
          "path1": {
            "swapType": "attribute",
            "userAttributeId": "string"
          }
        }
      }
    ]
  },
  "type": "connection"
}
```

**Response**

```json
{
  "policyId": "string"
}
```

**SDK Code**

```python
import requests

url = "https://api.sigmacomputing.com/v2/sourceSwapPolicies"

payload = {
    "fromConnectionId": "string",
    "name": "string",
    "swaps": { "connectionSwaps": [{ "to": {
                    "path0": {
                        "swapType": "attribute",
                        "userAttributeId": "string"
                    },
                    "path1": {
                        "swapType": "attribute",
                        "userAttributeId": "string"
                    }
                } }] },
    "type": "connection"
}
headers = {
    "Authorization": "<token>.",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.sigmacomputing.com/v2/sourceSwapPolicies';
const options = {
  method: 'POST',
  headers: {Authorization: '<token>.', 'Content-Type': 'application/json'},
  body: '{"fromConnectionId":"string","name":"string","swaps":{"connectionSwaps":[{"to":{"path0":{"swapType":"attribute","userAttributeId":"string"},"path1":{"swapType":"attribute","userAttributeId":"string"}}}]},"type":"connection"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.sigmacomputing.com/v2/sourceSwapPolicies"

	payload := strings.NewReader("{\n  \"fromConnectionId\": \"string\",\n  \"name\": \"string\",\n  \"swaps\": {\n    \"connectionSwaps\": [\n      {\n        \"to\": {\n          \"path0\": {\n            \"swapType\": \"attribute\",\n            \"userAttributeId\": \"string\"\n          },\n          \"path1\": {\n            \"swapType\": \"attribute\",\n            \"userAttributeId\": \"string\"\n          }\n        }\n      }\n    ]\n  },\n  \"type\": \"connection\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "<token>.")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.sigmacomputing.com/v2/sourceSwapPolicies")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = '<token>.'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"fromConnectionId\": \"string\",\n  \"name\": \"string\",\n  \"swaps\": {\n    \"connectionSwaps\": [\n      {\n        \"to\": {\n          \"path0\": {\n            \"swapType\": \"attribute\",\n            \"userAttributeId\": \"string\"\n          },\n          \"path1\": {\n            \"swapType\": \"attribute\",\n            \"userAttributeId\": \"string\"\n          }\n        }\n      }\n    ]\n  },\n  \"type\": \"connection\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.sigmacomputing.com/v2/sourceSwapPolicies")
  .header("Authorization", "<token>.")
  .header("Content-Type", "application/json")
  .body("{\n  \"fromConnectionId\": \"string\",\n  \"name\": \"string\",\n  \"swaps\": {\n    \"connectionSwaps\": [\n      {\n        \"to\": {\n          \"path0\": {\n            \"swapType\": \"attribute\",\n            \"userAttributeId\": \"string\"\n          },\n          \"path1\": {\n            \"swapType\": \"attribute\",\n            \"userAttributeId\": \"string\"\n          }\n        }\n      }\n    ]\n  },\n  \"type\": \"connection\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.sigmacomputing.com/v2/sourceSwapPolicies', [
  'body' => '{
  "fromConnectionId": "string",
  "name": "string",
  "swaps": {
    "connectionSwaps": [
      {
        "to": {
          "path0": {
            "swapType": "attribute",
            "userAttributeId": "string"
          },
          "path1": {
            "swapType": "attribute",
            "userAttributeId": "string"
          }
        }
      }
    ]
  },
  "type": "connection"
}',
  'headers' => [
    'Authorization' => '<token>.',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.sigmacomputing.com/v2/sourceSwapPolicies");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "<token>.");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"fromConnectionId\": \"string\",\n  \"name\": \"string\",\n  \"swaps\": {\n    \"connectionSwaps\": [\n      {\n        \"to\": {\n          \"path0\": {\n            \"swapType\": \"attribute\",\n            \"userAttributeId\": \"string\"\n          },\n          \"path1\": {\n            \"swapType\": \"attribute\",\n            \"userAttributeId\": \"string\"\n          }\n        }\n      }\n    ]\n  },\n  \"type\": \"connection\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "<token>.",
  "Content-Type": "application/json"
]
let parameters = [
  "fromConnectionId": "string",
  "name": "string",
  "swaps": ["connectionSwaps": [["to": [
          "path0": [
            "swapType": "attribute",
            "userAttributeId": "string"
          ],
          "path1": [
            "swapType": "attribute",
            "userAttributeId": "string"
          ]
        ]]]],
  "type": "connection"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.sigmacomputing.com/v2/sourceSwapPolicies")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```