Skip to content

Integrări ​

10 endpoint-uri. Fiecare cale de mai jos este relativă la URL-ul de bază al API-ului și include deja prefixul /api/v1 — vezi convențiile pentru autentificare, paginare, erori și idempotență.

Endpoint
GET/integrationsThe connect gallery: connectable integrations by category, with this org's connections
GET/integrations/{slug}One catalogue entry, including its declared action schemas
GET/integrations/connectionsList this organization's integration connections
POST/integrations/connectionsConnect an integration, encrypting any supplied secrets into a credential row, and return the connection
GET/integrations/connections/{connection}Retrieve one integration connection; secrets live in the credential row and are not returned
DELETE/integrations/connections/{connection}Disconnect an integration: revoke the OAuth grant, wipe and delete the credential, drop the connection
POST/integrations/connections/{connection}/actions/{action}Run one of the connector's declared actions and return the connector's result envelope
POST/integrations/connections/{connection}/syncPull remote records from the connector into CallAgent and return the sync result
POST/integrations/connections/{connection}/testMake a cheap read-only call through the connection to prove the stored credential still works
GET/integrations/toolsList the connector actions this organization's connected integrations expose to assistants as tools

Endpoint-uri ​

The connect gallery: connectable integrations by category, with this org's connections ​

GET/integrations
  • Handler-ul nu impune niciun scope — orice cheie validă îl poate apela.
  • Enforces no scope. data is an object keyed by category, not an array, and connectors whose maturity is not implemented are omitted entirely.
bash
curl -X GET "$CALLAGENT_API_URL/integrations" \
  -H "Authorization: Bearer $CALLAGENT_API_KEY" \
  -H "Accept: application/json"
js
const response = await fetch(`${process.env.CALLAGENT_API_URL}/integrations`, {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.CALLAGENT_API_KEY}`,
    Accept: 'application/json',
  },
});

if (!response.ok) {
  const { error } = await response.json();
  throw new Error(`${error.type}: ${error.message}`);
}

const { data } = await response.json();
php
<?php

$handle = curl_init(getenv('CALLAGENT_API_URL') . '/integrations');

curl_setopt_array($handle, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('CALLAGENT_API_KEY'),
        'Accept: application/json',
    ],
]);

$body = json_decode(curl_exec($handle), true);
$status = curl_getinfo($handle, CURLINFO_HTTP_CODE);
curl_close($handle);

if ($status >= 400) {
    throw new RuntimeException("{$body['error']['type']}: {$body['error']['message']}");
}

$data = $body['data'];
python
import os, requests

response = requests.get(
    f"{os.environ['CALLAGENT_API_URL']}/integrations",
    headers={"Authorization": f"Bearer {os.environ['CALLAGENT_API_KEY']}"},
    timeout=30,
)
response.raise_for_status()
data = response.json()["data"]

Răspunsuri

StatusCorp
200data-wrapped object

Exemplu de răspuns, generat din schemă:

json
{
  "data": {}
}

One catalogue entry, including its declared action schemas ​

GET/integrations/{slug}
  • Handler-ul nu impune niciun scope — orice cheie validă îl poate apela.
  • Only connectors with maturity implemented resolve; a registered but unimplemented connector 404s here even though it exists in code.

Parametri de cale

NumeTipObligatoriuNote
slugstringda
bash
curl -X GET "$CALLAGENT_API_URL/integrations/google-calendar" \
  -H "Authorization: Bearer $CALLAGENT_API_KEY" \
  -H "Accept: application/json"
js
const response = await fetch(`${process.env.CALLAGENT_API_URL}/integrations/google-calendar`, {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.CALLAGENT_API_KEY}`,
    Accept: 'application/json',
  },
});

if (!response.ok) {
  const { error } = await response.json();
  throw new Error(`${error.type}: ${error.message}`);
}

const { data } = await response.json();
php
<?php

$handle = curl_init(getenv('CALLAGENT_API_URL') . '/integrations/google-calendar');

curl_setopt_array($handle, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('CALLAGENT_API_KEY'),
        'Accept: application/json',
    ],
]);

$body = json_decode(curl_exec($handle), true);
$status = curl_getinfo($handle, CURLINFO_HTTP_CODE);
curl_close($handle);

if ($status >= 400) {
    throw new RuntimeException("{$body['error']['type']}: {$body['error']['message']}");
}

$data = $body['data'];
python
import os, requests

response = requests.get(
    f"{os.environ['CALLAGENT_API_URL']}/integrations/google-calendar",
    headers={"Authorization": f"Bearer {os.environ['CALLAGENT_API_KEY']}"},
    timeout=30,
)
response.raise_for_status()
data = response.json()["data"]

Răspunsuri

StatusCorp
200data-wrapped object

Erori

StatusCând apare
404No connectable integration with that slug

Exemplu de răspuns, generat din schemă:

json
{
  "data": {
    "slug": "string",
    "name": "Support Line",
    "category": "string",
    "description": "string",
    "auth_type": "string",
    "auth_fields": {},
    "default_scopes": {},
    "capabilities": {},
    "documentation_url": "https://example.com/hook"
  }
}

List this organization's integration connections ​

GET/integrations/connections
  • Handler-ul nu impune niciun scope — orice cheie validă îl poate apela.
  • Enforces no scope — there is no integration.read in the vocabulary, so any authenticated key can list connections. The integration filter matches the connector slug.
bash
curl -X GET "$CALLAGENT_API_URL/integrations/connections" \
  -H "Authorization: Bearer $CALLAGENT_API_KEY" \
  -H "Accept: application/json"
js
const response = await fetch(`${process.env.CALLAGENT_API_URL}/integrations/connections`, {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.CALLAGENT_API_KEY}`,
    Accept: 'application/json',
  },
});

if (!response.ok) {
  const { error } = await response.json();
  throw new Error(`${error.type}: ${error.message}`);
}

const { data } = await response.json();
php
<?php

$handle = curl_init(getenv('CALLAGENT_API_URL') . '/integrations/connections');

curl_setopt_array($handle, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('CALLAGENT_API_KEY'),
        'Accept: application/json',
    ],
]);

$body = json_decode(curl_exec($handle), true);
$status = curl_getinfo($handle, CURLINFO_HTTP_CODE);
curl_close($handle);

if ($status >= 400) {
    throw new RuntimeException("{$body['error']['type']}: {$body['error']['message']}");
}

$data = $body['data'];
python
import os, requests

response = requests.get(
    f"{os.environ['CALLAGENT_API_URL']}/integrations/connections",
    headers={"Authorization": f"Bearer {os.environ['CALLAGENT_API_KEY']}"},
    timeout=30,
)
response.raise_for_status()
data = response.json()["data"]

Răspunsuri

StatusCorp
200Array of IntegrationConnectionResource

Exemplu de răspuns, generat din schemă:

json
{
  "data": [
    {
      "id": "01JQ0000000000000000000000",
      "object": "string",
      "integration": "string",
      "name": "Support Line",
      "status": "string",
      "active": true,
      "config": {},
      "granted_capabilities": {},
      "auth": "oauth2",
      "connected_at": "2026-01-01T12:00:00+00:00",
      "last_tested_at": "2026-01-01T12:00:00+00:00",
      "last_test_status": "string",
      "last_synced_at": "2026-01-01T12:00:00+00:00",
      "last_error": "string",
      "created_at": "2026-01-01T12:00:00+00:00"
    }
  ]
}

Connect an integration, encrypting any supplied secrets into a credential row, and return the connection ​

POST/integrations/connections

API-key connectors take their credentials in secrets, which are encrypted immediately and never returned. OAuth connectors take an oauth_connection_id from a completed authorization.

  • Necesită integration.write.
  • A connector whose maturity is not implemented is refused with 422 invalid_integration. Missing catalogue rows 404 via firstOrFail, which the spec does not declare.

Corpul cererii

CâmpTipObligatoriuNote
integrationstringdamax 64 chars
namestringdamax 255 chars
secretsstring[] | null—
configstring[] | null—
oauth_connection_idstring | null—
bash
curl -X POST "$CALLAGENT_API_URL/integrations/connections" \
  -H "Authorization: Bearer $CALLAGENT_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
       "integration": "string",
       "name": "Support Line",
       "oauth_connection_id": "01JQ0000000000000000000000"
     }'
js
const response = await fetch(`${process.env.CALLAGENT_API_URL}/integrations/connections`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.CALLAGENT_API_KEY}`,
    Accept: 'application/json',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "integration": "string",
    "name": "Support Line",
    "oauth_connection_id": "01JQ0000000000000000000000"
  }),
});

if (!response.ok) {
  const { error } = await response.json();
  throw new Error(`${error.type}: ${error.message}`);
}

const { data } = await response.json();
php
<?php

$handle = curl_init(getenv('CALLAGENT_API_URL') . '/integrations/connections');

curl_setopt_array($handle, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('CALLAGENT_API_KEY'),
        'Accept: application/json',
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => json_encode([
    'integration' => 'string',
    'name' => 'Support Line',
    'oauth_connection_id' => '01JQ0000000000000000000000',
]),
]);

$body = json_decode(curl_exec($handle), true);
$status = curl_getinfo($handle, CURLINFO_HTTP_CODE);
curl_close($handle);

if ($status >= 400) {
    throw new RuntimeException("{$body['error']['type']}: {$body['error']['message']}");
}

$data = $body['data'];
python
import os, requests

response = requests.post(
    f"{os.environ['CALLAGENT_API_URL']}/integrations/connections",
    headers={"Authorization": f"Bearer {os.environ['CALLAGENT_API_KEY']}"},
    json={
      "integration": "string",
      "name": "Support Line",
      "oauth_connection_id": "01JQ0000000000000000000000"
    },
    timeout=30,
)
response.raise_for_status()
data = response.json()["data"]

Răspunsuri

StatusCorp
201data-wrapped object

Erori

StatusCând apare
403The presenting API key does not carry the integration.write scope
404The connector exists in code but has no row in the integrations catalogue
422Validation failed, the connector slug is unknown, or the connector is not implemented yet

Exemplu de răspuns, generat din schemă:

json
{
  "data": {
    "id": "01JQ0000000000000000000000",
    "object": "string",
    "integration": "string",
    "name": "Support Line",
    "status": "string",
    "active": true,
    "config": {},
    "granted_capabilities": {},
    "auth": "oauth2",
    "connected_at": "2026-01-01T12:00:00+00:00",
    "last_tested_at": "2026-01-01T12:00:00+00:00",
    "last_test_status": "string",
    "last_synced_at": "2026-01-01T12:00:00+00:00",
    "last_error": "string",
    "created_at": "2026-01-01T12:00:00+00:00"
  }
}

Retrieve one integration connection; secrets live in the credential row and are not returned ​

GET/integrations/connections/{connection}
  • Handler-ul nu impune niciun scope — orice cheie validă îl poate apela.
  • Enforces no scope, unlike every write action on the same resource.

Parametri de cale

NumeTipObligatoriuNote
connectionstringdaThe connection ID
bash
curl -X GET "$CALLAGENT_API_URL/integrations/connections/01JQ0000000000000000000000" \
  -H "Authorization: Bearer $CALLAGENT_API_KEY" \
  -H "Accept: application/json"
js
const response = await fetch(`${process.env.CALLAGENT_API_URL}/integrations/connections/01JQ0000000000000000000000`, {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.CALLAGENT_API_KEY}`,
    Accept: 'application/json',
  },
});

if (!response.ok) {
  const { error } = await response.json();
  throw new Error(`${error.type}: ${error.message}`);
}

const { data } = await response.json();
php
<?php

$handle = curl_init(getenv('CALLAGENT_API_URL') . '/integrations/connections/01JQ0000000000000000000000');

curl_setopt_array($handle, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('CALLAGENT_API_KEY'),
        'Accept: application/json',
    ],
]);

$body = json_decode(curl_exec($handle), true);
$status = curl_getinfo($handle, CURLINFO_HTTP_CODE);
curl_close($handle);

if ($status >= 400) {
    throw new RuntimeException("{$body['error']['type']}: {$body['error']['message']}");
}

$data = $body['data'];
python
import os, requests

response = requests.get(
    f"{os.environ['CALLAGENT_API_URL']}/integrations/connections/01JQ0000000000000000000000",
    headers={"Authorization": f"Bearer {os.environ['CALLAGENT_API_KEY']}"},
    timeout=30,
)
response.raise_for_status()
data = response.json()["data"]

Răspunsuri

StatusCorp
200IntegrationConnectionResource

Erori

StatusCând apare
404No such connection in this organization

Exemplu de răspuns, generat din schemă:

json
{
  "data": {
    "id": "01JQ0000000000000000000000",
    "object": "string",
    "integration": "string",
    "name": "Support Line",
    "status": "string",
    "active": true,
    "config": {},
    "granted_capabilities": {},
    "auth": "oauth2",
    "connected_at": "2026-01-01T12:00:00+00:00",
    "last_tested_at": "2026-01-01T12:00:00+00:00",
    "last_test_status": "string",
    "last_synced_at": "2026-01-01T12:00:00+00:00",
    "last_error": "string",
    "created_at": "2026-01-01T12:00:00+00:00"
  }
}

Disconnect an integration: revoke the OAuth grant, wipe and delete the credential, drop the connection ​

DELETE/integrations/connections/{connection}
  • Necesită integration.write.
  • Acest răspuns nu este împachetat în data.
  • The credential's ciphertext is cleared before the row is soft-deleted, so the disconnect leaves no usable key material behind.

Parametri de cale

NumeTipObligatoriuNote
connectionstringdaThe connection ID
bash
curl -X DELETE "$CALLAGENT_API_URL/integrations/connections/01JQ0000000000000000000000" \
  -H "Authorization: Bearer $CALLAGENT_API_KEY" \
  -H "Accept: application/json"
js
const response = await fetch(`${process.env.CALLAGENT_API_URL}/integrations/connections/01JQ0000000000000000000000`, {
  method: 'DELETE',
  headers: {
    Authorization: `Bearer ${process.env.CALLAGENT_API_KEY}`,
    Accept: 'application/json',
  },
});

if (!response.ok) {
  const { error } = await response.json();
  throw new Error(`${error.type}: ${error.message}`);
}

const { data } = await response.json();
php
<?php

$handle = curl_init(getenv('CALLAGENT_API_URL') . '/integrations/connections/01JQ0000000000000000000000');

curl_setopt_array($handle, [
    CURLOPT_CUSTOMREQUEST => 'DELETE',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('CALLAGENT_API_KEY'),
        'Accept: application/json',
    ],
]);

$body = json_decode(curl_exec($handle), true);
$status = curl_getinfo($handle, CURLINFO_HTTP_CODE);
curl_close($handle);

if ($status >= 400) {
    throw new RuntimeException("{$body['error']['type']}: {$body['error']['message']}");
}

$data = $body['data'];
python
import os, requests

response = requests.delete(
    f"{os.environ['CALLAGENT_API_URL']}/integrations/connections/01JQ0000000000000000000000",
    headers={"Authorization": f"Bearer {os.environ['CALLAGENT_API_KEY']}"},
    timeout=30,
)
response.raise_for_status()
data = response.json()["data"]

Răspunsuri

StatusCorp
204No content

Erori

StatusCând apare
403The presenting API key does not carry the integration.write scope
404No such connection in this organization

Run one of the connector's declared actions and return the connector's result envelope ​

POST/integrations/connections/{connection}/actions/{action}
  • Necesită integration.write.
  • Only error code unknown_action maps to 404; not_connected and unknown_connector both come back as 502. The action's declared input_schema is NOT validated by the API.

Parametri de cale

NumeTipObligatoriuNote
connectionstringdaThe connection ID
actionstringda

Corpul cererii

CâmpTipObligatoriuNote
inputstring[] | null—
bash
curl -X POST "$CALLAGENT_API_URL/integrations/connections/01JQ0000000000000000000000/actions/createEvent" \
  -H "Authorization: Bearer $CALLAGENT_API_KEY" \
  -H "Accept: application/json"
js
const response = await fetch(`${process.env.CALLAGENT_API_URL}/integrations/connections/01JQ0000000000000000000000/actions/createEvent`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.CALLAGENT_API_KEY}`,
    Accept: 'application/json',
  },
});

if (!response.ok) {
  const { error } = await response.json();
  throw new Error(`${error.type}: ${error.message}`);
}

const { data } = await response.json();
php
<?php

$handle = curl_init(getenv('CALLAGENT_API_URL') . '/integrations/connections/01JQ0000000000000000000000/actions/createEvent');

curl_setopt_array($handle, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('CALLAGENT_API_KEY'),
        'Accept: application/json',
    ],
]);

$body = json_decode(curl_exec($handle), true);
$status = curl_getinfo($handle, CURLINFO_HTTP_CODE);
curl_close($handle);

if ($status >= 400) {
    throw new RuntimeException("{$body['error']['type']}: {$body['error']['message']}");
}

$data = $body['data'];
python
import os, requests

response = requests.post(
    f"{os.environ['CALLAGENT_API_URL']}/integrations/connections/01JQ0000000000000000000000/actions/createEvent",
    headers={"Authorization": f"Bearer {os.environ['CALLAGENT_API_KEY']}"},
    timeout=30,
)
response.raise_for_status()
data = response.json()["data"]

Răspunsuri

StatusCorp
200JSON object

Erori

StatusCând apare
403The presenting API key does not carry the integration.write scope
404The connection does not exist, or the connector does not declare that action
422input was sent but is not an array
502The connector failed, is not registered, or the connection is not in a connected state

Exemplu de răspuns, generat din schemă:

json
"string"

Pull remote records from the connector into CallAgent and return the sync result ​

POST/integrations/connections/{connection}/sync
  • Necesită integration.write.
  • Effectively a stub for all but one connector: only McpConnector overrides sync, so every other connection returns 502 with error code not_implemented.

Parametri de cale

NumeTipObligatoriuNote
connectionstringdaThe connection ID
bash
curl -X POST "$CALLAGENT_API_URL/integrations/connections/01JQ0000000000000000000000/sync" \
  -H "Authorization: Bearer $CALLAGENT_API_KEY" \
  -H "Accept: application/json"
js
const response = await fetch(`${process.env.CALLAGENT_API_URL}/integrations/connections/01JQ0000000000000000000000/sync`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.CALLAGENT_API_KEY}`,
    Accept: 'application/json',
  },
});

if (!response.ok) {
  const { error } = await response.json();
  throw new Error(`${error.type}: ${error.message}`);
}

const { data } = await response.json();
php
<?php

$handle = curl_init(getenv('CALLAGENT_API_URL') . '/integrations/connections/01JQ0000000000000000000000/sync');

curl_setopt_array($handle, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('CALLAGENT_API_KEY'),
        'Accept: application/json',
    ],
]);

$body = json_decode(curl_exec($handle), true);
$status = curl_getinfo($handle, CURLINFO_HTTP_CODE);
curl_close($handle);

if ($status >= 400) {
    throw new RuntimeException("{$body['error']['type']}: {$body['error']['message']}");
}

$data = $body['data'];
python
import os, requests

response = requests.post(
    f"{os.environ['CALLAGENT_API_URL']}/integrations/connections/01JQ0000000000000000000000/sync",
    headers={"Authorization": f"Bearer {os.environ['CALLAGENT_API_KEY']}"},
    timeout=30,
)
response.raise_for_status()
data = response.json()["data"]

Răspunsuri

StatusCorp
200JSON object

Erori

StatusCând apare
403The presenting API key does not carry the integration.write scope
404No such connection in this organization
502The connector failed, is not registered, or does not implement sync

Exemplu de răspuns, generat din schemă:

json
"string"

Make a cheap read-only call through the connection to prove the stored credential still works ​

POST/integrations/connections/{connection}/test
  • Necesită integration.write.
  • A failing test is HTTP 502 with ok:false, and it also writes last_tested_at, last_test_status and status back onto the connection.

Parametri de cale

NumeTipObligatoriuNote
connectionstringdaThe connection ID
bash
curl -X POST "$CALLAGENT_API_URL/integrations/connections/01JQ0000000000000000000000/test" \
  -H "Authorization: Bearer $CALLAGENT_API_KEY" \
  -H "Accept: application/json"
js
const response = await fetch(`${process.env.CALLAGENT_API_URL}/integrations/connections/01JQ0000000000000000000000/test`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.CALLAGENT_API_KEY}`,
    Accept: 'application/json',
  },
});

if (!response.ok) {
  const { error } = await response.json();
  throw new Error(`${error.type}: ${error.message}`);
}

const { data } = await response.json();
php
<?php

$handle = curl_init(getenv('CALLAGENT_API_URL') . '/integrations/connections/01JQ0000000000000000000000/test');

curl_setopt_array($handle, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('CALLAGENT_API_KEY'),
        'Accept: application/json',
    ],
]);

$body = json_decode(curl_exec($handle), true);
$status = curl_getinfo($handle, CURLINFO_HTTP_CODE);
curl_close($handle);

if ($status >= 400) {
    throw new RuntimeException("{$body['error']['type']}: {$body['error']['message']}");
}

$data = $body['data'];
python
import os, requests

response = requests.post(
    f"{os.environ['CALLAGENT_API_URL']}/integrations/connections/01JQ0000000000000000000000/test",
    headers={"Authorization": f"Bearer {os.environ['CALLAGENT_API_KEY']}"},
    timeout=30,
)
response.raise_for_status()
data = response.json()["data"]

Răspunsuri

StatusCorp
200JSON object

Erori

StatusCând apare
403The presenting API key does not carry the integration.write scope
404No such connection in this organization
502The connector rejected the credential, failed, or is not registered

Exemplu de răspuns, generat din schemă:

json
"string"

List the connector actions this organization's connected integrations expose to assistants as tools ​

GET/integrations/tools
  • Handler-ul nu impune niciun scope — orice cheie validă îl poate apela.
  • Only connections in a connected state and connectors with exposesTools() contribute; tool names are <slug>_<action>.
bash
curl -X GET "$CALLAGENT_API_URL/integrations/tools" \
  -H "Authorization: Bearer $CALLAGENT_API_KEY" \
  -H "Accept: application/json"
js
const response = await fetch(`${process.env.CALLAGENT_API_URL}/integrations/tools`, {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.CALLAGENT_API_KEY}`,
    Accept: 'application/json',
  },
});

if (!response.ok) {
  const { error } = await response.json();
  throw new Error(`${error.type}: ${error.message}`);
}

const { data } = await response.json();
php
<?php

$handle = curl_init(getenv('CALLAGENT_API_URL') . '/integrations/tools');

curl_setopt_array($handle, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('CALLAGENT_API_KEY'),
        'Accept: application/json',
    ],
]);

$body = json_decode(curl_exec($handle), true);
$status = curl_getinfo($handle, CURLINFO_HTTP_CODE);
curl_close($handle);

if ($status >= 400) {
    throw new RuntimeException("{$body['error']['type']}: {$body['error']['message']}");
}

$data = $body['data'];
python
import os, requests

response = requests.get(
    f"{os.environ['CALLAGENT_API_URL']}/integrations/tools",
    headers={"Authorization": f"Bearer {os.environ['CALLAGENT_API_KEY']}"},
    timeout=30,
)
response.raise_for_status()
data = response.json()["data"]

Răspunsuri

StatusCorp
200data-wrapped array

Exemplu de răspuns, generat din schemă:

json
{
  "data": [
    {
      "name": "Support Line",
      "description": "string",
      "input_schema": "string",
      "connection_id": "01JQ0000000000000000000000",
      "action": "string",
      "mutating": "string"
    }
  ]
}

Scrisă după cod. Ce nu este încă implementat este marcat ca atare, niciodată descris ca funcțional.