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

# Create a data source

> Create a data source.



## OpenAPI

````yaml /api-reference/datacatalog.yml put /catalog/v1/sources/{sourceKey}
openapi: 3.0.1
info:
  title: Data Catalog API
  version: 1.0.0
servers:
  - url: https://api.{workspaceId}.clinia.cloud
    variables:
      workspaceId:
        default: ''
        description: The workspace id.
security:
  - apiKey: []
  - basicHttpAuth: []
  - bearerHttpAuth: []
tags:
  - name: Partitions
    description: Management of data partitions.
  - name: Sources
    description: Management of data sources.
paths:
  /catalog/v1/sources/{sourceKey}:
    put:
      tags:
        - Sources
      summary: Create a data source
      description: Create a data source.
      operationId: CreateDataSource
      parameters:
        - name: sourceKey
          in: path
          description: >
            Key of the data source, it must follow pattern:
            `^[a-zA-Z0-9-][\w-]{0,61}$`.
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/v1DataSource'
      responses:
        '201':
          description: A successful response when the data source was created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1DataSource'
        '400':
          description: Returned when the request is malformed or invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1Error'
        '409':
          description: Returned when the data source already exists.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1Error'
        '413':
          $ref: '#/components/responses/v1PayloadTooLargeError'
        '429':
          $ref: '#/components/responses/v1TooManyRequestError'
        '504':
          $ref: '#/components/responses/v1GatewayTimeoutError'
components:
  schemas:
    v1DataSource:
      type: object
      required:
        - type
      properties:
        key:
          type: string
          readOnly: true
        type:
          $ref: '#/components/schemas/v1DataSourceType'
      additionalProperties: false
    v1Error:
      type: object
      required:
        - code
        - message
        - type
      properties:
        code:
          $ref: '#/components/schemas/v1ErrorCode'
        message:
          type: string
        type:
          $ref: '#/components/schemas/v1ErrorType'
        details:
          description: list of errors that occurred if applicable.
          type: array
          items:
            $ref: '#/components/schemas/v1Error'
        additionalContext:
          type: object
          additionalProperties: true
    v1DataSourceType:
      type: string
      default: registry
      enum:
        - registry
    v1ErrorCode:
      type: integer
      format: int32
      enum:
        - 400
        - 401
        - 403
        - 404
        - 408
        - 409
        - 413
        - 429
        - 500
        - 501
        - 504
    v1ErrorType:
      type: string
      enum:
        - ALREADY_EXISTS
        - FAILED_PRECONDITION
        - INTERNAL
        - INVALID_ARGUMENT
        - NOT_FOUND
        - OUT_OF_RANGE
        - UNIMPLEMENTED
        - PERMISSION_DENIED
        - UNAUTHENTICATED
        - CONTENT_TOO_LARGE
        - REQUEST_TIMEOUT
        - TOO_MANY_REQUEST
        - GATEWAY_TIMEOUT
  responses:
    v1PayloadTooLargeError:
      description: Returned when the payload exceeds the max content size (100kB).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/v1Error'
    v1TooManyRequestError:
      description: Returned when the server starts throttling the requests.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/v1Error'
    v1GatewayTimeoutError:
      description: Returned when the request exceeds the server timeout window.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/v1Error'
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-Clinia-API-Key
    basicHttpAuth:
      description: Basic HTTP authentication.
      type: http
      scheme: basic
    bearerHttpAuth:
      description: JWT Bearer authentication.
      type: http
      scheme: Bearer
      bearerFormat: JWT

````