Provider Keys - TypeScript SDK
client.providerKeys manages caller-owned external provider credentials. The
SDK sends these values only to provider-key APIs.
Overview
Available Operations
| Method | Description |
|---|---|
providers() | List supported provider identifiers and labels. |
list(options?) | List masked provider keys; admin callers may filter by owner. |
create(body) | Store a provider credential. |
update(id, body) | Rotate the credential or update its description. |
changeStatus(id, body) | Enable or disable a provider key. |
test(id) | Test provider connectivity with the stored key. |
delete(id) | Delete a provider key. |
providers
List supported provider identifiers and labels.
Request
This method has no parameters and sends no request body.
Response
ProviderInfo[].
list
List masked provider keys; admin callers may filter by owner.
Request
Optional {ownerId}.
Response
ProviderKeyVO[].
create
Store a provider credential.
Request
Required provider, apiKey; optional description.
Response
ProviderKeyVO.
update
Rotate the credential or update its description.
Request
id; optional apiKey, description.
Response
Updated ProviderKeyVO.
changeStatus
Enable or disable a provider key.
Request
id and {status} required.
Response
null.
test
Test provider connectivity with the stored key.
Request
id required.
Response
ConnectionTestResult.
delete
Delete a provider key.
Request
id required.
Response
null.
Field Reference and Examples
ProviderInfo contains provider, label, and baseUrl. ProviderKeyVO
contains id, ownerId, provider, maskedApiKey, description, status,
available, unavailableReasonCode, and createdAt. Connection tests return
success and message. Use the identifier from providers(), not its label.
const providers = await client.providerKeys.providers<Array<{ provider: string }>>();
const keys = await client.providerKeys.list();
const created = await client.providerKeys.create<{ id: number }>({
provider: providers[0]!.provider,
apiKey: "provider-api-key",
description: "integration credential",
});
const result = await client.providerKeys.test(created.id);
const updated = await client.providerKeys.update(created.id, {
description: "rotated",
});
await client.providerKeys.changeStatus(created.id, { status: 1 });
await client.providerKeys.delete(created.id);
All methods use the shared authentication and typed error behavior described in Response Conventions and Retry and Security.