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

# Create Parametric Table

> Creates a new Parametric Table under the specified catalog. A Parametric Table binds specific query parameter values to a source table from a REST catalog, producing a new named table (e.g., <code>xyz_customers</code>) that can be queried directly without supplying those parameters at query time. For example, if the source table <code>customers</code> requires a <code>_q_account</code> parameter, you can create a Parametric Table that fixes this value and exposes the result as a standalone table.

<span style={{display: "flex", gap: "10px", flexDirection: "row", alignItems: "center"}}>
  <img src="https://cdn.peaka.com/badges/partner-api-key-badge.png" />

  <img src="https://cdn.peaka.com/badges/project-api-key-badge.png" />
</span>


## OpenAPI

````yaml post /data/projects/{projectId}/catalogs/{catalogId}/parametricTables
openapi: 3.0.1
info:
  title: Peaka Gateway API
  description: Peaka Gateway API Documentation
  version: '1.0'
servers:
  - url: https://partner.peaka.studio/api/v1
    description: Default Server URL (US Zone)
  - url: https://partner.eu.peaka.studio/api/v1
    description: EU Zone
security:
  - bearerAuth: []
paths:
  /data/projects/{projectId}/catalogs/{catalogId}/parametricTables:
    post:
      tags:
        - Data -- Parametric Tables
      summary: Create Parametric Table
      description: >-
        Creates a new Parametric Table under the specified catalog. A Parametric
        Table binds specific query parameter values to a source table from a
        REST catalog, producing a new named table (e.g.,
        <code>xyz_customers</code>) that can be queried directly without
        supplying those parameters at query time. For example, if the source
        table <code>customers</code> requires a <code>_q_account</code>
        parameter, you can create a Parametric Table that fixes this value and
        exposes the result as a standalone table.
      operationId: createParametricTable
      parameters:
        - name: projectId
          in: path
          description: ID of the project
          required: true
          schema:
            type: string
          example: mtKDhe1U
        - name: catalogId
          in: path
          description: ID of the catalog
          required: true
          schema:
            type: string
          example: 846085284821991600
      requestBody:
        description: Parametric Table definition
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ParametricTable'
            examples:
              Create Parametric Table Example:
                description: Create Parametric Table Example
                value:
                  fromSchema: public
                  fromTable: customers
                  toSchema: public
                  toTable: xyz_customers
                  paramValues:
                    - key: _q_account
                      value: acme-corp
        required: true
      responses:
        '200':
          description: Parametric table created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ParametricTable'
              examples:
                Created Table:
                  description: Created Table
                  value:
                    fromSchema: public
                    fromTable: products
                    toSchema: analytics
                    toTable: param_products
                    paramValues:
                      - key: country
                        value: US
                      - key: year
                        value: 2024
        '400':
          description: Target table already exists
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ParametricTable'
components:
  schemas:
    ParametricTable:
      type: object
      properties:
        fromSchema:
          type: string
          description: Schema of the base table
        fromTable:
          type: string
          description: Name of the base table
        toSchema:
          type: string
          description: Schema of the target table
        toTable:
          type: string
          description: Name of the target table
        paramValues:
          type: array
          description: List of parametric columns
          items:
            $ref: '#/components/schemas/ParametricTableColumn'
    ParametricTableColumn:
      type: object
      properties:
        key:
          type: string
          description: Column name
        value:
          type: object
          description: Column value
      description: Parametric table column
  securitySchemes:
    bearerAuth:
      type: http
      description: >-
        Use the Authorization header with the value 'Bearer <apiKey>' to
        authenticate. Partner API Keys have full access; Project API Keys are
        limited to their project scope. Learn more:
        https://docs.peaka.com/api-reference/authentication
      scheme: bearer
      bearerFormat: Api Key

````