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

# Add SQL Server connection

> Create a new Microsoft SQL Server database connection.



## OpenAPI

````yaml https://api.camelai.com/api/schema/ post /api/v1/sources/add/mssql/
openapi: 3.0.3
info:
  title: camelAI API
  version: 1.0.0 (v1)
  description: API for camelAI - AI-powered data analytics platform
servers:
  - url: https://api.camelai.com
    description: camelAI API server
security: []
paths:
  /api/v1/sources/add/mssql/:
    post:
      tags:
        - sources
      summary: Add SQL Server connection
      description: Create a new Microsoft SQL Server database connection.
      operationId: sources_add_mssql_create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MSSQLConnectionRequest'
            examples:
              SQLServer:
                value:
                  type: mssql
                  hostname: localhost
                  port: 1433
                  username: sa
                  password: Password123!
                  database_name: master
                summary: Microsoft SQL Server database connection
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: integer
                    description: The ID of the created connection
          description: ''
        '400':
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error message
                  errors:
                    type: object
                    description: Field-specific validation errors
          description: ''
      security:
        - ApiKeyAuth: []
components:
  schemas:
    MSSQLConnectionRequest:
      type: object
      description: Serializer for Microsoft SQL Server connection configuration.
      properties:
        type:
          type: string
          minLength: 1
          description: Connection type identifier. Must be `MSSQL`
        account_name:
          type: string
          minLength: 1
          default: SQL Server
          description: Display name for the connection
        hostname:
          type: string
          minLength: 1
          description: SQL Server hostname
          maxLength: 255
        port:
          type: integer
          default: 1433
          description: Port number
        username:
          type: string
          minLength: 1
          description: Database username
          maxLength: 255
        password:
          type: string
          writeOnly: true
          minLength: 1
          description: Database password
        database_name:
          type: string
          minLength: 1
          description: Database name
          maxLength: 255
        connection_string:
          type: string
          minLength: 1
          description: 'Alternative: ODBC connection string instead of individual parameters'
      required:
        - type
      title: SQL Server
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      description: API key authentication using Bearer scheme

````