Integrations
Create a FOCUS push connection
Creates a connection you send your own FOCUS billing records to with POST /tenant/billing/focus, and returns its fpc_ connection_id. provider is optional: the first push sets it from the rows when it is left empty. provider_account_id is the billing account the charges belong to. tenant_id defaults to the tenant of a tenant-bound credential and is required for a session token. The caller must be an organization owner, admin or billing admin. Answers 409 when the provider and billing account already have a connection in the organization.
POST
/
api
/
v1
/
integrations
/
connections
Create a FOCUS push connection
curl --request POST \
--url https://api.costgraph.ai/api/v1/integrations/connections \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"provider_account_id": "<string>",
"display_name": "<string>",
"provider": "<string>",
"tenant_id": "<string>"
}
'import requests
url = "https://api.costgraph.ai/api/v1/integrations/connections"
payload = {
"provider_account_id": "<string>",
"display_name": "<string>",
"provider": "<string>",
"tenant_id": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
provider_account_id: '<string>',
display_name: '<string>',
provider: '<string>',
tenant_id: '<string>'
})
};
fetch('https://api.costgraph.ai/api/v1/integrations/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.costgraph.ai/api/v1/integrations/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([
'provider_account_id' => '<string>',
'display_name' => '<string>',
'provider' => '<string>',
'tenant_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.costgraph.ai/api/v1/integrations/connections"
payload := strings.NewReader("{\n \"provider_account_id\": \"<string>\",\n \"display_name\": \"<string>\",\n \"provider\": \"<string>\",\n \"tenant_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.costgraph.ai/api/v1/integrations/connections")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"provider_account_id\": \"<string>\",\n \"display_name\": \"<string>\",\n \"provider\": \"<string>\",\n \"tenant_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.costgraph.ai/api/v1/integrations/connections")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"provider_account_id\": \"<string>\",\n \"display_name\": \"<string>\",\n \"provider\": \"<string>\",\n \"tenant_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "some message",
"status": "success",
"data": {
"ci_history": {
"days_loaded": 123,
"days_total": 123
},
"connection_id": "<string>",
"created_at": "<string>",
"display_name": "<string>",
"id": "<string>",
"ingest_mode": "pull",
"last_sync_error": "<string>",
"last_synced_at": "<string>",
"needs_service_token": true,
"provider": "<string>",
"provider_account_id": "<string>",
"recommendations_checked_at": "<string>",
"recommendations_status": "<string>",
"status": "<string>",
"tenant_id": "<string>",
"updated_at": "<string>",
"warnings": [
"<string>"
]
}
}{
"message": "some message",
"status": "error"
}{
"message": "some message",
"status": "error"
}{
"message": "some message",
"status": "error"
}{
"message": "some message",
"status": "error"
}Authorizations
Enter "Bearer {token}"
Body
application/json
Push connection
Was this page helpful?
⌘I
Create a FOCUS push connection
curl --request POST \
--url https://api.costgraph.ai/api/v1/integrations/connections \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"provider_account_id": "<string>",
"display_name": "<string>",
"provider": "<string>",
"tenant_id": "<string>"
}
'import requests
url = "https://api.costgraph.ai/api/v1/integrations/connections"
payload = {
"provider_account_id": "<string>",
"display_name": "<string>",
"provider": "<string>",
"tenant_id": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
provider_account_id: '<string>',
display_name: '<string>',
provider: '<string>',
tenant_id: '<string>'
})
};
fetch('https://api.costgraph.ai/api/v1/integrations/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.costgraph.ai/api/v1/integrations/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([
'provider_account_id' => '<string>',
'display_name' => '<string>',
'provider' => '<string>',
'tenant_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.costgraph.ai/api/v1/integrations/connections"
payload := strings.NewReader("{\n \"provider_account_id\": \"<string>\",\n \"display_name\": \"<string>\",\n \"provider\": \"<string>\",\n \"tenant_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.costgraph.ai/api/v1/integrations/connections")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"provider_account_id\": \"<string>\",\n \"display_name\": \"<string>\",\n \"provider\": \"<string>\",\n \"tenant_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.costgraph.ai/api/v1/integrations/connections")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"provider_account_id\": \"<string>\",\n \"display_name\": \"<string>\",\n \"provider\": \"<string>\",\n \"tenant_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "some message",
"status": "success",
"data": {
"ci_history": {
"days_loaded": 123,
"days_total": 123
},
"connection_id": "<string>",
"created_at": "<string>",
"display_name": "<string>",
"id": "<string>",
"ingest_mode": "pull",
"last_sync_error": "<string>",
"last_synced_at": "<string>",
"needs_service_token": true,
"provider": "<string>",
"provider_account_id": "<string>",
"recommendations_checked_at": "<string>",
"recommendations_status": "<string>",
"status": "<string>",
"tenant_id": "<string>",
"updated_at": "<string>",
"warnings": [
"<string>"
]
}
}{
"message": "some message",
"status": "error"
}{
"message": "some message",
"status": "error"
}{
"message": "some message",
"status": "error"
}{
"message": "some message",
"status": "error"
}