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

# Get data source access

> Retrieves the access policy for a data source: who can query it, and the schema, table, and column rules on it. The response can be sent back to the update endpoint unchanged. Requires admin access to the organization.



## OpenAPI

````yaml https://charts.basedash.com/api/public/openapi get /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: 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}/access:
    get:
      tags:
        - Data Sources
      summary: Get data source access
      description: >-
        Retrieves the access policy for a data source: who can query it, and the
        schema, table, and column rules on it. The response can be sent back to
        the update endpoint unchanged. 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
      responses:
        '200':
          description: Data source access retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/DataSourceAccessResponse'
                required:
                  - data
        '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'
        '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:
    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
        accessLevel:
          type:
            - string
            - 'null'
          enum:
            - VIEW
            - EDIT
            - null
          description: Everyone access level when mode is everyone
        groupIds:
          type: array
          items:
            type: string
          description: >-
            Deprecated. Organization group IDs with view or edit access when
            mode is restricted. Use groupAccess for access levels.
        memberIds:
          type: array
          items:
            type: string
          description: >-
            Deprecated. Organization member IDs with view or edit access when
            mode is restricted. Use memberAccess for access levels.
        groupAccess:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                description: Organization group or member ID
              accessLevel:
                type: string
                enum:
                  - VIEW
                  - EDIT
                default: VIEW
                description: Whether the principal can view or edit the data source
            required:
              - id
          description: Organization groups with view or edit access
        memberAccess:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                description: Organization group or member ID
              accessLevel:
                type: string
                enum:
                  - VIEW
                  - EDIT
                default: VIEW
                description: Whether the principal can view or edit the data source
            required:
              - id
          description: Organization members with view or edit access
        objects:
          type: array
          items:
            type: object
            properties:
              schemaName:
                type: string
                description: Schema name
              tableName:
                type:
                  - string
                  - 'null'
                description: Table name, or null for a schema-level rule
              columnName:
                type:
                  - string
                  - 'null'
                description: Column name, or null for a schema- or table-level rule
              everyoneAccessLevel:
                type:
                  - string
                  - 'null'
                enum:
                  - FULL
                  - NO_ACCESS
                  - null
                description: Access for everyone in the organization, or null if unset
              groupAccess:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                      minLength: 1
                      description: Organization group or member ID
                    accessLevel:
                      type: string
                      enum:
                        - FULL
                        - NO_ACCESS
                      description: >-
                        FULL allows querying the object; NO_ACCESS blocks it in
                        queries, chat, and metadata
                  required:
                    - id
                    - accessLevel
                description: Group rules on this object
              memberAccess:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                      minLength: 1
                      description: Organization group or member ID
                    accessLevel:
                      type: string
                      enum:
                        - FULL
                        - NO_ACCESS
                      description: >-
                        FULL allows querying the object; NO_ACCESS blocks it in
                        queries, chat, and metadata
                  required:
                    - id
                    - accessLevel
                description: Member rules on this object
            required:
              - schemaName
              - tableName
              - columnName
              - everyoneAccessLevel
              - groupAccess
              - memberAccess
          description: >-
            Schema, table, and column rules: objects with at least one rule,
            sorted by schema, table, and column
      required:
        - dataSourceId
        - mode
        - accessLevel
        - groupIds
        - memberIds
        - groupAccess
        - memberAccess
        - objects
    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>`

````

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