> ## Documentation Index
> Fetch the complete documentation index at: https://nango.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Create sync variant

> Creates a new sync variant for a specific connection

<Info>
  Requires an API key with the `environment:syncs:variant:create` scope. [Learn more about API key scopes](/reference/backend/http-api/api-keys#scopes).
</Info>

## Creating a sync variant

Sync variants allow you to create different configurations of the same sync for a specific connection. This is useful when you need to sync the same data with different settings or filters.

### Key features

* Each variant operates independently with its own sync schedule
* Variants can be queried separately through the records endpoint using the `variant` query parameter
* Cannot use "base" as a variant name (protected)

After creating a variant, you can use the `/records` endpoint to access its data by specifying the variant query parameter:

```
GET /records?model=MyModel&variant=MyVariant
```


## OpenAPI

````yaml POST /sync/{name}/variant/{variant}
openapi: 3.1.0
info:
  title: Nango API
  description: Nango API specs used to authorize & sync data with external APIs.
  version: 1.0.0
servers:
  - url: https://api.nango.dev
    description: Production server
  - url: http://localhost:3003
    description: Local server
security:
  - bearerAuth: []
externalDocs:
  url: https://nango.dev/docs/reference/backend/http-api/authentication
paths:
  /sync/{name}/variant/{variant}:
    post:
      summary: Create sync variant
      description: Creates a new sync variant for a specific connection
      parameters:
        - name: name
          in: path
          required: true
          schema:
            type: string
          description: The name of the sync
        - name: variant
          in: path
          required: true
          schema:
            type: string
          description: >-
            The name of the variant to create. Cannot be "base" (protected
            name).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - provider_config_key
                - connection_id
              properties:
                provider_config_key:
                  type: string
                  description: The integration ID used when creating the connection
                connection_id:
                  type: string
                  description: The ID of the connection to create the sync variant for
      responses:
        '200':
          description: Successfully created the sync variant
          content:
            application/json:
              schema:
                type: object
                required:
                  - id
                  - name
                  - variant
                properties:
                  id:
                    type: string
                    description: The unique identifier for the created sync variant
                  name:
                    type: string
                    description: The name of the sync
                  variant:
                    type: string
                    description: The name of the variant
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - invalid_body
                          - invalid_uri_params
                          - invalid_query_params
                          - invalid_variant
                          - unknown_connection
                          - unknown_provider_config
                          - unknown_sync
                          - sync_variant_already_exists
                          - resource_capped
                          - feature_disabled
                      message:
                        type: string
                      errors:
                        type: array
                        items:
                          type: object
        '500':
          description: Server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - failed_sync_variant_creation
                      message:
                        type: string
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: The secret key from your Nango environment.

````