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

# Create Custom Data Source

> Create a new datasource. Provisions a backing SQL table.

Slug/column-name format is validated by the request schema (clean 422). A duplicate slug or
name hits the unique constraint here; we return 409 rather than letting it surface as a 500.



## OpenAPI

````yaml /openapi-v1.json post /api/v1/custom-data-sources
openapi: 3.1.0
info:
  title: AGO Public API
  version: 1.0.0
  description: Programmatic access to your AGO workspace.
servers:
  - url: https://{tenant_id}.api.useago.com
    description: AGO Public API v1
    variables:
      tenant_id:
        default: your-tenant-id
        description: Your AGO tenant identifier
security: []
paths:
  /api/v1/custom-data-sources:
    post:
      tags:
        - Custom Data Sources
      summary: Create Custom Data Source
      description: >-
        Create a new datasource. Provisions a backing SQL table.


        Slug/column-name format is validated by the request schema (clean 422).
        A duplicate slug or

        name hits the unique constraint here; we return 409 rather than letting
        it surface as a 500.
      operationId: core_api_v1_controllers_custom_data_sources_create_custom_data_source
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomDataSourceCreateSchema'
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomDataSourceDetailSchema'
      security:
        - ScopedAPIKeyAuth: []
components:
  schemas:
    CustomDataSourceCreateSchema:
      properties:
        name:
          title: Name
          type: string
        slug:
          anyOf:
            - type: string
            - type: 'null'
          title: Slug
        description:
          default: ''
          title: Description
          type: string
        extraction_prompt:
          default: ''
          title: Extraction Prompt
          type: string
        schema_definition:
          $ref: '#/components/schemas/CustomDataSourceSchema'
        embedding_model_id:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
          title: Embedding Model Id
      required:
        - name
        - schema_definition
      title: CustomDataSourceCreateSchema
      type: object
    CustomDataSourceDetailSchema:
      properties:
        id:
          format: uuid
          title: Id
          type: string
        name:
          title: Name
          type: string
        slug:
          title: Slug
          type: string
        description:
          title: Description
          type: string
        extraction_prompt:
          title: Extraction Prompt
          type: string
        is_active:
          title: Is Active
          type: boolean
        schema_definition:
          $ref: '#/components/schemas/CustomDataSourceSchema'
        embedding_model_id:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
          title: Embedding Model Id
        created_at:
          format: date-time
          title: Created At
          type: string
        updated_at:
          format: date-time
          title: Updated At
          type: string
      required:
        - id
        - name
        - slug
        - description
        - extraction_prompt
        - is_active
        - schema_definition
        - embedding_model_id
        - created_at
        - updated_at
      title: CustomDataSourceDetailSchema
      type: object
    CustomDataSourceSchema:
      description: >-
        Schema of a custom datasource: its columns, search config, and display
        field.
      properties:
        columns:
          items:
            $ref: '#/components/schemas/ColumnDefinition'
          maxItems: 200
          title: Columns
          type: array
        searchable_fields:
          description: >-
            Custom column names whose values are concatenated into
            searchable_text for embedding.
          items:
            type: string
          title: Searchable Fields
          type: array
        label_field:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Custom column name used as the human-readable label in UIs and agent
            outputs.
          title: Label Field
      title: CustomDataSourceSchema
      type: object
    ColumnDefinition:
      properties:
        name:
          title: Name
          type: string
        type:
          $ref: '#/components/schemas/CustomColumnType'
        nullable:
          default: true
          title: Nullable
          type: boolean
        indexed:
          default: false
          title: Indexed
          type: boolean
      required:
        - name
        - type
      title: ColumnDefinition
      type: object
    CustomColumnType:
      description: Whitelist of column types a tenant can define on a custom datasource.
      enum:
        - text
        - integer
        - bigint
        - numeric
        - boolean
        - date
        - timestamp
        - text_array
      title: CustomColumnType
      type: string
  securitySchemes:
    ScopedAPIKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````