Create a share
curl --request POST \
--url https://api.example.com/api/data-shares \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"recipient_name": "<string>",
"warehouse": "<string>",
"roles": [
"<string>"
],
"purpose": "",
"recipient_url": "",
"recipient_contact": "",
"expires_in_days": 90,
"setup": {
"access_key": "<string>",
"catalog_name": "<string>"
}
}
'import requests
url = "https://api.example.com/api/data-shares"
payload = {
"name": "<string>",
"recipient_name": "<string>",
"warehouse": "<string>",
"roles": ["<string>"],
"purpose": "",
"recipient_url": "",
"recipient_contact": "",
"expires_in_days": 90,
"setup": {
"access_key": "<string>",
"catalog_name": "<string>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
recipient_name: '<string>',
warehouse: '<string>',
roles: ['<string>'],
purpose: '',
recipient_url: '',
recipient_contact: '',
expires_in_days: 90,
setup: {access_key: '<string>', catalog_name: '<string>'}
})
};
fetch('https://api.example.com/api/data-shares', 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://api.example.com/api/data-shares",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'recipient_name' => '<string>',
'warehouse' => '<string>',
'roles' => [
'<string>'
],
'purpose' => '',
'recipient_url' => '',
'recipient_contact' => '',
'expires_in_days' => 90,
'setup' => [
'access_key' => '<string>',
'catalog_name' => '<string>'
]
]),
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://api.example.com/api/data-shares"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"recipient_name\": \"<string>\",\n \"warehouse\": \"<string>\",\n \"roles\": [\n \"<string>\"\n ],\n \"purpose\": \"\",\n \"recipient_url\": \"\",\n \"recipient_contact\": \"\",\n \"expires_in_days\": 90,\n \"setup\": {\n \"access_key\": \"<string>\",\n \"catalog_name\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.example.com/api/data-shares")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"recipient_name\": \"<string>\",\n \"warehouse\": \"<string>\",\n \"roles\": [\n \"<string>\"\n ],\n \"purpose\": \"\",\n \"recipient_url\": \"\",\n \"recipient_contact\": \"\",\n \"expires_in_days\": 90,\n \"setup\": {\n \"access_key\": \"<string>\",\n \"catalog_name\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/data-shares")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"recipient_name\": \"<string>\",\n \"warehouse\": \"<string>\",\n \"roles\": [\n \"<string>\"\n ],\n \"purpose\": \"\",\n \"recipient_url\": \"\",\n \"recipient_contact\": \"\",\n \"expires_in_days\": 90,\n \"setup\": {\n \"access_key\": \"<string>\",\n \"catalog_name\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"share": {
"id": "<string>",
"slug": "<string>",
"name": "<string>",
"recipient_kind": "<string>",
"recipient_name": "<string>",
"warehouse": "<string>",
"status": "<string>",
"owner": "<string>",
"created_at": "<string>",
"purpose": "",
"recipient_url": "",
"roles": [
"<string>"
],
"tables": [
"<string>"
],
"expires_at": "<string>",
"expires_soon": false,
"key_hint": "",
"last_read_at": "<string>"
},
"profile": {
"share": "<string>",
"share_id": "<string>",
"provider": "<string>",
"endpoint": "<string>",
"warehouse": "<string>",
"token_endpoint": "<string>",
"client_id": "<string>",
"client_secret": "<string>",
"nx1_share": 1,
"scope": "catalog",
"expires_at": "<string>"
},
"delivered": false,
"setup": {
"ok": true,
"catalog_name": "",
"tables_visible": 123,
"message": ""
}
}{
"error": "<string>",
"code": 500
}{
"error": "<string>",
"code": 500
}{
"error": "<string>",
"code": 500
}{
"error": "<string>",
"code": 500
}{
"error": "<string>",
"code": 500
}{
"error": "<string>",
"code": 500
}{
"error": "<string>",
"code": 500
}Data shares
Create a share
Share a warehouse, read-only, as existing realm roles: the recipient
reads what those roles may read there. To another tenant (an
invitation, or set up there at once with setup) or an outside
organisation (a connection profile, returned this once).
Required roles: nx1_catalog_admin and nx1_migration_admin or nx1_migration_ops
POST
/
api
/
data-shares
Create a share
curl --request POST \
--url https://api.example.com/api/data-shares \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"recipient_name": "<string>",
"warehouse": "<string>",
"roles": [
"<string>"
],
"purpose": "",
"recipient_url": "",
"recipient_contact": "",
"expires_in_days": 90,
"setup": {
"access_key": "<string>",
"catalog_name": "<string>"
}
}
'import requests
url = "https://api.example.com/api/data-shares"
payload = {
"name": "<string>",
"recipient_name": "<string>",
"warehouse": "<string>",
"roles": ["<string>"],
"purpose": "",
"recipient_url": "",
"recipient_contact": "",
"expires_in_days": 90,
"setup": {
"access_key": "<string>",
"catalog_name": "<string>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
recipient_name: '<string>',
warehouse: '<string>',
roles: ['<string>'],
purpose: '',
recipient_url: '',
recipient_contact: '',
expires_in_days: 90,
setup: {access_key: '<string>', catalog_name: '<string>'}
})
};
fetch('https://api.example.com/api/data-shares', 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://api.example.com/api/data-shares",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'recipient_name' => '<string>',
'warehouse' => '<string>',
'roles' => [
'<string>'
],
'purpose' => '',
'recipient_url' => '',
'recipient_contact' => '',
'expires_in_days' => 90,
'setup' => [
'access_key' => '<string>',
'catalog_name' => '<string>'
]
]),
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://api.example.com/api/data-shares"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"recipient_name\": \"<string>\",\n \"warehouse\": \"<string>\",\n \"roles\": [\n \"<string>\"\n ],\n \"purpose\": \"\",\n \"recipient_url\": \"\",\n \"recipient_contact\": \"\",\n \"expires_in_days\": 90,\n \"setup\": {\n \"access_key\": \"<string>\",\n \"catalog_name\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.example.com/api/data-shares")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"recipient_name\": \"<string>\",\n \"warehouse\": \"<string>\",\n \"roles\": [\n \"<string>\"\n ],\n \"purpose\": \"\",\n \"recipient_url\": \"\",\n \"recipient_contact\": \"\",\n \"expires_in_days\": 90,\n \"setup\": {\n \"access_key\": \"<string>\",\n \"catalog_name\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/data-shares")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"recipient_name\": \"<string>\",\n \"warehouse\": \"<string>\",\n \"roles\": [\n \"<string>\"\n ],\n \"purpose\": \"\",\n \"recipient_url\": \"\",\n \"recipient_contact\": \"\",\n \"expires_in_days\": 90,\n \"setup\": {\n \"access_key\": \"<string>\",\n \"catalog_name\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"share": {
"id": "<string>",
"slug": "<string>",
"name": "<string>",
"recipient_kind": "<string>",
"recipient_name": "<string>",
"warehouse": "<string>",
"status": "<string>",
"owner": "<string>",
"created_at": "<string>",
"purpose": "",
"recipient_url": "",
"roles": [
"<string>"
],
"tables": [
"<string>"
],
"expires_at": "<string>",
"expires_soon": false,
"key_hint": "",
"last_read_at": "<string>"
},
"profile": {
"share": "<string>",
"share_id": "<string>",
"provider": "<string>",
"endpoint": "<string>",
"warehouse": "<string>",
"token_endpoint": "<string>",
"client_id": "<string>",
"client_secret": "<string>",
"nx1_share": 1,
"scope": "catalog",
"expires_at": "<string>"
},
"delivered": false,
"setup": {
"ok": true,
"catalog_name": "",
"tables_visible": 123,
"message": ""
}
}{
"error": "<string>",
"code": 500
}{
"error": "<string>",
"code": 500
}{
"error": "<string>",
"code": 500
}{
"error": "<string>",
"code": 500
}{
"error": "<string>",
"code": 500
}{
"error": "<string>",
"code": 500
}{
"error": "<string>",
"code": 500
}Authorizations
OAuth2AuthorizationCodeBearerAPIKeyHeader
The access token received from the authorization server in the OAuth 2.0 flow.
Body
application/json
Required string length:
3 - 200Available options:
tenant, external Required string length:
1 - 200Pattern:
^[a-z0-9_][a-z0-9_-]{0,127}$Required array length:
1 - 20 elementsMaximum string length:
2000Maximum string length:
500Maximum string length:
320Required range:
1 <= x <= 730Set the share up in the recipient tenant now, as the caller there.
Show child attributes
Show child attributes
Was this page helpful?

