> ## 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 access

> Replaces the access policy for a data source. Use mode "everyone" to allow all organization members to query it, or mode "restricted" with groupIds and/or memberIds to limit query access. Requires admin access to the organization.



## OpenAPI

````yaml https://charts.basedash.com/api/public/openapi put /api/public/organizations/{orgId}/data-sources/{id}/access
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.
  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: Definitions
    description: Manage reusable SQL definitions
paths:
  /api/public/organizations/{orgId}/data-sources/{id}/access:
    put:
      tags:
        - Data Sources
      summary: Update data source access
      description: >-
        Replaces the access policy for a data source. Use mode "everyone" to
        allow all organization members to query it, or mode "restricted" with
        groupIds and/or memberIds to limit query access. Requires admin access
        to the organization.
      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/UpdateDataSourceAccessInput'
      responses:
        '200':
          description: Data source access updated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/DataSourceAccessResponse'
                required:
                  - data
        '400':
          description: Bad request - Invalid JSON body or validation error
          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, group, or member not found or no admin
            access
          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:
    UpdateDataSourceAccessInput:
      oneOf:
        - type: object
          properties:
            mode:
              type: string
              enum:
                - everyone
            groupIds:
              type: array
              items:
                type: string
              default: []
              description: Organization group IDs that can query the data source
            memberIds:
              type: array
              items:
                type: string
              default: []
              description: Organization member IDs that can query the data source
          required:
            - mode
        - type: object
          properties:
            mode:
              type: string
              enum:
                - restricted
            groupIds:
              type: array
              items:
                type: string
              default: []
              description: Organization group IDs that can query the data source
            memberIds:
              type: array
              items:
                type: string
              default: []
              description: Organization member IDs that can query the data source
          required:
            - mode
    DataSourceAccessResponse:
      type: object
      properties:
        dataSourceId:
          type: string
          description: Data source ID
        mode:
          type: string
          enum:
            - everyone
            - restricted
          description: Whether everyone or only listed principals can query
        groupIds:
          type: array
          items:
            type: string
          description: Organization group IDs with access when mode is restricted
        memberIds:
          type: array
          items:
            type: string
          description: Organization member IDs with access when mode is restricted
      required:
        - dataSourceId
        - mode
        - groupIds
        - memberIds
    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
      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>`

````