Integration Credentials
Store and manage provider credentials for telephony, AI, calendar, and storage integrations.
Overview
Integration credentials securely store provider-specific secrets (API keys, tokens, account SIDs, etc.) for integrations that are pre-registered in the platform catalog. Once saved, credentials are referenced by ID across agents, phone numbers, and call configuration — the raw secrets are never returned in API responses.
The SDK manages credentials for integrations that already exist in the platform catalog. It does not expose an integration-list hook, so obtain the integration_id from the ScaleAI dashboard or use the API reference.
Integration types
IntegrationType | Used for |
|---|---|
"telephony" | Phone number providers (Twilio, Plivo, Exotel, Vobiz). |
"ai_provider" | Alternative LLM providers for agent inference. |
"calendar" | Calendar integrations for slot-checking and appointment tools. |
"server_credential" | Webhook signing secrets and server-to-server auth tokens. |
"object_storage" | Cloud storage for call recordings and audio files. |
Hooks
useGetIntegrationCredentials
Fetches a paginated list of integration credentials for the current project.
import { useGetIntegrationCredentials } from "@scalereal/sr-voice-engine-react-sdk/hooks";
function CredentialList() {
const { data, isLoading } = useGetIntegrationCredentials({
integration_type: "telephony",
is_active: true,
page: 1,
size: 20,
});
if (isLoading) return <p>Loading…</p>;
return (
<ul>
{data?.results.map((cred) => (
<li key={cred.id}>
{cred.label} — {cred.integration.name}
</li>
))}
</ul>
);
}Parameters
| Parameter | Type | Description |
|---|---|---|
page | number | Page index (1-based). |
size | number | Results per page. |
label__ilike | string | Case-insensitive partial match on label. |
integration_id | string | Filter by catalog integration ID. |
integration_type | IntegrationType | Filter by integration category. |
is_active | boolean | Filter active/inactive credentials. |
order_by | string | Sort field, e.g. "-created_at" for newest-first. |
useGetIntegrationCredential
Fetches a single credential by ID.
import { useGetIntegrationCredential } from "@scalereal/sr-voice-engine-react-sdk/hooks";
function CredentialDetail({ credentialId }: { credentialId: string }) {
const { data } = useGetIntegrationCredential(credentialId);
return <pre>{JSON.stringify(data, null, 2)}</pre>;
}Parameters
| Parameter | Type | Description |
|---|---|---|
credentialId | string | ID of the credential to fetch. |
enabled | boolean | Set to false to disable the query (default: true). |
The credentials field in the response has secrets masked by the API. You will receive a partial or redacted object — not the original plaintext values. Store secrets in a secrets manager if you need to retrieve them later.
useCreateIntegrationCredential
Creates a new credential record.
import { useCreateIntegrationCredential } from "@scalereal/sr-voice-engine-react-sdk/hooks";
function AddTwilioCredential() {
const { mutate, isPending } = useCreateIntegrationCredential();
const handleSave = () => {
mutate({
integration_id: "intg_twilio_catalog_id",
label: "Twilio Production",
is_active: true,
credentials: {
account_sid: "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
auth_token: "your_auth_token",
},
});
};
return (
<button onClick={handleSave} disabled={isPending}>
Save Credential
</button>
);
}Mutation body
| Field | Type | Required | Description |
|---|---|---|---|
integration_id | string | ✓ | Catalog integration ID (from dashboard or API reference). |
label | string | ✓ | Human-readable name for this credential set. |
credentials | Record<string, unknown> | ✓ | Provider-specific key/value pairs (shape varies by integration). |
is_active | boolean | Whether to activate immediately (default: true). |
useUpdateIntegrationCredential
Partially updates an existing credential (PATCH semantics — all fields optional).
import { useUpdateIntegrationCredential } from "@scalereal/sr-voice-engine-react-sdk/hooks";
function RenameCredential({ credentialId }: { credentialId: string }) {
const { mutate } = useUpdateIntegrationCredential();
return (
<button
onClick={() =>
mutate({ credentialId, data: { label: "Twilio Staging" } })
}
>
Rename
</button>
);
}Mutation body
| Field | Type | Description |
|---|---|---|
credentialId | string | ID of the credential to update. |
data.label | string | New human-readable label. |
data.credentials | Record<string, unknown> | Updated provider secrets (full replace). |
data.is_active | boolean | Enable or disable the credential. |
useDeleteIntegrationCredential
Permanently deletes a credential record.
Deleting a credential that is actively referenced by agents or phone numbers will break those integrations at runtime. Reassign or remove those references before deleting.
import { useDeleteIntegrationCredential } from "@scalereal/sr-voice-engine-react-sdk/hooks";
function DeleteButton({ credentialId }: { credentialId: string }) {
const { mutate, isPending } = useDeleteIntegrationCredential();
return (
<button onClick={() => mutate({ credentialId })} disabled={isPending}>
Delete
</button>
);
}Mutation body
| Field | Type | Description |
|---|---|---|
credentialId | string | ID of the credential to delete. |
Types
IntegrationCredential
interface IntegrationCredential {
id: string;
label: string;
is_active: boolean;
/** Provider-specific fields. Secrets are masked in API responses. */
credentials: Record<string, unknown>;
integration: {
id: string;
name: string;
type: IntegrationType;
};
}IntegrationType
type IntegrationType =
| "ai_provider"
| "telephony"
| "calendar"
| "server_credential"
| "object_storage";Usage by integration type
Telephony credentials
Telephony credentials authenticate the platform with your provider account (Twilio, Plivo, etc.) to purchase, sync, and route calls. The credentials object typically contains your account SID and auth token or API key pair.
Calendar credentials
Calendar credentials are consumed by function tools of type check_slot_availability and book_appointment. After creating the credential, reference integration_credential_id when creating the tool.
AI provider credentials
Store API keys for alternative LLM providers here. Agents can be configured to use a non-default model via an AI provider credential instead of the platform default.
Server credentials
Used to sign or authenticate outbound webhook requests from the platform to your server endpoints.
Object storage credentials
Configures where call recordings and audio assets are stored. Attach object storage credentials to a project via the dashboard.
Cache keys
import { integrationCredentialKeys } from "@scalereal/sr-voice-engine-react-sdk/hooks";
// Invalidate all credential queries
queryClient.invalidateQueries({ queryKey: integrationCredentialKeys.all });
// Invalidate a single credential
queryClient.invalidateQueries({
queryKey: integrationCredentialKeys.detail(credentialId),
});Related pages
- Function Tools — tools that use calendar and custom credentials
- Phone Numbers — telephony numbers that rely on provider credentials
- Agents — attach AI provider credentials to agents