Create a connector connection
curl --request POST \
--url https://api.erna.ai/v1/workspaces/{workspaceId}/connections \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"connector": "<string>",
"pipeline": "<string>",
"service": "<string>",
"returnUrl": "<string>"
}
'import requests
url = "https://api.erna.ai/v1/workspaces/{workspaceId}/connections"
payload = {
"connector": "<string>",
"pipeline": "<string>",
"service": "<string>",
"returnUrl": "<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({
connector: '<string>',
pipeline: '<string>',
service: '<string>',
returnUrl: '<string>'
})
};
fetch('https://api.erna.ai/v1/workspaces/{workspaceId}/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.erna.ai/v1/workspaces/{workspaceId}/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([
'connector' => '<string>',
'pipeline' => '<string>',
'service' => '<string>',
'returnUrl' => '<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.erna.ai/v1/workspaces/{workspaceId}/connections"
payload := strings.NewReader("{\n \"connector\": \"<string>\",\n \"pipeline\": \"<string>\",\n \"service\": \"<string>\",\n \"returnUrl\": \"<string>\"\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.erna.ai/v1/workspaces/{workspaceId}/connections")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"connector\": \"<string>\",\n \"pipeline\": \"<string>\",\n \"service\": \"<string>\",\n \"returnUrl\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.erna.ai/v1/workspaces/{workspaceId}/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 \"connector\": \"<string>\",\n \"pipeline\": \"<string>\",\n \"service\": \"<string>\",\n \"returnUrl\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"connector": "<string>",
"displayName": "<string>",
"grantedCapabilities": [
"<string>"
],
"metadata": {}
}{
"status": "authorization_required",
"connector": "<string>",
"authorization": {
"url": "<string>",
"expiresAt": "<string>"
},
"requiredActions": [
{
"id": "<string>",
"type": "connect_service",
"connector": "<string>",
"href": "<string>",
"request": {}
}
]
}{
"error": "<string>",
"connector": "<string>",
"flow": "<string>",
"providerError": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>"
}
],
"message": "<string>",
"reason": "<string>",
"runId": "<string>",
"requiredActions": [
{
"id": "<string>",
"type": "connect_service",
"connector": "<string>",
"href": "<string>",
"request": {}
}
],
"billing": {
"checkoutPath": "<string>"
}
}{
"error": "<string>",
"connector": "<string>",
"flow": "<string>",
"providerError": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>"
}
],
"message": "<string>",
"reason": "<string>",
"runId": "<string>",
"requiredActions": [
{
"id": "<string>",
"type": "connect_service",
"connector": "<string>",
"href": "<string>",
"request": {}
}
],
"billing": {
"checkoutPath": "<string>"
}
}{
"error": "<string>",
"connector": "<string>",
"flow": "<string>",
"providerError": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>"
}
],
"message": "<string>",
"reason": "<string>",
"runId": "<string>",
"requiredActions": [
{
"id": "<string>",
"type": "connect_service",
"connector": "<string>",
"href": "<string>",
"request": {}
}
],
"billing": {
"checkoutPath": "<string>"
}
}{
"error": "<string>",
"connector": "<string>",
"flow": "<string>",
"providerError": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>"
}
],
"message": "<string>",
"reason": "<string>",
"runId": "<string>",
"requiredActions": [
{
"id": "<string>",
"type": "connect_service",
"connector": "<string>",
"href": "<string>",
"request": {}
}
],
"billing": {
"checkoutPath": "<string>"
}
}{
"error": "<string>",
"connector": "<string>",
"flow": "<string>",
"providerError": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>"
}
],
"message": "<string>",
"reason": "<string>",
"runId": "<string>",
"requiredActions": [
{
"id": "<string>",
"type": "connect_service",
"connector": "<string>",
"href": "<string>",
"request": {}
}
],
"billing": {
"checkoutPath": "<string>"
}
}Connections
Create a connector connection
Creates a workspace connector connection. For manual Planday setup, set authMode = manual to return an Erna-hosted credential form. Trusted callers can still send auth.kind = customer_token with the customer portal app id and refresh token. Omit authMode to start OAuth when it is configured.
POST
/
v1
/
workspaces
/
{workspaceId}
/
connections
Create a connector connection
curl --request POST \
--url https://api.erna.ai/v1/workspaces/{workspaceId}/connections \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"connector": "<string>",
"pipeline": "<string>",
"service": "<string>",
"returnUrl": "<string>"
}
'import requests
url = "https://api.erna.ai/v1/workspaces/{workspaceId}/connections"
payload = {
"connector": "<string>",
"pipeline": "<string>",
"service": "<string>",
"returnUrl": "<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({
connector: '<string>',
pipeline: '<string>',
service: '<string>',
returnUrl: '<string>'
})
};
fetch('https://api.erna.ai/v1/workspaces/{workspaceId}/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.erna.ai/v1/workspaces/{workspaceId}/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([
'connector' => '<string>',
'pipeline' => '<string>',
'service' => '<string>',
'returnUrl' => '<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.erna.ai/v1/workspaces/{workspaceId}/connections"
payload := strings.NewReader("{\n \"connector\": \"<string>\",\n \"pipeline\": \"<string>\",\n \"service\": \"<string>\",\n \"returnUrl\": \"<string>\"\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.erna.ai/v1/workspaces/{workspaceId}/connections")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"connector\": \"<string>\",\n \"pipeline\": \"<string>\",\n \"service\": \"<string>\",\n \"returnUrl\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.erna.ai/v1/workspaces/{workspaceId}/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 \"connector\": \"<string>\",\n \"pipeline\": \"<string>\",\n \"service\": \"<string>\",\n \"returnUrl\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"connector": "<string>",
"displayName": "<string>",
"grantedCapabilities": [
"<string>"
],
"metadata": {}
}{
"status": "authorization_required",
"connector": "<string>",
"authorization": {
"url": "<string>",
"expiresAt": "<string>"
},
"requiredActions": [
{
"id": "<string>",
"type": "connect_service",
"connector": "<string>",
"href": "<string>",
"request": {}
}
]
}{
"error": "<string>",
"connector": "<string>",
"flow": "<string>",
"providerError": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>"
}
],
"message": "<string>",
"reason": "<string>",
"runId": "<string>",
"requiredActions": [
{
"id": "<string>",
"type": "connect_service",
"connector": "<string>",
"href": "<string>",
"request": {}
}
],
"billing": {
"checkoutPath": "<string>"
}
}{
"error": "<string>",
"connector": "<string>",
"flow": "<string>",
"providerError": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>"
}
],
"message": "<string>",
"reason": "<string>",
"runId": "<string>",
"requiredActions": [
{
"id": "<string>",
"type": "connect_service",
"connector": "<string>",
"href": "<string>",
"request": {}
}
],
"billing": {
"checkoutPath": "<string>"
}
}{
"error": "<string>",
"connector": "<string>",
"flow": "<string>",
"providerError": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>"
}
],
"message": "<string>",
"reason": "<string>",
"runId": "<string>",
"requiredActions": [
{
"id": "<string>",
"type": "connect_service",
"connector": "<string>",
"href": "<string>",
"request": {}
}
],
"billing": {
"checkoutPath": "<string>"
}
}{
"error": "<string>",
"connector": "<string>",
"flow": "<string>",
"providerError": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>"
}
],
"message": "<string>",
"reason": "<string>",
"runId": "<string>",
"requiredActions": [
{
"id": "<string>",
"type": "connect_service",
"connector": "<string>",
"href": "<string>",
"request": {}
}
],
"billing": {
"checkoutPath": "<string>"
}
}{
"error": "<string>",
"connector": "<string>",
"flow": "<string>",
"providerError": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>"
}
],
"message": "<string>",
"reason": "<string>",
"runId": "<string>",
"requiredActions": [
{
"id": "<string>",
"type": "connect_service",
"connector": "<string>",
"href": "<string>",
"request": {}
}
],
"billing": {
"checkoutPath": "<string>"
}
}Authorizations
OAuth2 access token or API key
Path Parameters
Example:
"ws_123"
Body
application/json
⌘I