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

# Create a Variable Binding

> Create a variable binding



## OpenAPI

````yaml POST /team/{team_id}/datasets/{dataset_id}/dataRequests/{id}/variableBindings
openapi: 3.0.1
info:
  title: Chartbrew API reference
  description: The OpenAPI specification for Chartbrew
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.chartbrew.com
security:
  - bearerAuth: []
paths:
  /team/{team_id}/datasets/{dataset_id}/dataRequests/{id}/variableBindings:
    post:
      summary: Create a new variable binding
      parameters:
        - name: team_id
          in: path
          required: true
          schema:
            type: integer
        - name: dataset_id
          in: path
          required: true
          schema:
            type: integer
        - name: id
          in: path
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VariableBinding'
      responses:
        '200':
          description: Variable binding created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataRequest'
      security:
        - bearerAuth: []
components:
  schemas:
    VariableBinding:
      type: object
      properties:
        id:
          type: integer
        entity_type:
          type: string
          enum:
            - Project
            - Connection
            - Dataset
            - DataRequest
            - Template
        entity_id:
          type: string
        name:
          type: string
        type:
          type: string
        default_value:
          type: string
        required:
          type: boolean
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    DataRequest:
      type: object
      properties:
        id:
          type: integer
        dataset_id:
          type: integer
          description: Reference to Dataset model
        connection_id:
          type: integer
          description: Reference to Connection model
        method:
          type: string
          enum:
            - GET
            - POST
            - PUT
            - DELETE
            - PATCH
        route:
          type: string
          description: API endpoint path
        headers:
          type: array
          items:
            type: object
            properties:
              key:
                type: string
              value:
                type: string
        body:
          type: string
          description: Request body in JSON string format
        useGlobalHeaders:
          type: boolean
          default: true
        query:
          type: string
        pagination:
          type: boolean
          default: false
        items:
          type: string
          default: items
          description: Path to items array in response
        itemsLimit:
          type: integer
          default: 0
          description: Maximum number of items to return
        offset:
          type: string
          default: offset
          description: Pagination offset field name
        paginationField:
          type: string
          description: Field used for pagination
        template:
          type: string
          description: Template type for request formatting
        conditions:
          type: array
          items:
            type: object
            properties:
              field:
                type: string
              value:
                type: string
              operator:
                type: string
                enum:
                  - '='
                  - '!='
                  - '>'
                  - <
                  - '>='
                  - <=
                  - LIKE
                  - IS NULL
                  - IS NOT NULL
        configuration:
          $ref: '#/components/schemas/DataRequestConfiguration'
        variables:
          type: object
          description: Request variables
          additionalProperties: true
        Connection:
          type: object
          properties:
            id:
              type: integer
            name:
              type: string
            type:
              type: string
            subType:
              type: string
            host:
              type: string
        VariableBindings:
          type: array
          items:
            $ref: '#/components/schemas/VariableBinding'
    DataRequestConfiguration:
      type: object
      description: >-
        Configuration options for data requests. Fields vary by connection type.
        Only include fields relevant to your connection type.
      properties:
        populateAttributes:
          type: boolean
          description: Populate attributes for Customer.io
        mainCollectionSample:
          type: string
          description: Main collection sample for Firestore
        subCollectionSample:
          type: string
          description: Sub collection sample for Firestore
        selectedSubCollection:
          type: string
          description: Selected sub collection for Firestore
        limit:
          type: number
          description: Limit for Firestore
        orderBy:
          type: string
          description: Order by field for Firestore
        orderByDirection:
          type: string
          enum:
            - asc
            - desc
          description: Order by direction for Firestore
        accountId:
          type: string
          description: Account ID for Google Analytics
        propertyId:
          type: string
          description: Property ID for Google Analytics
        metrics:
          type: string
          description: Metrics for Google Analytics
        dimensions:
          type: string
          description: Dimensions for Google Analytics
        startDate:
          type: string
          description: Start date for Google Analytics
        endDate:
          type: string
          description: End date for Google Analytics
        limitToLast:
          type: number
          description: Limit to last for RealtimeDB
        limitToFirst:
          type: number
          description: Limit to first for RealtimeDB
      additionalProperties: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````