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

# Create Source

> Create a new source



## OpenAPI

````yaml https://api.hightouch.io/api/swagger.json post /sources
openapi: 3.0.0
info:
  title: Hightouch API
  version: 1.0.0
  description: Hightouch Public Rest API to access syncs, models, sources and destinations
  contact:
    name: Hightouch
    url: https://hightouch.com
servers:
  - url: https://api.hightouch.com/api/v1
security: []
paths:
  /sources:
    post:
      summary: Create Source
      description: Create a new source
      operationId: CreateSource
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SourceCreate'
            example:
              name: postgres-connection2
              slug: postgres-connection2
              type: postgres
              configuration:
                host: example.example.us-east-1.rds.amazonaws.com
                port: '5432'
                user: dbUserName
                database: dbName
                password: password!123
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/Source'
                  - $ref: '#/components/schemas/ValidateErrorJSON'
                  - $ref: '#/components/schemas/InternalServerError'
              examples:
                Example 1:
                  value:
                    id: 426
                    name: postgres-connection2
                    slug: postgres-connection2
                    workspaceId: 1
                    createdAt: '2022-12-12T22:46:57.618Z'
                    updatedAt: '2022-12-12T22:46:57.618Z'
                    type: postgres
                    configuration:
                      host: example.example.us-east-1.rds.amazonaws.com
                      port: '5432'
                      user: dbUserName
                      database: dbName
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidateErrorJSON'
        '422':
          description: Validation Failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidateErrorJSON'
        '500':
          description: Something went wrong
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerError'
      security:
        - bearerAuth: []
components:
  schemas:
    SourceCreate:
      description: The input for creating a Source
      properties:
        name:
          type: string
          description: The source's name
        slug:
          type: string
          description: The source's slug
        type:
          type: string
          description: The source's type (e.g. snowflake or postgres).
        configuration:
          properties: {}
          additionalProperties: {}
          type: object
          description: >-
            The source's configuration. This specifies general metadata about
            sources, like connection details

            Hightouch will use this configuration to connect to underlying
            source.


            The schema depends on the source type.


            Consumers should NOT make assumptions on the contents of the

            configuration. It may change as Hightouch updates its internal code.
      required:
        - name
        - slug
        - type
        - configuration
      type: object
      additionalProperties: false
    Source:
      description: >-
        The database or warehouse where your data is stored. The starting point
        for

        a Hightouch data pipeline.
      properties:
        id:
          type: number
          format: double
          description: The source's id
        name:
          type: string
          description: The source's name
        slug:
          type: string
          description: The source's slug
        workspaceId:
          type: number
          format: double
          description: The id of the workspace that the source belongs to
        createdAt:
          type: string
          format: date-time
          description: The timestamp when the source was created
        updatedAt:
          type: string
          format: date-time
          description: The timestamp when the source was last updated
        configuration:
          properties: {}
          additionalProperties: {}
          type: object
          description: >-
            The source's configuration. This specifies general metadata about
            sources, like connection details

            Hightouch will use this configuration to connect to underlying
            source.


            The schema depends on the source type.


            Consumers should NOT make assumptions on the contents of the

            configuration. It may change as Hightouch updates its internal code.
        type:
          type: string
          description: The source's type (e.g. snowflake or postgres).
      required:
        - id
        - name
        - slug
        - workspaceId
        - createdAt
        - updatedAt
        - configuration
        - type
      type: object
      additionalProperties: false
    ValidateErrorJSON:
      properties:
        message:
          type: string
          enum:
            - Validation failed
          nullable: false
        details:
          properties: {}
          additionalProperties: {}
          type: object
      required:
        - message
        - details
      type: object
      additionalProperties: false
    InternalServerError:
      type: string
      enum:
        - Internal Server Error
      nullable: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Bearer

````