JavaScript
import Cerca from '@cerca-dev/sdk';
const client = new Cerca({
apiKey: process.env['CERCA_API_KEY'], // This is the default and can be omitted
});
const attachedConnection = await client.connections.attach('agent_abc123', {
connectionId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
});
console.log(attachedConnection);import os
from cerca import Cerca
client = Cerca(
api_key=os.environ.get("CERCA_API_KEY"), # This is the default and can be omitted
)
attached_connection = client.connections.attach(
agent_id="agent_abc123",
connection_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(attached_connection)package main
import (
"context"
"fmt"
"github.com/matrices/cerca-go"
"github.com/matrices/cerca-go/option"
)
func main() {
client := cercago.NewClient(
option.WithAPIKey("My API Key"),
)
attachedConnection, err := client.Connections.Attach(
context.TODO(),
"agent_abc123",
cercago.ConnectionAttachParams{
ConnectionID: cercago.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", attachedConnection)
}require "cerca"
cerca = Cerca::Client.new(api_key: "My API Key")
attached_connection = cerca.connections.attach("agent_abc123", connection_id: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
puts(attached_connection)cerca connections attach \
--api-key 'My API Key' \
--agent-id agent_abc123 \
--connection-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26ecurl --request POST \
--url https://api.cerca.dev/agents/{agentId}/connections \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"connectionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"metadata": {}
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cerca.dev/agents/{agentId}/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([
'connectionId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'metadata' => [
]
]),
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;
}HttpResponse<String> response = Unirest.post("https://api.cerca.dev/agents/{agentId}/connections")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"connectionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"metadata\": {}\n}")
.asString();{
"accountLabel": "<string>",
"createdAt": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"owner": {
"type": "organization"
},
"scopes": [
"<string>"
],
"updatedAt": "<string>",
"attachedAt": "<string>",
"metadata": {}
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}Connections
Attach connection
POST
/
agents
/
{agentId}
/
connections
JavaScript
import Cerca from '@cerca-dev/sdk';
const client = new Cerca({
apiKey: process.env['CERCA_API_KEY'], // This is the default and can be omitted
});
const attachedConnection = await client.connections.attach('agent_abc123', {
connectionId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
});
console.log(attachedConnection);import os
from cerca import Cerca
client = Cerca(
api_key=os.environ.get("CERCA_API_KEY"), # This is the default and can be omitted
)
attached_connection = client.connections.attach(
agent_id="agent_abc123",
connection_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(attached_connection)package main
import (
"context"
"fmt"
"github.com/matrices/cerca-go"
"github.com/matrices/cerca-go/option"
)
func main() {
client := cercago.NewClient(
option.WithAPIKey("My API Key"),
)
attachedConnection, err := client.Connections.Attach(
context.TODO(),
"agent_abc123",
cercago.ConnectionAttachParams{
ConnectionID: cercago.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", attachedConnection)
}require "cerca"
cerca = Cerca::Client.new(api_key: "My API Key")
attached_connection = cerca.connections.attach("agent_abc123", connection_id: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
puts(attached_connection)cerca connections attach \
--api-key 'My API Key' \
--agent-id agent_abc123 \
--connection-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26ecurl --request POST \
--url https://api.cerca.dev/agents/{agentId}/connections \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"connectionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"metadata": {}
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cerca.dev/agents/{agentId}/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([
'connectionId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'metadata' => [
]
]),
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;
}HttpResponse<String> response = Unirest.post("https://api.cerca.dev/agents/{agentId}/connections")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"connectionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"metadata\": {}\n}")
.asString();{
"accountLabel": "<string>",
"createdAt": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"owner": {
"type": "organization"
},
"scopes": [
"<string>"
],
"updatedAt": "<string>",
"attachedAt": "<string>",
"metadata": {}
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Minimum string length:
1Example:
"agent_abc123"
Response
Connection attached.
Public owner for a reusable connection. Organization owners use the authenticated organization; fleet owners add a fleetId.
- OrganizationConnectionOwner
- FleetConnectionOwner
Show child attributes
Show child attributes
Available options:
google, github, slack, linear, notion, custom, webhook Available options:
oauth, api_key Show child attributes
Show child attributes
⌘I