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 connection = await client.connections.create({
apiKey: 'sk_live_...',
owner: { type: 'organization' },
provider: 'custom',
});
console.log(connection.id);import os
from cerca import Cerca
client = Cerca(
api_key=os.environ.get("CERCA_API_KEY"), # This is the default and can be omitted
)
connection = client.connections.create(
api_key="sk_live_...",
owner={
"type": "organization"
},
provider="custom",
)
print(connection.id)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"),
)
connection, err := client.Connections.New(context.TODO(), cercago.ConnectionNewParams{
APIKey: cercago.F("sk_live_..."),
Owner: cercago.F[cercago.ConnectionOwnerUnionParam](cercago.ConnectionOwnerOrganizationConnectionOwnerParam{
Type: cercago.F(cercago.ConnectionOwnerOrganizationConnectionOwnerTypeOrganization),
}),
Provider: cercago.F("custom"),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", connection.ID)
}
require "cerca"
cerca = Cerca::Client.new(api_key: "My API Key")
connection = cerca.connections.create(api_key: "sk_live_...", owner: {type: :organization}, provider: "custom")
puts(connection)cerca connections create \
--api-key 'My API Key' \
--api-key sk_live_... \
--owner '{type: organization}' \
--provider customcurl --request POST \
--url https://api.cerca.dev/connections/api-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"owner": {
"type": "organization"
},
"provider": "custom",
"apiKey": "sk_live_...",
"accountLabel": "primary"
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cerca.dev/connections/api-keys",
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([
'owner' => [
'type' => 'organization'
],
'provider' => 'custom',
'apiKey' => 'sk_live_...',
'accountLabel' => 'primary'
]),
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/connections/api-keys")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"owner\": {\n \"type\": \"organization\"\n },\n \"provider\": \"custom\",\n \"apiKey\": \"sk_live_...\",\n \"accountLabel\": \"primary\"\n}")
.asString();{
"accountLabel": "<string>",
"createdAt": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"owner": {
"type": "organization"
},
"provider": "google",
"scopes": [
"<string>"
],
"type": "oauth",
"updatedAt": "<string>"
}{
"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
Create API key
POST
/
connections
/
api-keys
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 connection = await client.connections.create({
apiKey: 'sk_live_...',
owner: { type: 'organization' },
provider: 'custom',
});
console.log(connection.id);import os
from cerca import Cerca
client = Cerca(
api_key=os.environ.get("CERCA_API_KEY"), # This is the default and can be omitted
)
connection = client.connections.create(
api_key="sk_live_...",
owner={
"type": "organization"
},
provider="custom",
)
print(connection.id)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"),
)
connection, err := client.Connections.New(context.TODO(), cercago.ConnectionNewParams{
APIKey: cercago.F("sk_live_..."),
Owner: cercago.F[cercago.ConnectionOwnerUnionParam](cercago.ConnectionOwnerOrganizationConnectionOwnerParam{
Type: cercago.F(cercago.ConnectionOwnerOrganizationConnectionOwnerTypeOrganization),
}),
Provider: cercago.F("custom"),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", connection.ID)
}
require "cerca"
cerca = Cerca::Client.new(api_key: "My API Key")
connection = cerca.connections.create(api_key: "sk_live_...", owner: {type: :organization}, provider: "custom")
puts(connection)cerca connections create \
--api-key 'My API Key' \
--api-key sk_live_... \
--owner '{type: organization}' \
--provider customcurl --request POST \
--url https://api.cerca.dev/connections/api-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"owner": {
"type": "organization"
},
"provider": "custom",
"apiKey": "sk_live_...",
"accountLabel": "primary"
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cerca.dev/connections/api-keys",
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([
'owner' => [
'type' => 'organization'
],
'provider' => 'custom',
'apiKey' => 'sk_live_...',
'accountLabel' => 'primary'
]),
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/connections/api-keys")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"owner\": {\n \"type\": \"organization\"\n },\n \"provider\": \"custom\",\n \"apiKey\": \"sk_live_...\",\n \"accountLabel\": \"primary\"\n}")
.asString();{
"accountLabel": "<string>",
"createdAt": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"owner": {
"type": "organization"
},
"provider": "google",
"scopes": [
"<string>"
],
"type": "oauth",
"updatedAt": "<string>"
}{
"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.
Body
application/json
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
Credential provider to store an API key for.
Example:
"custom"
API key secret. It is stored securely and is not returned.
Example:
"sk_live_..."
Optional human-readable account label.
Example:
"primary"
Response
Created reusable API-key connection.
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