curl --request PUT \
--url https://charts.basedash.com/api/public/organizations/{orgId}/data-sources/{id}/access \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"mode": "everyone",
"accessLevel": "VIEW",
"groupIds": [],
"memberIds": [],
"groupAccess": [],
"memberAccess": [],
"objects": [
{
"schemaName": "<string>",
"tableName": "<string>",
"columnName": "<string>",
"groupAccess": [],
"memberAccess": []
}
]
}
'import requests
url = "https://charts.basedash.com/api/public/organizations/{orgId}/data-sources/{id}/access"
payload = {
"mode": "everyone",
"accessLevel": "VIEW",
"groupIds": [],
"memberIds": [],
"groupAccess": [],
"memberAccess": [],
"objects": [
{
"schemaName": "<string>",
"tableName": "<string>",
"columnName": "<string>",
"groupAccess": [],
"memberAccess": []
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
mode: 'everyone',
accessLevel: 'VIEW',
groupIds: [],
memberIds: [],
groupAccess: [],
memberAccess: [],
objects: [
{
schemaName: '<string>',
tableName: '<string>',
columnName: '<string>',
groupAccess: [],
memberAccess: []
}
]
})
};
fetch('https://charts.basedash.com/api/public/organizations/{orgId}/data-sources/{id}/access', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://charts.basedash.com/api/public/organizations/{orgId}/data-sources/{id}/access",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'mode' => 'everyone',
'accessLevel' => 'VIEW',
'groupIds' => [
],
'memberIds' => [
],
'groupAccess' => [
],
'memberAccess' => [
],
'objects' => [
[
'schemaName' => '<string>',
'tableName' => '<string>',
'columnName' => '<string>',
'groupAccess' => [
],
'memberAccess' => [
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://charts.basedash.com/api/public/organizations/{orgId}/data-sources/{id}/access"
payload := strings.NewReader("{\n \"mode\": \"everyone\",\n \"accessLevel\": \"VIEW\",\n \"groupIds\": [],\n \"memberIds\": [],\n \"groupAccess\": [],\n \"memberAccess\": [],\n \"objects\": [\n {\n \"schemaName\": \"<string>\",\n \"tableName\": \"<string>\",\n \"columnName\": \"<string>\",\n \"groupAccess\": [],\n \"memberAccess\": []\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://charts.basedash.com/api/public/organizations/{orgId}/data-sources/{id}/access")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"mode\": \"everyone\",\n \"accessLevel\": \"VIEW\",\n \"groupIds\": [],\n \"memberIds\": [],\n \"groupAccess\": [],\n \"memberAccess\": [],\n \"objects\": [\n {\n \"schemaName\": \"<string>\",\n \"tableName\": \"<string>\",\n \"columnName\": \"<string>\",\n \"groupAccess\": [],\n \"memberAccess\": []\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://charts.basedash.com/api/public/organizations/{orgId}/data-sources/{id}/access")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"mode\": \"everyone\",\n \"accessLevel\": \"VIEW\",\n \"groupIds\": [],\n \"memberIds\": [],\n \"groupAccess\": [],\n \"memberAccess\": [],\n \"objects\": [\n {\n \"schemaName\": \"<string>\",\n \"tableName\": \"<string>\",\n \"columnName\": \"<string>\",\n \"groupAccess\": [],\n \"memberAccess\": []\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"dataSourceId": "<string>",
"mode": "everyone",
"accessLevel": "VIEW",
"groupIds": [
"<string>"
],
"memberIds": [
"<string>"
],
"groupAccess": [
{
"id": "<string>",
"accessLevel": "VIEW"
}
],
"memberAccess": [
{
"id": "<string>",
"accessLevel": "VIEW"
}
],
"objects": [
{
"schemaName": "<string>",
"tableName": "<string>",
"columnName": "<string>",
"everyoneAccessLevel": "FULL",
"groupAccess": [
{
"id": "<string>",
"accessLevel": "FULL"
}
],
"memberAccess": [
{
"id": "<string>",
"accessLevel": "FULL"
}
]
}
]
}
}{
"error": {
"title": "<string>",
"detail": "<string>"
}
}{
"error": {
"title": "<string>",
"detail": "<string>"
}
}{
"error": {
"title": "<string>",
"detail": "<string>"
}
}{
"error": {
"title": "RateLimitExceeded",
"detail": "<string>",
"retryAfterMs": 123
}
}{
"error": {
"title": "<string>",
"detail": "<string>"
}
}Update data source access
Updates the access policy for a data source. Requires admin access to the organization.
Connection-level access: when mode is sent, it replaces who can query the data source. Use mode “everyone” to allow all organization members to view or edit it, or mode “restricted” with groupAccess/memberAccess to limit access; an omitted groupAccess or memberAccess means none. Legacy groupIds/memberIds grant view access. Omit mode to leave connection-level access unchanged; the body must then contain only objects, and sending accessLevel, groupAccess, memberAccess, groupIds, or memberIds without mode returns 400. A body with neither mode nor objects also returns 400.
Schema, table, and column rules are optional. Omit objects to leave them unchanged. When objects is sent, even as an empty array, it replaces every object rule on the data source, including rules configured in the app. Objects are identified by their synced schema, table, and column names. Each object must set at least one of everyoneAccessLevel, groupAccess, or memberAccess, and unknown fields return 400; to remove an object’s rules, leave the object out.
Object rules are evaluated from schema to table to column; an object without a matching rule inherits from its parent. At each object a member rule beats group rules, a group with FULL beats groups with NO_ACCESS, and group rules beat the everyone rule. Rules apply to every role, including admins. To restrict tables to a group, set everyoneAccessLevel to NO_ACCESS and give the group FULL on the same object. Prefer schema-level rules for allow-lists: new tables in the schema inherit NO_ACCESS.
New object rules must reference groups, active members, and objects that exist in the synced schema; otherwise nothing is changed, including the connection-level policy, and the request returns 404. Existing rules are kept as-is even if their object has since been dropped. Sending the same object rules again is a no-op for them: unchanged rules are not rewritten and open clients are not notified.
curl --request PUT \
--url https://charts.basedash.com/api/public/organizations/{orgId}/data-sources/{id}/access \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"mode": "everyone",
"accessLevel": "VIEW",
"groupIds": [],
"memberIds": [],
"groupAccess": [],
"memberAccess": [],
"objects": [
{
"schemaName": "<string>",
"tableName": "<string>",
"columnName": "<string>",
"groupAccess": [],
"memberAccess": []
}
]
}
'import requests
url = "https://charts.basedash.com/api/public/organizations/{orgId}/data-sources/{id}/access"
payload = {
"mode": "everyone",
"accessLevel": "VIEW",
"groupIds": [],
"memberIds": [],
"groupAccess": [],
"memberAccess": [],
"objects": [
{
"schemaName": "<string>",
"tableName": "<string>",
"columnName": "<string>",
"groupAccess": [],
"memberAccess": []
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
mode: 'everyone',
accessLevel: 'VIEW',
groupIds: [],
memberIds: [],
groupAccess: [],
memberAccess: [],
objects: [
{
schemaName: '<string>',
tableName: '<string>',
columnName: '<string>',
groupAccess: [],
memberAccess: []
}
]
})
};
fetch('https://charts.basedash.com/api/public/organizations/{orgId}/data-sources/{id}/access', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://charts.basedash.com/api/public/organizations/{orgId}/data-sources/{id}/access",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'mode' => 'everyone',
'accessLevel' => 'VIEW',
'groupIds' => [
],
'memberIds' => [
],
'groupAccess' => [
],
'memberAccess' => [
],
'objects' => [
[
'schemaName' => '<string>',
'tableName' => '<string>',
'columnName' => '<string>',
'groupAccess' => [
],
'memberAccess' => [
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://charts.basedash.com/api/public/organizations/{orgId}/data-sources/{id}/access"
payload := strings.NewReader("{\n \"mode\": \"everyone\",\n \"accessLevel\": \"VIEW\",\n \"groupIds\": [],\n \"memberIds\": [],\n \"groupAccess\": [],\n \"memberAccess\": [],\n \"objects\": [\n {\n \"schemaName\": \"<string>\",\n \"tableName\": \"<string>\",\n \"columnName\": \"<string>\",\n \"groupAccess\": [],\n \"memberAccess\": []\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://charts.basedash.com/api/public/organizations/{orgId}/data-sources/{id}/access")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"mode\": \"everyone\",\n \"accessLevel\": \"VIEW\",\n \"groupIds\": [],\n \"memberIds\": [],\n \"groupAccess\": [],\n \"memberAccess\": [],\n \"objects\": [\n {\n \"schemaName\": \"<string>\",\n \"tableName\": \"<string>\",\n \"columnName\": \"<string>\",\n \"groupAccess\": [],\n \"memberAccess\": []\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://charts.basedash.com/api/public/organizations/{orgId}/data-sources/{id}/access")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"mode\": \"everyone\",\n \"accessLevel\": \"VIEW\",\n \"groupIds\": [],\n \"memberIds\": [],\n \"groupAccess\": [],\n \"memberAccess\": [],\n \"objects\": [\n {\n \"schemaName\": \"<string>\",\n \"tableName\": \"<string>\",\n \"columnName\": \"<string>\",\n \"groupAccess\": [],\n \"memberAccess\": []\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"dataSourceId": "<string>",
"mode": "everyone",
"accessLevel": "VIEW",
"groupIds": [
"<string>"
],
"memberIds": [
"<string>"
],
"groupAccess": [
{
"id": "<string>",
"accessLevel": "VIEW"
}
],
"memberAccess": [
{
"id": "<string>",
"accessLevel": "VIEW"
}
],
"objects": [
{
"schemaName": "<string>",
"tableName": "<string>",
"columnName": "<string>",
"everyoneAccessLevel": "FULL",
"groupAccess": [
{
"id": "<string>",
"accessLevel": "FULL"
}
],
"memberAccess": [
{
"id": "<string>",
"accessLevel": "FULL"
}
]
}
]
}
}{
"error": {
"title": "<string>",
"detail": "<string>"
}
}{
"error": {
"title": "<string>",
"detail": "<string>"
}
}{
"error": {
"title": "<string>",
"detail": "<string>"
}
}{
"error": {
"title": "RateLimitExceeded",
"detail": "<string>",
"retryAfterMs": 123
}
}{
"error": {
"title": "<string>",
"detail": "<string>"
}
}Authorizations
API key authentication using Bearer token format: Bearer <basedash_api_key>
Body
- Option 1
- Option 2
- Option 3
everyone Whether the principal can view or edit the data source
VIEW, EDIT Deprecated. Organization group IDs granted view access. Use groupAccess to set view or edit access.
Deprecated. Organization member IDs granted view access. Use memberAccess to set view or edit access.
Organization groups with view or edit access
Show child attributes
Show child attributes
Organization members with view or edit access
Show child attributes
Show child attributes
Schema, table, and column rules. Omit to leave existing object rules unchanged. The complete set of schema, table, and column rules for the data source (at most 5000 rules in total): objects not listed lose all of their rules, and an empty array removes every object rule.
1000Show child attributes
Show child attributes
Response
Data source access updated successfully
Show child attributes
Show child attributes