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": []
}
'import requests
url = "https://charts.basedash.com/api/public/organizations/{orgId}/data-sources/{id}/access"
payload = {
"mode": "everyone",
"accessLevel": "VIEW",
"groupIds": [],
"memberIds": [],
"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: []
})
};
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' => [
]
]),
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}")
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}")
.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}"
response = http.request(request)
puts response.read_body{
"data": {
"dataSourceId": "<string>",
"groupIds": [
"<string>"
],
"memberIds": [
"<string>"
],
"groupAccess": [
{
"id": "<string>",
"accessLevel": "VIEW"
}
],
"memberAccess": [
{
"id": "<string>",
"accessLevel": "VIEW"
}
]
}
}{
"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
Replaces the access policy for a data source. Use mode “everyone” to allow all organization members to view or edit it, or mode “restricted” with groupAccess/memberAccess to limit access. Legacy groupIds/memberIds grant view access. Requires admin access to the organization.
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": []
}
'import requests
url = "https://charts.basedash.com/api/public/organizations/{orgId}/data-sources/{id}/access"
payload = {
"mode": "everyone",
"accessLevel": "VIEW",
"groupIds": [],
"memberIds": [],
"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: []
})
};
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' => [
]
]),
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}")
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}")
.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}"
response = http.request(request)
puts response.read_body{
"data": {
"dataSourceId": "<string>",
"groupIds": [
"<string>"
],
"memberIds": [
"<string>"
],
"groupAccess": [
{
"id": "<string>",
"accessLevel": "VIEW"
}
],
"memberAccess": [
{
"id": "<string>",
"accessLevel": "VIEW"
}
]
}
}{
"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
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
Response
Data source access updated successfully
Show child attributes
Show child attributes
Was this page helpful?