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

# Update data source catalog

> Changes the AI context (`description`), display names and visibility of a data source's schemas, tables and columns. Requires admin access to the organization.

Name each object by its schema, table and column names exactly as in the database (as listed by the catalog endpoint), and send only the fields to change. A batch takes at most 1000 changes and applies as a whole: if any change is refused, nothing changes.

By default an object the last sync did not find refuses the batch with a 400; send `onMissing: "skip"` to change the others and get `missing` for it. Run a schema sync first to pick up new objects.

To avoid overwriting a description someone else changed since you read it, send the value you read as `expectedDescription`; if any object has another description the batch fails with a 409.

Hiding a schema hides its tables from members and AI, and hiding a table hides its columns. Descriptions longer than AI uses are refused.



## OpenAPI

````yaml https://charts.basedash.com/api/public/openapi patch /api/public/organizations/{orgId}/data-sources/{id}/catalog
openapi: 3.1.0
info:
  title: Basedash Public API
  version: 0.0.0
  description: >-
    API for programmatic access to Basedash features. Use API keys for
    authentication. Send request bodies as JSON with `Content-Type:
    application/json`; other content types are rejected with a 415 (file uploads
    use `multipart/form-data`).
  contact:
    name: Basedash Support
    url: https://basedash.com
    email: support@basedash.com
servers:
  - url: https://charts.basedash.com
    description: Production
security: []
tags:
  - name: Organizations
    description: Manage organizations
  - name: Groups
    description: Manage organization groups and memberships
  - name: Data Sources
    description: Manage database connections and data sources
  - name: MCP servers
    description: Manage MCP server data sources
  - name: Insights
    description: Manage generated insights
  - name: Automations
    description: Manage automations and automation runs
  - name: Skills
    description: Manage organization skills
  - name: Models
    description: Manage reusable SQL models
  - name: Dashboards
    description: Manage dashboards and their tabs
  - name: Charts
    description: Manage charts and their SQL queries
  - name: Chats
    description: >-
      Chat with the Basedash AI agent about your data. Start a chat by sending a
      message, then continue the conversation with follow-up messages. The
      assistant responds asynchronously: pass the `wait` query parameter to
      receive the finished response in the same request, or poll the assistant
      message (or stream its events) after an HTTP 202. Chats created through
      the API are not shown in the Basedash app.
paths:
  /api/public/organizations/{orgId}/data-sources/{id}/catalog:
    patch:
      tags:
        - Data Sources
      summary: Update data source catalog
      description: >-
        Changes the AI context (`description`), display names and visibility of
        a data source's schemas, tables and columns. Requires admin access to
        the organization.


        Name each object by its schema, table and column names exactly as in the
        database (as listed by the catalog endpoint), and send only the fields
        to change. A batch takes at most 1000 changes and applies as a whole: if
        any change is refused, nothing changes.


        By default an object the last sync did not find refuses the batch with a
        400; send `onMissing: "skip"` to change the others and get `missing` for
        it. Run a schema sync first to pick up new objects.


        To avoid overwriting a description someone else changed since you read
        it, send the value you read as `expectedDescription`; if any object has
        another description the batch fails with a 409.


        Hiding a schema hides its tables from members and AI, and hiding a table
        hides its columns. Descriptions longer than AI uses are refused.
      parameters:
        - schema:
            type: string
            description: Organization ID
          required: true
          description: Organization ID
          name: orgId
          in: path
        - schema:
            type: string
            description: Data source ID
          required: true
          description: Data source ID
          name: id
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCatalogInput'
      responses:
        '200':
          description: Catalog updated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/UpdateCatalogResponse'
                required:
                  - data
        '400':
          description: >-
            Bad request - Invalid JSON body, validation error, or an object the
            last sync did not find (unless onMissing is skip)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized - Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found - Data source not found or no admin access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '415':
          description: Unsupported media type - Content-Type must be application/json
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded - Too many requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    UpdateCatalogInput:
      type: object
      properties:
        changes:
          type: array
          items:
            type: object
            properties:
              schemaName:
                type: string
                minLength: 1
                description: Schema name, exactly as in the database.
              tableName:
                type: string
                minLength: 1
                description: >-
                  Table name, exactly as in the database. Leave out to change
                  the schema.
              columnName:
                type: string
                minLength: 1
                description: >-
                  Column name, exactly as in the database. Needs `tableName`.
                  Leave out to change the table.
              description:
                type: string
                maxLength: 20000
                description: >-
                  Context AI uses when it queries the object. Empty clears it.
                  Comments from the database are kept apart and never changed.
              expectedDescription:
                type: string
                description: >-
                  The description the object should have now. When it has
                  another, nothing in the batch changes. Needs `description`.
              displayName:
                type: string
                minLength: 1
                description: >-
                  The name shown in Basedash instead of its database name.
                  Tables and columns only.
              visible:
                type: boolean
                description: >-
                  Whether members see it and AI can use it. Hiding a schema
                  hides its tables; hiding a table hides its columns.
            required:
              - schemaName
            additionalProperties: false
          minItems: 1
          maxItems: 1000
          description: >-
            The objects to change, each named by its database names, and what to
            change on each. Fields left out keep their value
        onMissing:
          type: string
          enum:
            - error
            - skip
          description: >-
            What to do with an object the data source has no synced schema,
            table or column for: `error` (the default) refuses the batch, `skip`
            leaves it out.
      required:
        - changes
      additionalProperties: false
    UpdateCatalogResponse:
      type: object
      properties:
        changes:
          type: array
          items:
            type: object
            properties:
              kind:
                type: string
                enum:
                  - schema
                  - table
                  - column
                description: Whether the object is a schema, table or column
              id:
                type:
                  - string
                  - 'null'
                description: Object ID; null for a missing object
              schemaName:
                type: string
              tableName:
                type:
                  - string
                  - 'null'
              columnName:
                type:
                  - string
                  - 'null'
              outcome:
                type: string
                enum:
                  - updated
                  - unchanged
                  - missing
                description: >-
                  updated: something changed. unchanged: it already had these
                  values. missing: no synced object has this name, and onMissing
                  was skip
            required:
              - kind
              - id
              - schemaName
              - tableName
              - columnName
              - outcome
          description: One entry per change, in the order sent
      required:
        - changes
    ErrorResponse:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/ApiError'
      required:
        - error
    RateLimitErrorResponse:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/RateLimitError'
      required:
        - error
    ApiError:
      type: object
      properties:
        title:
          type: string
          description: Error type identifier
        detail:
          type: string
          description: Human-readable error description
        code:
          type: string
          description: >-
            Stable machine-readable code when the error has one.
            `ip_not_allowed` means the organization only allows access from
            approved IP addresses and the caller’s address is not one.
        ip:
          type:
            - string
            - 'null'
          description: >-
            With `ip_not_allowed`: the caller’s IP address as Basedash saw it,
            which an organization admin can add under Settings → Security →
            Network access.
      required:
        - title
        - detail
    RateLimitError:
      allOf:
        - $ref: '#/components/schemas/ApiError'
        - type: object
          properties:
            title:
              type: string
              enum:
                - RateLimitExceeded
            retryAfterMs:
              type: number
              description: Milliseconds until the rate limit window resets
          required:
            - retryAfterMs
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key authentication using Bearer token format: `Bearer
        <basedash_api_key>`

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.