Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@elevenlabs/elevenlabs-js",
"version": "v2.33.0",
"version": "v2.34.0",
"private": false,
"repository": "github:elevenlabs/elevenlabs-js",
"license": "MIT",
Expand Down
136 changes: 40 additions & 96 deletions reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -1073,7 +1073,7 @@ Generate dialogue from text with precise character-level timing information for

```typescript
await client.textToDialogue.convertWithTimestamps({
outputFormat: "mp3_22050_32",
outputFormat: "alaw_8000",
inputs: [{
text: "Hello, how are you?",
voiceId: "bYTqZQo3Jz7LQtmGTgwi"
Expand Down Expand Up @@ -6832,7 +6832,7 @@ await client.conversationalAi.settings.update();
</details>

## ConversationalAi Secrets
<details><summary><code>client.conversationalAi.secrets.<a href="/src/api/resources/conversationalAi/resources/secrets/client/Client.ts">list</a>() -> ElevenLabs.GetWorkspaceSecretsResponseModel</code></summary>
<details><summary><code>client.conversationalAi.secrets.<a href="/src/api/resources/conversationalAi/resources/secrets/client/Client.ts">list</a>({ ...params }) -> ElevenLabs.GetWorkspaceSecretsResponseModel</code></summary>
<dl>
<dd>

Expand All @@ -6859,7 +6859,10 @@ Get all workspace secrets for the user
<dd>

```typescript
await client.conversationalAi.secrets.list();
await client.conversationalAi.secrets.list({
pageSize: 1,
cursor: "cursor"
});

```
</dd>
Expand All @@ -6875,6 +6878,14 @@ await client.conversationalAi.secrets.list();
<dl>
<dd>

**request:** `ElevenLabs.conversationalAi.SecretsListRequest`

</dd>
</dl>

<dl>
<dd>

**requestOptions:** `SecretsClient.RequestOptions`

</dd>
Expand Down Expand Up @@ -7866,62 +7877,7 @@ await client.conversationalAi.mcpServers.update("mcp_server_id");
</details>

## ConversationalAi WhatsappAccounts
<details><summary><code>client.conversationalAi.whatsappAccounts.<a href="/src/api/resources/conversationalAi/resources/whatsappAccounts/client/Client.ts">list</a>() -> ElevenLabs.ListWhatsAppAccountsResponse</code></summary>
<dl>
<dd>

#### 📝 Description

<dl>
<dd>

<dl>
<dd>

List all WhatsApp accounts
</dd>
</dl>
</dd>
</dl>

#### 🔌 Usage

<dl>
<dd>

<dl>
<dd>

```typescript
await client.conversationalAi.whatsappAccounts.list();

```
</dd>
</dl>
</dd>
</dl>

#### ⚙️ Parameters

<dl>
<dd>

<dl>
<dd>

**requestOptions:** `WhatsappAccountsClient.RequestOptions`

</dd>
</dl>
</dd>
</dl>


</dd>
</dl>
</details>

<details><summary><code>client.conversationalAi.whatsappAccounts.<a href="/src/api/resources/conversationalAi/resources/whatsappAccounts/client/Client.ts">import</a>({ ...params }) -> ElevenLabs.ImportWhatsAppAccountResponse</code></summary>
<details><summary><code>client.conversationalAi.whatsappAccounts.<a href="/src/api/resources/conversationalAi/resources/whatsappAccounts/client/Client.ts">get</a>(phone_number_id) -> ElevenLabs.GetWhatsAppAccountResponse</code></summary>
<dl>
<dd>

Expand All @@ -7933,7 +7889,7 @@ await client.conversationalAi.whatsappAccounts.list();
<dl>
<dd>

Import a WhatsApp account
Get a WhatsApp account
</dd>
</dl>
</dd>
Expand All @@ -7948,11 +7904,7 @@ Import a WhatsApp account
<dd>

```typescript
await client.conversationalAi.whatsappAccounts.import({
businessAccountId: "business_account_id",
phoneNumberId: "phone_number_id",
tokenCode: "token_code"
});
await client.conversationalAi.whatsappAccounts.get("phone_number_id");

```
</dd>
Expand All @@ -7968,7 +7920,7 @@ await client.conversationalAi.whatsappAccounts.import({
<dl>
<dd>

**request:** `ElevenLabs.conversationalAi.ImportWhatsAppAccountRequest`
**phone_number_id:** `string`

</dd>
</dl>
Expand All @@ -7988,7 +7940,7 @@ await client.conversationalAi.whatsappAccounts.import({
</dl>
</details>

<details><summary><code>client.conversationalAi.whatsappAccounts.<a href="/src/api/resources/conversationalAi/resources/whatsappAccounts/client/Client.ts">get</a>(phone_number_id) -> ElevenLabs.GetWhatsAppAccountResponse</code></summary>
<details><summary><code>client.conversationalAi.whatsappAccounts.<a href="/src/api/resources/conversationalAi/resources/whatsappAccounts/client/Client.ts">delete</a>(phone_number_id) -> unknown</code></summary>
<dl>
<dd>

Expand All @@ -8000,7 +7952,7 @@ await client.conversationalAi.whatsappAccounts.import({
<dl>
<dd>

Get a WhatsApp account
Delete a WhatsApp account
</dd>
</dl>
</dd>
Expand All @@ -8015,7 +7967,7 @@ Get a WhatsApp account
<dd>

```typescript
await client.conversationalAi.whatsappAccounts.get("phone_number_id");
await client.conversationalAi.whatsappAccounts.delete("phone_number_id");

```
</dd>
Expand Down Expand Up @@ -8051,7 +8003,7 @@ await client.conversationalAi.whatsappAccounts.get("phone_number_id");
</dl>
</details>

<details><summary><code>client.conversationalAi.whatsappAccounts.<a href="/src/api/resources/conversationalAi/resources/whatsappAccounts/client/Client.ts">delete</a>(phone_number_id) -> unknown</code></summary>
<details><summary><code>client.conversationalAi.whatsappAccounts.<a href="/src/api/resources/conversationalAi/resources/whatsappAccounts/client/Client.ts">update</a>(phone_number_id, { ...params }) -> unknown</code></summary>
<dl>
<dd>

Expand All @@ -8063,7 +8015,7 @@ await client.conversationalAi.whatsappAccounts.get("phone_number_id");
<dl>
<dd>

Delete a WhatsApp account
Update a WhatsApp account
</dd>
</dl>
</dd>
Expand All @@ -8078,7 +8030,7 @@ Delete a WhatsApp account
<dd>

```typescript
await client.conversationalAi.whatsappAccounts.delete("phone_number_id");
await client.conversationalAi.whatsappAccounts.update("phone_number_id");

```
</dd>
Expand All @@ -8102,6 +8054,14 @@ await client.conversationalAi.whatsappAccounts.delete("phone_number_id");
<dl>
<dd>

**request:** `ElevenLabs.conversationalAi.UpdateWhatsAppAccountRequest`

</dd>
</dl>

<dl>
<dd>

**requestOptions:** `WhatsappAccountsClient.RequestOptions`

</dd>
Expand All @@ -8114,7 +8074,7 @@ await client.conversationalAi.whatsappAccounts.delete("phone_number_id");
</dl>
</details>

<details><summary><code>client.conversationalAi.whatsappAccounts.<a href="/src/api/resources/conversationalAi/resources/whatsappAccounts/client/Client.ts">update</a>(phone_number_id, { ...params }) -> unknown</code></summary>
<details><summary><code>client.conversationalAi.whatsappAccounts.<a href="/src/api/resources/conversationalAi/resources/whatsappAccounts/client/Client.ts">list</a>() -> ElevenLabs.ListWhatsAppAccountsResponse</code></summary>
<dl>
<dd>

Expand All @@ -8126,7 +8086,7 @@ await client.conversationalAi.whatsappAccounts.delete("phone_number_id");
<dl>
<dd>

Update a WhatsApp account
List all WhatsApp accounts
</dd>
</dl>
</dd>
Expand All @@ -8141,7 +8101,7 @@ Update a WhatsApp account
<dd>

```typescript
await client.conversationalAi.whatsappAccounts.update("phone_number_id");
await client.conversationalAi.whatsappAccounts.list();

```
</dd>
Expand All @@ -8157,22 +8117,6 @@ await client.conversationalAi.whatsappAccounts.update("phone_number_id");
<dl>
<dd>

**phone_number_id:** `string`

</dd>
</dl>

<dl>
<dd>

**request:** `ElevenLabs.conversationalAi.UpdateWhatsAppAccountRequest`

</dd>
</dl>

<dl>
<dd>

**requestOptions:** `WhatsappAccountsClient.RequestOptions`

</dd>
Expand Down Expand Up @@ -16437,7 +16381,7 @@ await client.workspace.groups.search({
<dl>
<dd>

Sends an email invitation to join your workspace to the provided email. If the user doesn't have an account they will be prompted to create one. If the user accepts this invite they will be added as a user to your workspace and your subscription using one of your seats. This endpoint may only be called by workspace administrators. If the user is already in the workspace a 400 error will be returned.
Sends an email invitation to join your workspace to the provided email. If the user doesn't have an account they will be prompted to create one. If the user accepts this invite they will be added as a user to your workspace and your subscription using one of your seats. This endpoint may only be called by workspace members with the WORKSPACE_MEMBERS_INVITE permission. If the user is already in the workspace a 400 error will be returned.
</dd>
</dl>
</dd>
Expand Down Expand Up @@ -16502,7 +16446,7 @@ await client.workspace.invites.create({
<dl>
<dd>

Sends email invitations to join your workspace to the provided emails. Requires all email addresses to be part of a verified domain. If the users don't have an account they will be prompted to create one. If the users accept these invites they will be added as users to your workspace and your subscription using one of your seats. This endpoint may only be called by workspace administrators.
Sends email invitations to join your workspace to the provided emails. Requires all email addresses to be part of a verified domain. If the users don't have an account they will be prompted to create one. If the users accept these invites they will be added as users to your workspace and your subscription using one of your seats. This endpoint may only be called by workspace members with the WORKSPACE_MEMBERS_INVITE permission.
</dd>
</dl>
</dd>
Expand Down Expand Up @@ -16567,7 +16511,7 @@ await client.workspace.invites.createBatch({
<dl>
<dd>

Invalidates an existing email invitation. The invitation will still show up in the inbox it has been delivered to, but activating it to join the workspace won't work. This endpoint may only be called by workspace administrators.
Invalidates an existing email invitation. The invitation will still show up in the inbox it has been delivered to, but activating it to join the workspace won't work. This endpoint may only be called by workspace members with the WORKSPACE_MEMBERS_INVITE permission.
</dd>
</dl>
</dd>
Expand Down Expand Up @@ -16920,7 +16864,7 @@ await client.workspace.resources.unshare("resource_id", {
<dl>
<dd>

Removes a member from the specified group. This endpoint may only be called by workspace administrators.
Removes a member from the specified group. Requires `group_members_manage` permission.
</dd>
</dl>
</dd>
Expand Down Expand Up @@ -16993,7 +16937,7 @@ await client.workspace.groups.members.remove("group_id", {
<dl>
<dd>

Adds a member of your workspace to the specified group. This endpoint may only be called by workspace administrators.
Adds a member of your workspace to the specified group. Requires `group_members_manage` permission.
</dd>
</dl>
</dd>
Expand Down
4 changes: 2 additions & 2 deletions src/BaseClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ export function normalizeClientOptions<T extends BaseClientOptions>(options: T):
{
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@elevenlabs/elevenlabs-js",
"X-Fern-SDK-Version": "v2.33.0",
"User-Agent": "@elevenlabs/elevenlabs-js/v2.33.0",
"X-Fern-SDK-Version": "v2.34.0",
"User-Agent": "@elevenlabs/elevenlabs-js/v2.34.0",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
"xi-api-key": options?.apiKey,
Expand Down
51 changes: 51 additions & 0 deletions src/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,57 @@ export class ElevenLabsClient {
return (this._workspace ??= new WorkspaceClient(this._options));
}

/**
* @param {ElevenLabsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @example
* await client.postV1ConvaiWhatsappAccounts()
*/
public postV1ConvaiWhatsappAccounts(
requestOptions?: ElevenLabsClient.RequestOptions,
): core.HttpResponsePromise<void> {
return core.HttpResponsePromise.fromPromise(this.__postV1ConvaiWhatsappAccounts(requestOptions));
}

private async __postV1ConvaiWhatsappAccounts(
requestOptions?: ElevenLabsClient.RequestOptions,
): Promise<core.WithRawResponse<void>> {
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
this._options?.headers,
mergeOnlyDefinedHeaders({ "xi-api-key": requestOptions?.apiKey ?? this._options?.apiKey }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
url: core.url.join(
(await core.Supplier.get(this._options.baseUrl)) ??
(await core.Supplier.get(this._options.environment)) ??
environments.ElevenLabsEnvironment.Production,
"v1/convai/whatsapp-accounts",
),
method: "POST",
headers: _headers,
queryParameters: requestOptions?.queryParams,
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 240) * 1000,
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
logging: this._options.logging,
});
if (_response.ok) {
return { data: undefined, rawResponse: _response.rawResponse };
}

if (_response.error.reason === "status-code") {
throw new errors.ElevenLabsError({
statusCode: _response.error.statusCode,
body: _response.error.body,
rawResponse: _response.rawResponse,
});
}

return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/convai/whatsapp-accounts");
}

/**
* @param {string} agent_id
* @param {string} branch_id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@ export interface UpdateAgentRequest {
tags?: string[];
/** Description for this version when publishing changes (only applicable for versioned agents) */
versionDescription?: string;
/** List of procedure refs used for this agent version. */
procedureRefs?: ElevenLabs.conversationalAi.BodyPatchesAnAgentSettingsV1ConvaiAgentsAgentIdPatchProcedureRefsItem[];
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from "./client";
export * from "./resources";
export * from "./types";
Loading