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

# Create Integration

> Create a new integration with any supported connector

This endpoint allows you to create a new integration between a source and destination. The integration configuration varies based on the connector type you're using.

## Connector-Specific Configuration

Select your connector type to see its specific configuration requirements:

<CardGroup cols={3}>
  <Card title="PostgreSQL" icon="https://mintcdn.com/matia/IP88-FcBn7avJHr6/images/connectors/postgres.svg?fit=max&auto=format&n=IP88-FcBn7avJHr6&q=85&s=24c29f025de016a37c061572a29051c3" href="/api-reference/integrations/connectors/postgres" width="40" height="40" data-path="images/connectors/postgres.svg">
    Connect to PostgreSQL databases
  </Card>

  <Card title="Google Analytics 4" icon="https://mintcdn.com/matia/IP88-FcBn7avJHr6/images/connectors/google-analytics.svg?fit=max&auto=format&n=IP88-FcBn7avJHr6&q=85&s=42a4cb757c4db66150a49ea8bbbc4a57" href="/api-reference/integrations/connectors/google-analytics-4" width="192" height="192" data-path="images/connectors/google-analytics.svg">
    Connect to Google Analytics 4
  </Card>

  <Card title="Connector Library" icon="list" href="/api-reference/integrations/connectors">
    View all supported connectors
  </Card>
</CardGroup>


## OpenAPI

````yaml POST /integrations
openapi: 3.0.1
info:
  title: OpenAPI Matia
  description: Matia API using the OpenAPI specification
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.matia.io/v1
security:
  - ApiKeyAuth: []
paths:
  /integrations:
    post:
      summary: Create a new integration
      requestBody:
        content:
          application/json:
            schema:
              discriminator:
                propertyName: type
                mapping:
                  postgres:
                    $ref: '#/components/schemas/PostgresConnector'
                  google_analytics_4:
                    $ref: '#/components/schemas/GoogleAnalytics4Connector'
              oneOf:
                - $ref: '#/components/schemas/PostgresConnector'
                - $ref: '#/components/schemas/GoogleAnalytics4Connector'
      responses:
        '201':
          description: Integration created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NewIntegration'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    PostgresConnector:
      title: Postgres Connector
      allOf:
        - $ref: '#/components/schemas/ConnectorBase'
        - type: object
          required:
            - onSchemaUpdate
            - sourceConfig
            - sourceSettings
          properties:
            onSchemaUpdate:
              type: string
            sourceConfig:
              type: object
              required:
                - type
                - name
                - authMethod
                - connection
                - connectionType
                - owners
              properties:
                type:
                  type: string
                  enum:
                    - postgres
                name:
                  type: string
                authMethod:
                  type: string
                connection:
                  type: object
                  properties:
                    username:
                      type: string
                    password:
                      type: string
                    hostname:
                      type: string
                    port:
                      type: integer
                    database:
                      type: string
                    slot:
                      type: string
                    publication:
                      type: string
                connectionType:
                  type: string
                owners:
                  type: array
                  items:
                    type: string
            sourceSettings:
              type: object
              properties:
                max_clients:
                  type: integer
                incremental_mode:
                  type: string
    GoogleAnalytics4Connector:
      title: Google Analytics 4 Connector
      allOf:
        - $ref: '#/components/schemas/ConnectorBase'
        - type: object
          required:
            - sourceConfig
            - sourceSettings
          properties:
            sourceConfig:
              type: object
              required:
                - type
                - name
                - connection
                - connectionType
                - owners
              properties:
                type:
                  type: string
                  enum:
                    - google_analytics_4
                name:
                  type: string
                connection:
                  type: object
                  properties:
                    refresh_token:
                      type: string
                    client_id:
                      type: string
                    client_secret:
                      type: string
                    rollback:
                      type: integer
                connectionType:
                  type: string
                owners:
                  type: array
                  items:
                    type: string
            sourceSettings:
              type: object
              properties:
                account:
                  type: string
                properties:
                  type: array
                  items:
                    type: string
                customReports:
                  type: array
                  items:
                    type: string
    NewIntegration:
      allOf:
        - $ref: '#/components/schemas/SyncIntegrationApiResponse'
        - required:
            - id
          type: object
          properties:
            id:
              description: Identification number of the integration
              type: integer
              format: int64
    Error:
      required:
        - error
        - message
      type: object
      properties:
        code:
          type: string
        message:
          type: string
    ConnectorBase:
      title: Connector Base
      type: object
      required:
        - destinationId
        - destinationSchema
        - replicationFrequency
        - enabled
      properties:
        destinationId:
          type: string
        destinationSchema:
          type: string
        replicationFrequency:
          type: string
        onSchemaUpdate:
          type: string
        enabled:
          type: boolean
    SyncIntegrationApiResponse:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
        data:
          type: object
          properties:
            id:
              type: string
              description: ID of the integration that was ran
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````