curl --request POST \
--url https://api-dev.narrative.io/v2/connections \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "connections_dataset",
"dataset_id": 42,
"profile_id": "d555f07f-f140-40d2-91af-e6aa54f7488b",
"quick_settings": {
"bucket_suffix": "/my-subscription",
"number_of_files": "5"
}
}
'import requests
url = "https://api-dev.narrative.io/v2/connections"
payload = {
"type": "connections_dataset",
"dataset_id": 42,
"profile_id": "d555f07f-f140-40d2-91af-e6aa54f7488b",
"quick_settings": {
"bucket_suffix": "/my-subscription",
"number_of_files": "5"
}
}
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({
type: 'connections_dataset',
dataset_id: 42,
profile_id: 'd555f07f-f140-40d2-91af-e6aa54f7488b',
quick_settings: {bucket_suffix: '/my-subscription', number_of_files: '5'}
})
};
fetch('https://api-dev.narrative.io/v2/connections', 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-dev.narrative.io/v2/connections",
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([
'type' => 'connections_dataset',
'dataset_id' => 42,
'profile_id' => 'd555f07f-f140-40d2-91af-e6aa54f7488b',
'quick_settings' => [
'bucket_suffix' => '/my-subscription',
'number_of_files' => '5'
]
]),
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-dev.narrative.io/v2/connections"
payload := strings.NewReader("{\n \"type\": \"connections_dataset\",\n \"dataset_id\": 42,\n \"profile_id\": \"d555f07f-f140-40d2-91af-e6aa54f7488b\",\n \"quick_settings\": {\n \"bucket_suffix\": \"/my-subscription\",\n \"number_of_files\": \"5\"\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-dev.narrative.io/v2/connections")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"connections_dataset\",\n \"dataset_id\": 42,\n \"profile_id\": \"d555f07f-f140-40d2-91af-e6aa54f7488b\",\n \"quick_settings\": {\n \"bucket_suffix\": \"/my-subscription\",\n \"number_of_files\": \"5\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dev.narrative.io/v2/connections")
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 \"type\": \"connections_dataset\",\n \"dataset_id\": 42,\n \"profile_id\": \"d555f07f-f140-40d2-91af-e6aa54f7488b\",\n \"quick_settings\": {\n \"bucket_suffix\": \"/my-subscription\",\n \"number_of_files\": \"5\"\n }\n}"
response = http.request(request)
puts response.read_body{
"type": "connections_dataset",
"id": "21691f26-f308-4e98-896c-579db27da04b",
"app": {
"id": 500,
"name": "S3 Connector"
},
"created_at": "2026-07-14T00:00:00Z",
"dataset_id": 42,
"installation_id": 9000,
"quick_settings": {
"bucket_suffix": "/my-subscription",
"number_of_files": "5"
},
"profile_id": "d555f07f-f140-40d2-91af-e6aa54f7488b",
"profile": {
"id": "d555f07f-f140-40d2-91af-e6aa54f7488b",
"name": "Production"
},
"status": "active"
}{
"error": "Unauthorized",
"error_description": "You are not authorized to use this endpoint."
}{
"error": "Unauthorized",
"error_description": "You are not authorized to use this endpoint."
}{
"error": "Unauthorized",
"error_description": "You are not authorized to use this endpoint."
}{}Create a connection
Creates a connection that sends a dataset’s or a model’s data to a connector app. The profile picks the connector: it belongs to an installation, and the installation names the app. For a dataset connection, a connector app that implements connection checks is asked to accept the dataset’s schema and the quick_settings; if it refuses, nothing is created and the error is returned. Requires a token tied to a company.
curl --request POST \
--url https://api-dev.narrative.io/v2/connections \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "connections_dataset",
"dataset_id": 42,
"profile_id": "d555f07f-f140-40d2-91af-e6aa54f7488b",
"quick_settings": {
"bucket_suffix": "/my-subscription",
"number_of_files": "5"
}
}
'import requests
url = "https://api-dev.narrative.io/v2/connections"
payload = {
"type": "connections_dataset",
"dataset_id": 42,
"profile_id": "d555f07f-f140-40d2-91af-e6aa54f7488b",
"quick_settings": {
"bucket_suffix": "/my-subscription",
"number_of_files": "5"
}
}
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({
type: 'connections_dataset',
dataset_id: 42,
profile_id: 'd555f07f-f140-40d2-91af-e6aa54f7488b',
quick_settings: {bucket_suffix: '/my-subscription', number_of_files: '5'}
})
};
fetch('https://api-dev.narrative.io/v2/connections', 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-dev.narrative.io/v2/connections",
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([
'type' => 'connections_dataset',
'dataset_id' => 42,
'profile_id' => 'd555f07f-f140-40d2-91af-e6aa54f7488b',
'quick_settings' => [
'bucket_suffix' => '/my-subscription',
'number_of_files' => '5'
]
]),
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-dev.narrative.io/v2/connections"
payload := strings.NewReader("{\n \"type\": \"connections_dataset\",\n \"dataset_id\": 42,\n \"profile_id\": \"d555f07f-f140-40d2-91af-e6aa54f7488b\",\n \"quick_settings\": {\n \"bucket_suffix\": \"/my-subscription\",\n \"number_of_files\": \"5\"\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-dev.narrative.io/v2/connections")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"connections_dataset\",\n \"dataset_id\": 42,\n \"profile_id\": \"d555f07f-f140-40d2-91af-e6aa54f7488b\",\n \"quick_settings\": {\n \"bucket_suffix\": \"/my-subscription\",\n \"number_of_files\": \"5\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dev.narrative.io/v2/connections")
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 \"type\": \"connections_dataset\",\n \"dataset_id\": 42,\n \"profile_id\": \"d555f07f-f140-40d2-91af-e6aa54f7488b\",\n \"quick_settings\": {\n \"bucket_suffix\": \"/my-subscription\",\n \"number_of_files\": \"5\"\n }\n}"
response = http.request(request)
puts response.read_body{
"type": "connections_dataset",
"id": "21691f26-f308-4e98-896c-579db27da04b",
"app": {
"id": 500,
"name": "S3 Connector"
},
"created_at": "2026-07-14T00:00:00Z",
"dataset_id": 42,
"installation_id": 9000,
"quick_settings": {
"bucket_suffix": "/my-subscription",
"number_of_files": "5"
},
"profile_id": "d555f07f-f140-40d2-91af-e6aa54f7488b",
"profile": {
"id": "d555f07f-f140-40d2-91af-e6aa54f7488b",
"name": "Production"
},
"status": "active"
}{
"error": "Unauthorized",
"error_description": "You are not authorized to use this endpoint."
}{
"error": "Unauthorized",
"error_description": "You are not authorized to use this endpoint."
}{
"error": "Unauthorized",
"error_description": "You are not authorized to use this endpoint."
}{}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
- Option 1
- Option 2
Discriminator. Must be connections_dataset.
connections_dataset The dataset whose data is routed to the connector.
Settings for the connector. Their shape belongs to the connector app. For dataset connections the connector checks them when the connection is created. Omitting the field and sending null both mean no settings.
Response
Created
- Option 1
- Option 2
A connection from a dataset or a model to a connector app. type says which, and only the matching id field (dataset_id or model_id) is sent.
connections_dataset The connector app the data is sent to.
Show child attributes
Show child attributes
The dataset whose data is sent to the connector.
The app installation the profile belongs to.
The same value as profile.id. Prefer profile.id; this field is kept for older clients.
The app profile the connection was created against.
Show child attributes
Show child attributes
Archived connections are never returned by these endpoints, so a response always says active.
active, archived The settings the connection was created with, returned as sent. Their shape belongs to the connector app, so it differs from one connector to the next. null when the connection was created without settings.
Was this page helpful?

