diff --git a/.fern/metadata.json b/.fern/metadata.json
index 0a17558..e98224d 100644
--- a/.fern/metadata.json
+++ b/.fern/metadata.json
@@ -1,15 +1,15 @@
{
- "cliVersion": "5.51.2",
+ "cliVersion": "5.100.0",
"generatorName": "fernapi/fern-php-sdk",
"generatorVersion": "2.4.0",
"generatorConfig": {
"namespace": "Vapi",
"client-class-name": "VapiClient"
},
- "originGitCommit": "5a015aa01196915bea6110904c69d5804f457ff5",
+ "originGitCommit": "eabfa530011ea11c0387cafc424df7a105bf9de5",
"originGitCommitIsDirty": true,
"invokedBy": "ci",
"requestedVersion": "AUTO",
"ciProvider": "unknown",
- "sdkVersion": "2.0.0"
+ "sdkVersion": "2.0.1"
}
\ No newline at end of file
diff --git a/.fern/replay.lock b/.fern/replay.lock
new file mode 100644
index 0000000..6958565
--- /dev/null
+++ b/.fern/replay.lock
@@ -0,0 +1,16 @@
+# DO NOT EDIT MANUALLY - Managed by Fern Replay
+version: "1.0"
+generations:
+ - commit_sha: 13cd0c5de1ca81174c35f2ed009501bad4407ee6
+ tree_hash: d10238b3698b8720795caaba3fff560bf0649009
+ timestamp: 2026-08-20T18:43:26.042Z
+ cli_version: unknown
+ generator_versions: {}
+ - commit_sha: 44dbe6c7ebde49dad4687a7c96e1bd4990095dc1
+ tree_hash: c0e9ced45d6b523237053d195748c23952936a61
+ timestamp: 2026-08-20T18:43:26.843Z
+ cli_version: unknown
+ generator_versions:
+ fernapi/fern-php-sdk: 2.4.0
+current_generation: 44dbe6c7ebde49dad4687a7c96e1bd4990095dc1
+patches: []
diff --git a/.fernignore b/.fernignore
index 978b3fa..0e6333f 100644
--- a/.fernignore
+++ b/.fernignore
@@ -1,3 +1,6 @@
# Specify files that shouldn't be modified by Fern
.github/workflows/sdk-release-pr-notification.yml
changelog.md
+.fern/replay.lock
+.fern/replay.yml
+.gitattributes
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..74928d6
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1 @@
+.fern/replay.lock linguist-generated=true
diff --git a/changelog.md b/changelog.md
index 9e9180d..c23f9aa 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,3 +1,5 @@
+## [2.0.1] - 2026-08-20
+
## 2.0.0 - 2026-06-24
### Breaking Changes
* **`CartesiaExperimentalControlsSpeedZero`** has been renamed to `CartesiaSpeedControlZero`. Update any references to this enum in your code to use the new name.
diff --git a/composer.json b/composer.json
index be52097..48297ac 100644
--- a/composer.json
+++ b/composer.json
@@ -1,6 +1,6 @@
{
"name": "vapi/vapi",
- "version": "2.0.0",
+ "version": "2.0.1",
"description": "Vapi PHP Library",
"keywords": [
"vapi",
diff --git a/reference.md b/reference.md
index 676984d..fcf9e81 100644
--- a/reference.md
+++ b/reference.md
@@ -4,6 +4,20 @@
-
+#### 📝 Description
+
+
+-
+
+
+-
+
+Returns assistants for the authenticated organization. Filter results by creation or update timestamps and limit the number returned.
+
+
+
+
+
#### 🔌 Usage
@@ -110,6 +124,20 @@ $client->assistants->list(
-
+#### 📝 Description
+
+
+-
+
+
+-
+
+Creates a reusable assistant configuration containing the model, voice, transcriber, tools, prompts, and call behavior.
+
+
+
+
+
#### 🔌 Usage
@@ -152,6 +180,20 @@ $client->assistants->create(
-
+#### 📝 Description
+
+
+-
+
+
+-
+
+Returns the assistant identified by its ID.
+
+
+
+
+
#### 🔌 Usage
@@ -178,7 +220,7 @@ $client->assistants->get(
-
-**$id:** `string`
+**$id:** `string` — The unique identifier of the assistant.
@@ -194,6 +236,20 @@ $client->assistants->get(
-
+#### 📝 Description
+
+
+-
+
+
+-
+
+Deletes the assistant identified by its ID.
+
+
+
+
+
#### 🔌 Usage
@@ -220,7 +276,7 @@ $client->assistants->delete(
-
-**$id:** `string`
+**$id:** `string` — The unique identifier of the assistant.
@@ -236,6 +292,20 @@ $client->assistants->delete(
-
+#### 📝 Description
+
+
+-
+
+
+-
+
+Updates the specified fields of the assistant identified by its ID.
+
+
+
+
+
#### 🔌 Usage
@@ -263,7 +333,7 @@ $client->assistants->update(
-
-**$id:** `string`
+**$id:** `string` — The unique identifier of the assistant.
@@ -307,7 +377,7 @@ If unspecified, assistant will wait for user to speak and use the model to respo
-
-**$firstMessageInterruptionsEnabled:** `?bool`
+**$firstMessageInterruptionsEnabled:** `?bool` — Set to `true` to allow the user to interrupt the assistant while it speaks the first message. Default is `false`.
@@ -474,7 +544,7 @@ If unspecified, it will hang up without saying anything.
-
-**$compliancePlan:** `?CompliancePlan`
+**$compliancePlan:** `?CompliancePlan` — Compliance settings for the assistant, including HIPAA and PCI behavior, security filtering, and recording consent.
@@ -597,7 +667,7 @@ The order of precedence is:
-
-**$keypadInputPlan:** `?KeypadInputPlan`
+**$keypadInputPlan:** `?KeypadInputPlan` — Configuration for collecting and processing DTMF keypad input during calls.
@@ -614,6 +684,20 @@ The order of precedence is:
-
+#### 📝 Description
+
+
+-
+
+
+-
+
+Returns squads for the authenticated organization. Filter results by creation or update timestamps and limit the number returned.
+
+
+
+
+
#### 🔌 Usage
@@ -640,6 +724,14 @@ $client->squads->list(
-
+**$idAny:** `?string` — Return only squads matching the provided ids
+
+
+
+
+
+-
+
**$limit:** `?float` — This is the maximum number of items to return. Defaults to 100.
@@ -720,6 +812,20 @@ $client->squads->list(
-
+#### 📝 Description
+
+
+-
+
+
+-
+
+Creates a squad that coordinates multiple assistants and their handoffs during a conversation.
+
+
+
+
+
#### 🔌 Usage
@@ -766,6 +872,20 @@ $client->squads->create(
-
+#### 📝 Description
+
+
+-
+
+
+-
+
+Returns the squad identified by its ID.
+
+
+
+
+
#### 🔌 Usage
@@ -792,7 +912,7 @@ $client->squads->get(
-
-**$id:** `string`
+**$id:** `string` — The unique identifier of the squad.
@@ -808,6 +928,20 @@ $client->squads->get(
-
+#### 📝 Description
+
+
+-
+
+
+-
+
+Deletes the squad identified by its ID.
+
+
+
+
+
#### 🔌 Usage
@@ -834,7 +968,7 @@ $client->squads->delete(
-
-**$id:** `string`
+**$id:** `string` — The unique identifier of the squad.
@@ -850,6 +984,20 @@ $client->squads->delete(
-
+#### 📝 Description
+
+
+-
+
+
+-
+
+Updates the specified fields of the squad identified by its ID.
+
+
+
+
+
#### 🔌 Usage
@@ -881,7 +1029,7 @@ $client->squads->update(
-
-**$id:** `string`
+**$id:** `string` — The unique identifier of the squad.
@@ -930,6 +1078,20 @@ Both `membersOverrides` and `members[n].assistantOverrides` can be used together
-
+#### 📝 Description
+
+
+-
+
+
+-
+
+Returns calls for the authenticated organization. Filter results by call ID, assistant ID, phone number ID, or creation and update timestamps.
+
+
+
+
+
#### 🔌 Usage
@@ -1064,6 +1226,20 @@ Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type.
-
+#### 📝 Description
+
+
+-
+
+
+-
+
+Creates a call using an assistant or squad. The request can reference saved resources or include transient configurations.
+
+
+
+
+
#### 🔌 Usage
@@ -1090,11 +1266,18 @@ $client->calls->create(
-
-**$customers:** `?array`
+**$assistantVersion:** `?string`
-This is used to issue batch calls to multiple customers.
+This is the assistant version to use for this call. Supported only with
+direct `assistantId`. Omit to follow the latest version.
+
+
+
-Only relevant for `outboundPhoneCall`. To call a single customer, use `customer` instead.
+
+-
+
+**$transport:** `?CreateCallDtoTransport` — This is the transport of the call.
@@ -1102,7 +1285,11 @@ Only relevant for `outboundPhoneCall`. To call a single customer, use `customer`
-
-**$name:** `?string` — This is the name of the call. This is just for your own reference.
+**$customers:** `?array`
+
+This is used to issue batch calls to multiple customers.
+
+Only relevant for `outboundPhoneCall`. To call a single customer, use `customer` instead.
@@ -1110,7 +1297,7 @@ Only relevant for `outboundPhoneCall`. To call a single customer, use `customer`
-
-**$schedulePlan:** `?SchedulePlan` — This is the schedule plan of the call.
+**$name:** `?string` — This is the name of the call. This is just for your own reference.
@@ -1118,7 +1305,7 @@ Only relevant for `outboundPhoneCall`. To call a single customer, use `customer`
-
-**$transport:** `?array` — This is the transport of the call.
+**$schedulePlan:** `?SchedulePlan` — This is the schedule plan of the call.
@@ -1299,6 +1486,20 @@ Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type.
-
+#### 📝 Description
+
+
+-
+
+
+-
+
+Returns the call identified by its ID, including its status, configuration, and available call data.
+
+
+
+
+
#### 🔌 Usage
@@ -1325,7 +1526,7 @@ $client->calls->get(
-
-**$id:** `string`
+**$id:** `string` — The unique identifier of the call.
@@ -1341,6 +1542,20 @@ $client->calls->get(
-
+#### 📝 Description
+
+
+-
+
+
+-
+
+Deletes the call identified by its ID.
+
+
+
+
+
#### 🔌 Usage
@@ -1397,6 +1612,20 @@ It may take up to a few hours to complete the bulk delete, and will be asynchron
-
+#### 📝 Description
+
+
+-
+
+
+-
+
+Updates the call identified by its ID.
+
+
+
+
+
#### 🔌 Usage
@@ -1424,7 +1653,7 @@ $client->calls->update(
-
-**$id:** `string`
+**$id:** `string` — The unique identifier of the call.
@@ -1444,8 +1673,7 @@ $client->calls->update(
-## Chats
-$client->chats->list($request) -> ?ChatPaginatedResponse
+$client->calls->callArtifactControllerMonoRecordingDownload($id)
-
@@ -1458,10 +1686,8 @@ $client->calls->update(
-
```php
-$client->chats->list(
- new ListChatsRequest([
- 'assistantIdAny' => 'assistant-1,assistant-2,assistant-3',
- ]),
+$client->calls->callArtifactControllerMonoRecordingDownload(
+ 'id',
);
```
@@ -1477,47 +1703,4551 @@ $client->chats->list(
-
-**$id:** `?string` — This is the unique identifier for the chat to filter by.
+**$id:** `string` — Call ID
+
+
-
--
-**$assistantId:** `?string` — This is the unique identifier for the assistant that will be used for the chat.
-
+
+$client->calls->callArtifactControllerStereoRecordingDownload($id)
-
-**$assistantIdAny:** `?string` — Filter by multiple assistant IDs. Provide as comma-separated values.
-
-
-
+#### 🔌 Usage
-
-**$squadId:** `?string` — This is the unique identifier for the squad that will be used for the chat.
-
-
-
-
-
-**$sessionId:** `?string` — This is the unique identifier for the session that will be used for the chat.
-
-
+```php
+$client->calls->callArtifactControllerStereoRecordingDownload(
+ 'id',
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$id:** `string` — Call ID
+
+
+
+
+
+
+
+
+
+
+
+$client->calls->callArtifactControllerVideoRecordingDownload($id)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->calls->callArtifactControllerVideoRecordingDownload(
+ 'id',
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$id:** `string` — Call ID
+
+
+
+
+
+
+
+
+
+
+
+$client->calls->callArtifactControllerCustomerRecordingDownload($id)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->calls->callArtifactControllerCustomerRecordingDownload(
+ 'id',
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$id:** `string` — Call ID
+
+
+
+
+
+
+
+
+
+
+
+$client->calls->callArtifactControllerAssistantRecordingDownload($id)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->calls->callArtifactControllerAssistantRecordingDownload(
+ 'id',
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$id:** `string` — Call ID
+
+
+
+
+
+
+
+
+
+
+
+$client->calls->callArtifactControllerPcapDownload($id)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->calls->callArtifactControllerPcapDownload(
+ 'id',
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$id:** `string` — Call ID
+
+
+
+
+
+
+
+
+
+
+
+$client->calls->callArtifactControllerCallLogsDownload($id)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->calls->callArtifactControllerCallLogsDownload(
+ 'id',
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$id:** `string` — Call ID
+
+
+
+
+
+
+
+
+
+
+
+## Chats
+$client->chats->list($request) -> ?ChatPaginatedResponse
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->chats->list(
+ new ListChatsRequest([
+ 'assistantIdAny' => 'assistant-1,assistant-2,assistant-3',
+ ]),
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$id:** `?string` — This is the unique identifier for the chat to filter by.
+
+
+
+
+
+-
+
+**$assistantId:** `?string` — This is the unique identifier for the assistant that will be used for the chat.
+
+
+
+
+
+-
+
+**$assistantIdAny:** `?string` — Filter by multiple assistant IDs. Provide as comma-separated values.
+
+
+
+
+
+-
+
+**$squadId:** `?string` — This is the unique identifier for the squad that will be used for the chat.
+
+
+
+
+
+-
+
+**$sessionId:** `?string` — This is the unique identifier for the session that will be used for the chat.
+
+
+
+
+
+-
+
+**$previousChatId:** `?string` — This is the unique identifier for the previous chat to filter by.
+
+
+
+
+
+-
+
+**$idAny:** `?string` — Filter by multiple chat IDs. Provide as comma-separated values.
+
+
+
+
+
+-
+
+**$page:** `?float` — This is the page number to return. Defaults to 1.
+
+
+
+
+
+-
+
+**$sortOrder:** `?string` — This is the sort order for pagination. Defaults to 'DESC'.
+
+
+
+
+
+-
+
+**$sortBy:** `?string` — This is the column to sort by. Defaults to 'createdAt'.
+
+
+
+
+
+-
+
+**$limit:** `?float` — This is the maximum number of items to return. Defaults to 100.
+
+
+
+
+
+-
+
+**$createdAtGt:** `?DateTime` — This will return items where the createdAt is greater than the specified value.
+
+
+
+
+
+-
+
+**$createdAtLt:** `?DateTime` — This will return items where the createdAt is less than the specified value.
+
+
+
+
+
+-
+
+**$createdAtGe:** `?DateTime` — This will return items where the createdAt is greater than or equal to the specified value.
+
+
+
+
+
+-
+
+**$createdAtLe:** `?DateTime` — This will return items where the createdAt is less than or equal to the specified value.
+
+
+
+
+
+-
+
+**$updatedAtGt:** `?DateTime` — This will return items where the updatedAt is greater than the specified value.
+
+
+
+
+
+-
+
+**$updatedAtLt:** `?DateTime` — This will return items where the updatedAt is less than the specified value.
+
+
+
+
+
+-
+
+**$updatedAtGe:** `?DateTime` — This will return items where the updatedAt is greater than or equal to the specified value.
+
+
+
+
+
+-
+
+**$updatedAtLe:** `?DateTime` — This will return items where the updatedAt is less than or equal to the specified value.
+
+
+
+
+
+
+
+
+
+
+
+$client->chats->create($request) -> Chat|CreateChatStreamResponse|null
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Creates a new chat with optional SMS delivery via transport field. Requires at least one of: assistantId/assistant, sessionId, or previousChatId. Note: sessionId and previousChatId are mutually exclusive. Transport field enables SMS delivery with two modes: (1) New conversation - provide transport.phoneNumberId and transport.customer to create a new session, (2) Existing conversation - provide sessionId to use existing session data. Cannot specify both sessionId and transport fields together. The transport.useLLMGeneratedMessageForOutbound flag controls whether input is processed by LLM (true, default) or forwarded directly as SMS (false).
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->chats->create(
+ new CreateChatDto([
+ 'input' => 'input',
+ ]),
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$assistantId:** `?string` — This is the assistant that will be used for the chat. To use an existing assistant, use `assistantId` instead.
+
+
+
+
+
+-
+
+**$assistant:** `?CreateAssistantDto` — This is the assistant that will be used for the chat. To use an existing assistant, use `assistantId` instead.
+
+
+
+
+
+-
+
+**$assistantOverrides:** `?AssistantOverrides`
+
+These are the variable values that will be used to replace template variables in the assistant messages.
+Only variable substitution is supported in chat contexts - other assistant properties cannot be overridden.
+
+
+
+
+
+-
+
+**$squadId:** `?string` — This is the squad that will be used for the chat. To use a transient squad, use `squad` instead.
+
+
+
+
+
+-
+
+**$squad:** `?CreateSquadDto` — This is the squad that will be used for the chat. To use an existing squad, use `squadId` instead.
+
+
+
+
+
+-
+
+**$name:** `?string` — This is the name of the chat. This is just for your own reference.
+
+
+
+
+
+-
+
+**$sessionId:** `?string`
+
+This is the ID of the session that will be used for the chat.
+Mutually exclusive with previousChatId.
+
+
+
+
+
+-
+
+**$input:** `string|array`
+
+This is the input text for the chat.
+Can be a string or an array of chat messages.
+This field is REQUIRED for chat creation.
+
+
+
+
+
+-
+
+**$stream:** `?bool`
+
+This is a flag that determines whether the response should be streamed.
+When true, the response will be sent as chunks of text.
+
+
+
+
+
+-
+
+**$previousChatId:** `?string`
+
+This is the ID of the chat that will be used as context for the new chat.
+The messages from the previous chat will be used as context.
+Mutually exclusive with sessionId.
+
+
+
+
+
+-
+
+**$transport:** `?TwilioSmsChatTransport`
+
+This is used to send the chat through a transport like SMS.
+If transport.phoneNumberId and transport.customer are provided, creates a new session.
+If sessionId is provided without transport fields, uses existing session data.
+Cannot specify both sessionId and transport fields (phoneNumberId/customer) together.
+
+
+
+
+
+
+
+
+
+
+
+$client->chats->get($id) -> ?Chat
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->chats->get(
+ 'id',
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$id:** `string`
+
+
+
+
+
+
+
+
+
+
+
+$client->chats->delete($id) -> ?Chat
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->chats->delete(
+ 'id',
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$id:** `string`
+
+
+
+
+
+
+
+
+
+
+
+$client->chats->createResponse($request) -> ResponseObject|ResponseTextDeltaEvent|ResponseTextDoneEvent|ResponseCompletedEvent|ResponseErrorEvent|null
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->chats->createResponse(
+ new OpenAiResponsesRequest([
+ 'input' => 'input',
+ ]),
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$assistantId:** `?string` — This is the assistant that will be used for the chat. To use an existing assistant, use `assistantId` instead.
+
+
+
+
+
+-
+
+**$assistant:** `?CreateAssistantDto` — This is the assistant that will be used for the chat. To use an existing assistant, use `assistantId` instead.
+
+
+
+
+
+-
+
+**$assistantOverrides:** `?AssistantOverrides`
+
+These are the variable values that will be used to replace template variables in the assistant messages.
+Only variable substitution is supported in chat contexts - other assistant properties cannot be overridden.
+
+
+
+
+
+-
+
+**$squadId:** `?string` — This is the squad that will be used for the chat. To use a transient squad, use `squad` instead.
+
+
+
+
+
+-
+
+**$squad:** `?CreateSquadDto` — This is the squad that will be used for the chat. To use an existing squad, use `squadId` instead.
+
+
+
+
+
+-
+
+**$name:** `?string` — This is the name of the chat. This is just for your own reference.
+
+
+
+
+
+-
+
+**$sessionId:** `?string`
+
+This is the ID of the session that will be used for the chat.
+Mutually exclusive with previousChatId.
+
+
+
+
+
+-
+
+**$input:** `string|array`
+
+This is the input text for the chat.
+Can be a string or an array of chat messages.
+This field is REQUIRED for chat creation.
+
+
+
+
+
+-
+
+**$stream:** `?bool` — Whether to stream the response or not.
+
+
+
+
+
+-
+
+**$previousChatId:** `?string`
+
+This is the ID of the chat that will be used as context for the new chat.
+The messages from the previous chat will be used as context.
+Mutually exclusive with sessionId.
+
+
+
+
+
+-
+
+**$transport:** `?TwilioSmsChatTransport`
+
+This is used to send the chat through a transport like SMS.
+If transport.phoneNumberId and transport.customer are provided, creates a new session.
+If sessionId is provided without transport fields, uses existing session data.
+Cannot specify both sessionId and transport fields (phoneNumberId/customer) together.
+
+
+
+
+
+
+
+
+
+
+
+## Campaigns
+$client->campaigns->campaignControllerFindAll($request) -> ?CampaignPaginatedResponse
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Returns outbound calling campaigns for the authenticated organization. Filter results by campaign ID, status, or creation and update timestamps.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->campaigns->campaignControllerFindAll(
+ new CampaignControllerFindAllRequest([]),
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$id:** `?string` — Filters campaigns by ID.
+
+
+
+
+
+-
+
+**$status:** `?string` — Filters campaigns by status.
+
+
+
+
+
+-
+
+**$page:** `?float` — This is the page number to return. Defaults to 1.
+
+
+
+
+
+-
+
+**$sortOrder:** `?string` — This is the sort order for pagination. Defaults to 'DESC'.
+
+
+
+
+
+-
+
+**$sortBy:** `?string` — This is the column to sort by. Defaults to 'createdAt'.
+
+
+
+
+
+-
+
+**$limit:** `?float` — This is the maximum number of items to return. Defaults to 100.
+
+
+
+
+
+-
+
+**$createdAtGt:** `?DateTime` — This will return items where the createdAt is greater than the specified value.
+
+
+
+
+
+-
+
+**$createdAtLt:** `?DateTime` — This will return items where the createdAt is less than the specified value.
+
+
+
+
+
+-
+
+**$createdAtGe:** `?DateTime` — This will return items where the createdAt is greater than or equal to the specified value.
+
+
+
+
+
+-
+
+**$createdAtLe:** `?DateTime` — This will return items where the createdAt is less than or equal to the specified value.
+
+
+
+
+
+-
+
+**$updatedAtGt:** `?DateTime` — This will return items where the updatedAt is greater than the specified value.
+
+
+
+
+
+-
+
+**$updatedAtLt:** `?DateTime` — This will return items where the updatedAt is less than the specified value.
+
+
+
+
+
+-
+
+**$updatedAtGe:** `?DateTime` — This will return items where the updatedAt is greater than or equal to the specified value.
+
+
+
+
+
+-
+
+**$updatedAtLe:** `?DateTime` — This will return items where the updatedAt is less than or equal to the specified value.
+
+
+
+
+
+
+
+
+
+
+
+$client->campaigns->campaignControllerCreate($request) -> ?Campaign
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Creates an outbound calling campaign that calls a set of customers.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->campaigns->campaignControllerCreate(
+ new CreateCampaignDto([
+ 'name' => 'Q2 Sales Campaign',
+ ]),
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$request:** `CreateCampaignDto`
+
+
+
+
+
+
+
+
+
+
+
+$client->campaigns->campaignControllerFindAllV2($request) -> ?CampaignSummaryPaginatedResponse
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->campaigns->campaignControllerFindAllV2(
+ new CampaignControllerFindAllV2Request([]),
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$id:** `?string`
+
+
+
+
+
+-
+
+**$status:** `?string`
+
+
+
+
+
+-
+
+**$includeCounters:** `?bool`
+
+When true, every campaign in the response includes `contactCounters` and
+`callMetrics`. These are aggregate queries over contacts and events —
+batched across the page, so the cost is three queries per request rather
+than three per campaign, but still opt-in rather than paid for on every
+read. Defaults to false.
+
+
+
+
+
+-
+
+**$page:** `?float` — This is the page number to return. Defaults to 1.
+
+
+
+
+
+-
+
+**$sortOrder:** `?string` — This is the sort order for pagination. Defaults to 'DESC'.
+
+
+
+
+
+-
+
+**$sortBy:** `?string` — This is the column to sort by. Defaults to 'createdAt'.
+
+
+
+
+
+-
+
+**$limit:** `?float` — This is the maximum number of items to return. Defaults to 100.
+
+
+
+
+
+-
+
+**$createdAtGt:** `?DateTime` — This will return items where the createdAt is greater than the specified value.
+
+
+
+
+
+-
+
+**$createdAtLt:** `?DateTime` — This will return items where the createdAt is less than the specified value.
+
+
+
+
+
+-
+
+**$createdAtGe:** `?DateTime` — This will return items where the createdAt is greater than or equal to the specified value.
+
+
+
+
+
+-
+
+**$createdAtLe:** `?DateTime` — This will return items where the createdAt is less than or equal to the specified value.
+
+
+
+
+
+-
+
+**$updatedAtGt:** `?DateTime` — This will return items where the updatedAt is greater than the specified value.
+
+
+
+
+
+-
+
+**$updatedAtLt:** `?DateTime` — This will return items where the updatedAt is less than the specified value.
+
+
+
+
+
+-
+
+**$updatedAtGe:** `?DateTime` — This will return items where the updatedAt is greater than or equal to the specified value.
+
+
+
+
+
+-
+
+**$updatedAtLe:** `?DateTime` — This will return items where the updatedAt is less than or equal to the specified value.
+
+
+
+
+
+
+
+
+
+
+
+$client->campaigns->campaignControllerCreateV2($request) -> ?Campaign
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->campaigns->campaignControllerCreateV2(
+ new CreateCampaignDto([
+ 'name' => 'Q2 Sales Campaign',
+ ]),
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$request:** `CreateCampaignDto`
+
+
+
+
+
+
+
+
+
+
+
+$client->campaigns->campaignControllerFindOneV2($id, $request) -> ?CampaignSummary
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->campaigns->campaignControllerFindOneV2(
+ 'id',
+ new CampaignControllerFindOneV2Request([]),
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$id:** `string` — The unique identifier for the resource.
+
+
+
+
+
+-
+
+**$includeCounters:** `?bool`
+
+When true, the response includes `contactCounters` and `callMetrics`.
+These are aggregate queries over the campaign's contacts and events, so
+they are opt-in rather than paid for on every read. Defaults to false.
+
+
+
+
+
+
+
+
+
+
+
+$client->campaigns->campaignControllerRemoveV2($id) -> ?Campaign
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->campaigns->campaignControllerRemoveV2(
+ 'id',
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$id:** `string` — The unique identifier for the resource.
+
+
+
+
+
+
+
+
+
+
+
+$client->campaigns->campaignControllerUpdateV2($id, $request) -> ?Campaign
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->campaigns->campaignControllerUpdateV2(
+ 'id',
+ new CampaignControllerUpdateV2Request([
+ 'body' => new UpdateCampaignDto([]),
+ ]),
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$id:** `string` — The unique identifier for the resource.
+
+
+
+
+
+-
+
+**$request:** `UpdateCampaignDto`
+
+
+
+
+
+
+
+
+
+
+
+$client->campaigns->campaignControllerFindOne($id) -> ?Campaign
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Returns the outbound calling campaign identified by its ID.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->campaigns->campaignControllerFindOne(
+ 'id',
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$id:** `string` — The unique identifier of the campaign.
+
+
+
+
+
+
+
+
+
+
+
+$client->campaigns->campaignControllerRemove($id) -> ?Campaign
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Deletes the outbound calling campaign identified by its ID.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->campaigns->campaignControllerRemove(
+ 'id',
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$id:** `string` — The unique identifier of the campaign.
+
+
+
+
+
+
+
+
+
+
+
+$client->campaigns->campaignControllerUpdate($id, $request) -> ?Campaign
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Updates the outbound calling campaign identified by its ID. Campaigns can be ended by updating their status to `ended`.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->campaigns->campaignControllerUpdate(
+ 'id',
+ new CampaignControllerUpdateRequest([
+ 'body' => new UpdateCampaignDto([]),
+ ]),
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$id:** `string` — The unique identifier of the campaign.
+
+
+
+
+
+-
+
+**$request:** `UpdateCampaignDto`
+
+
+
+
+
+
+
+
+
+
+
+$client->campaigns->campaignControllerGetCampaignV2Contacts($id, $request) -> ?CampaignContactPaginatedResponse
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->campaigns->campaignControllerGetCampaignV2Contacts(
+ 'id',
+ new CampaignControllerGetCampaignV2ContactsRequest([]),
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$id:** `string` — The unique identifier for the resource.
+
+
+
+
+
+-
+
+**$status:** `?string`
+
+This is the status to filter contacts by. Pass once or multiple times to
+filter on any of the provided statuses.
+
+
+
+
+
+-
+
+**$limit:** `?float` — This is the maximum number of contacts to return. Defaults to 50.
+
+
+
+
+
+-
+
+**$sortBy:** `?string`
+
+This is the column to sort by. Defaults to `position` — the order contacts
+were uploaded, which is also dial order.
+
+`status` sorts by the enum's declaration order rather than alphabetically,
+which means it reads as a lifecycle: pending, dispatched, completed,
+failed, skipped, predial-failed.
+
+Only columns on `campaign_contact` are sortable. Call-level values such as
+cost or duration live on the call and are attached after this query, so
+sorting by them here would only reorder the current page.
+
+
+
+
+
+-
+
+**$page:** `?float` — This is the page number to return. Defaults to 1.
+
+
+
+
+
+
+
+
+
+
+
+## Sessions
+$client->sessions->list($request) -> ?SessionPaginatedResponse
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->sessions->list(
+ new ListSessionsRequest([
+ 'assistantIdAny' => 'assistant-1,assistant-2,assistant-3',
+ 'customerNumberAny' => '+1234567890,+0987654321',
+ ]),
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$id:** `?string` — This is the unique identifier for the session to filter by.
+
+
+
+
+
+-
+
+**$name:** `?string`
+
+This is the name of the customer. This is just for your own reference.
+
+For SIP inbound calls, this is extracted from the `From` SIP header with format `"Display Name" `.
+
+
+
+
+
+-
+
+**$assistantId:** `?string` — This is the ID of the assistant to filter sessions by.
+
+
+
+
+
+-
+
+**$assistantIdAny:** `?string` — Filter by multiple assistant IDs. Provide as comma-separated values.
+
+
+
+
+
+-
+
+**$squadId:** `?string` — This is the ID of the squad to filter sessions by.
+
+
+
+
+
+-
+
+**$workflowId:** `?string` — This is the ID of the workflow to filter sessions by.
+
+
+
+
+
+-
+
+**$numberE164CheckEnabled:** `?bool`
+
+This is the flag to toggle the E164 check for the `number` field. This is an advanced property which should be used if you know your use case requires it.
+
+Use cases:
+- `false`: To allow non-E164 numbers like `+001234567890`, `1234`, or `abc`. This is useful for dialing out to non-E164 numbers on your SIP trunks.
+- `true` (default): To allow only E164 numbers like `+14155551234`. This is standard for PSTN calls.
+
+If `false`, the `number` is still required to only contain alphanumeric characters (regex: `/^\+?[a-zA-Z0-9]+$/`).
+
+@default true (E164 check is enabled)
+
+
+
+
+
+-
+
+**$extension:** `?string` — This is the extension that will be dialed after the call is answered.
+
+
+
+
+
+-
+
+**$assistantOverrides:** `?string`
+
+These are the overrides for the assistant's settings and template variables specific to this customer.
+This allows customization of the assistant's behavior for individual customers in batch calls.
+
+
+
+
+
+-
+
+**$squadOverrides:** `?string`
+
+These are the overrides applied when the call targets a `squadId`. Mirrors
+the call-level `squadOverrides` — use this instead of `assistantOverrides`
+when the campaign or call is squad-based.
+
+
+
+
+
+-
+
+**$number:** `?string` — This is the number of the customer.
+
+
+
+
+
+-
+
+**$sipUri:** `?string` — This is the SIP URI of the customer.
+
+
+
+
+
+-
+
+**$email:** `?string` — This is the email of the customer.
+
+
+
+
+
+-
+
+**$externalId:** `?string` — This is the external ID of the customer.
+
+
+
+
+
+-
+
+**$customerNumberAny:** `?string` — Filter by any of the specified customer phone numbers (comma-separated).
+
+
+
+
+
+-
+
+**$idAny:** `?string` — Filter by multiple session IDs. Provide as comma-separated values.
+
+
+
+
+
+-
+
+**$phoneNumberId:** `?string` — This will return sessions with the specified phoneNumberId.
+
+
+
+
+
+-
+
+**$phoneNumberIdAny:** `?string` — This will return sessions with any of the specified phoneNumberIds.
+
+
+
+
+
+-
+
+**$page:** `?float` — This is the page number to return. Defaults to 1.
+
+
+
+
+
+-
+
+**$sortOrder:** `?string` — This is the sort order for pagination. Defaults to 'DESC'.
+
+
+
+
+
+-
+
+**$sortBy:** `?string` — This is the column to sort by. Defaults to 'createdAt'.
+
+
+
+
+
+-
+
+**$limit:** `?float` — This is the maximum number of items to return. Defaults to 100.
+
+
+
+
+
+-
+
+**$createdAtGt:** `?DateTime` — This will return items where the createdAt is greater than the specified value.
+
+
+
+
+
+-
+
+**$createdAtLt:** `?DateTime` — This will return items where the createdAt is less than the specified value.
+
+
+
+
+
+-
+
+**$createdAtGe:** `?DateTime` — This will return items where the createdAt is greater than or equal to the specified value.
+
+
+
+
+
+-
+
+**$createdAtLe:** `?DateTime` — This will return items where the createdAt is less than or equal to the specified value.
+
+
+
+
+
+-
+
+**$updatedAtGt:** `?DateTime` — This will return items where the updatedAt is greater than the specified value.
+
+
+
+
+
+-
+
+**$updatedAtLt:** `?DateTime` — This will return items where the updatedAt is less than the specified value.
+
+
+
+
+
+-
+
+**$updatedAtGe:** `?DateTime` — This will return items where the updatedAt is greater than or equal to the specified value.
+
+
+
+
+
+-
+
+**$updatedAtLe:** `?DateTime` — This will return items where the updatedAt is less than or equal to the specified value.
+
+
+
+
+
+
+
+
+
+
+
+$client->sessions->create($request) -> ?Session
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->sessions->create(
+ new CreateSessionDto([]),
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$name:** `?string` — This is a user-defined name for the session. Maximum length is 40 characters.
+
+
+
+
+
+-
+
+**$status:** `?string` — This is the current status of the session. Can be either 'active' or 'completed'.
+
+
+
+
+
+-
+
+**$expirationSeconds:** `?float` — Session expiration time in seconds. Defaults to 24 hours (86400 seconds) if not set.
+
+
+
+
+
+-
+
+**$assistantId:** `?string` — This is the ID of the assistant associated with this session. Use this when referencing an existing assistant.
+
+
+
+
+
+-
+
+**$assistant:** `?CreateAssistantDto`
+
+This is the assistant configuration for this session. Use this when creating a new assistant configuration.
+If assistantId is provided, this will be ignored.
+
+
+
+
+
+-
+
+**$assistantOverrides:** `?AssistantOverrides`
+
+These are the overrides for the assistant configuration.
+Use this to provide variable values and other overrides when using assistantId.
+Variable substitution will be applied to the assistant's messages and other text-based fields.
+
+
+
+
+
+-
+
+**$squadId:** `?string` — This is the squad ID associated with this session. Use this when referencing an existing squad.
+
+
+
+
+
+-
+
+**$squad:** `?CreateSquadDto`
+
+This is the squad configuration for this session. Use this when creating a new squad configuration.
+If squadId is provided, this will be ignored.
+
+
+
+
+
+-
+
+**$messages:** `?array` — This is an array of chat messages in the session.
+
+
+
+
+
+-
+
+**$customer:** `?CreateCustomerDto` — This is the customer information associated with this session.
+
+
+
+
+
+-
+
+**$customerId:** `?string` — This is the customerId of the customer associated with this session.
+
+
+
+
+
+-
+
+**$phoneNumberId:** `?string` — This is the ID of the phone number associated with this session.
+
+
+
+
+
+-
+
+**$phoneNumber:** `?ImportTwilioPhoneNumberDto` — This is the phone number configuration for this session.
+
+
+
+
+
+
+
+
+
+
+
+$client->sessions->get($id) -> ?Session
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->sessions->get(
+ 'id',
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$id:** `string` — The unique identifier for the resource.
+
+
+
+
+
+
+
+
+
+
+
+$client->sessions->delete($id) -> ?Session
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->sessions->delete(
+ 'id',
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$id:** `string` — The unique identifier for the resource.
+
+
+
+
+
+
+
+
+
+
+
+$client->sessions->update($id, $request) -> ?Session
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->sessions->update(
+ 'id',
+ new UpdateSessionDto([]),
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$id:** `string` — The unique identifier for the resource.
+
+
+
+
+
+-
+
+**$name:** `?string` — This is the new name for the session. Maximum length is 40 characters.
+
+
+
+
+
+-
+
+**$status:** `?string` — This is the new status for the session.
+
+
+
+
+
+-
+
+**$expirationSeconds:** `?float` — Session expiration time in seconds. Defaults to 24 hours (86400 seconds) if not set.
+
+
+
+
+
+-
+
+**$messages:** `?array` — This is the updated array of chat messages.
+
+
+
+
+
+
+
+
+
+
+
+## PhoneNumbers
+$client->phoneNumbers->list($request) -> ?array
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Returns phone numbers for the authenticated organization. Filter results by creation or update timestamps and limit the number returned.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->phoneNumbers->list(
+ new ListPhoneNumbersRequest([]),
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$limit:** `?float` — This is the maximum number of items to return. Defaults to 100.
+
+
+
+
+
+-
+
+**$createdAtGt:** `?DateTime` — This will return items where the createdAt is greater than the specified value.
+
+
+
+
+
+-
+
+**$createdAtLt:** `?DateTime` — This will return items where the createdAt is less than the specified value.
+
+
+
+
+
+-
+
+**$createdAtGe:** `?DateTime` — This will return items where the createdAt is greater than or equal to the specified value.
+
+
+
+
+
+-
+
+**$createdAtLe:** `?DateTime` — This will return items where the createdAt is less than or equal to the specified value.
+
+
+
+
+
+-
+
+**$updatedAtGt:** `?DateTime` — This will return items where the updatedAt is greater than the specified value.
+
+
+
+
+
+-
+
+**$updatedAtLt:** `?DateTime` — This will return items where the updatedAt is less than the specified value.
+
+
+
+
+
+-
+
+**$updatedAtGe:** `?DateTime` — This will return items where the updatedAt is greater than or equal to the specified value.
+
+
+
+
+
+-
+
+**$updatedAtLe:** `?DateTime` — This will return items where the updatedAt is less than or equal to the specified value.
+
+
+
+
+
+
+
+
+
+
+
+$client->phoneNumbers->create($request) -> ?CreatePhoneNumbersResponse
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Creates a Vapi phone number or imports a phone number from a supported provider, including Twilio, Vonage, Telnyx, or a bring-your-own provider.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->phoneNumbers->create(
+ CreatePhoneNumbersRequest::byoPhoneNumber(new CreateByoPhoneNumberDto([
+ 'credentialId' => 'credentialId',
+ ])),
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$request:** `CreatePhoneNumbersRequest`
+
+
+
+
+
+
+
+
+
+
+
+$client->phoneNumbers->phoneNumberControllerFindAllPaginated($request) -> ?PhoneNumberPaginatedResponse
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Returns a paginated list of phone numbers for the authenticated organization. Search by name, number, or SIP URI using a partial, case-insensitive match, and filter by creation or update timestamps.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->phoneNumbers->phoneNumberControllerFindAllPaginated(
+ new PhoneNumberControllerFindAllPaginatedRequest([]),
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$search:** `?string` — This will search phone numbers by name, number, or SIP URI (partial match, case-insensitive).
+
+
+
+
+
+-
+
+**$page:** `?float` — This is the page number to return. Defaults to 1.
+
+
+
+
+
+-
+
+**$sortOrder:** `?string` — This is the sort order for pagination. Defaults to 'DESC'.
+
+
+
+
+
+-
+
+**$sortBy:** `?string` — This is the column to sort by. Defaults to 'createdAt'.
+
+
+
+
+
+-
+
+**$limit:** `?float` — This is the maximum number of items to return. Defaults to 100.
+
+
+
+
+
+-
+
+**$createdAtGt:** `?DateTime` — This will return items where the createdAt is greater than the specified value.
+
+
+
+
+
+-
+
+**$createdAtLt:** `?DateTime` — This will return items where the createdAt is less than the specified value.
+
+
+
+
+
+-
+
+**$createdAtGe:** `?DateTime` — This will return items where the createdAt is greater than or equal to the specified value.
+
+
+
+
+
+-
+
+**$createdAtLe:** `?DateTime` — This will return items where the createdAt is less than or equal to the specified value.
+
+
+
+
+
+-
+
+**$updatedAtGt:** `?DateTime` — This will return items where the updatedAt is greater than the specified value.
+
+
+
+
+
+-
+
+**$updatedAtLt:** `?DateTime` — This will return items where the updatedAt is less than the specified value.
+
+
+
+
+
+-
+
+**$updatedAtGe:** `?DateTime` — This will return items where the updatedAt is greater than or equal to the specified value.
+
+
+
+
+
+-
+
+**$updatedAtLe:** `?DateTime` — This will return items where the updatedAt is less than or equal to the specified value.
+
+
+
+
+
+
+
+
+
+
+
+$client->phoneNumbers->get($id) -> ?GetPhoneNumbersResponse
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Returns the phone number resource identified by its ID.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->phoneNumbers->get(
+ 'id',
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$id:** `string` — The unique identifier of the phone number.
+
+
+
+
+
+
+
+
+
+
+
+$client->phoneNumbers->delete($id) -> ?DeletePhoneNumbersResponse
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Deletes the phone number resource identified by its ID.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->phoneNumbers->delete(
+ 'id',
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$id:** `string` — The unique identifier of the phone number.
+
+
+
+
+
+
+
+
+
+
+
+$client->phoneNumbers->update($id, $request) -> ?UpdatePhoneNumbersResponse
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Updates the specified fields of the phone number resource identified by its ID.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->phoneNumbers->update(
+ 'id',
+ new UpdatePhoneNumbersRequest([
+ 'body' => UpdatePhoneNumbersRequestBody::byoPhoneNumber(new UpdateByoPhoneNumberDto([])),
+ ]),
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$id:** `string` — The unique identifier of the phone number.
+
+
+
+
+
+-
+
+**$request:** `UpdatePhoneNumbersRequestBody`
+
+
+
+
+
+
+
+
+
+
+
+## Tools
+$client->tools->list($request) -> ?array
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Returns reusable tools for the authenticated organization. Filter results by creation or update timestamps and limit the number returned.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->tools->list(
+ new ListToolsRequest([]),
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$limit:** `?float` — This is the maximum number of items to return. Defaults to 100.
+
+
+
+
+
+-
+
+**$createdAtGt:** `?DateTime` — This will return items where the createdAt is greater than the specified value.
+
+
+
+
+
+-
+
+**$createdAtLt:** `?DateTime` — This will return items where the createdAt is less than the specified value.
+
+
+
+
+
+-
+
+**$createdAtGe:** `?DateTime` — This will return items where the createdAt is greater than or equal to the specified value.
+
+
+
+
+
+-
+
+**$createdAtLe:** `?DateTime` — This will return items where the createdAt is less than or equal to the specified value.
+
+
+
+
+
+-
+
+**$updatedAtGt:** `?DateTime` — This will return items where the updatedAt is greater than the specified value.
+
+
+
+
+
+-
+
+**$updatedAtLt:** `?DateTime` — This will return items where the updatedAt is less than the specified value.
+
+
+
+
+
+-
+
+**$updatedAtGe:** `?DateTime` — This will return items where the updatedAt is greater than or equal to the specified value.
+
+
+
+
+
+-
+
+**$updatedAtLe:** `?DateTime` — This will return items where the updatedAt is less than or equal to the specified value.
+
+
+
+
+
+
+
+
+
+
+
+$client->tools->create($request) -> ?CreateToolsResponse
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Creates a reusable tool that assistants can invoke during conversations.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->tools->create(
+ CreateToolsRequest::apiRequest(new CreateApiRequestToolDto([
+ 'method' => CreateApiRequestToolDtoMethod::Post->value,
+ 'url' => 'url',
+ ])),
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$request:** `CreateToolsRequest`
+
+
+
+
+
+
+
+
+
+
+
+$client->tools->get($id) -> ?GetToolsResponse
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Returns the tool identified by its ID.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->tools->get(
+ 'id',
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$id:** `string` — The unique identifier of the tool.
+
+
+
+
+
+
+
+
+
+
+
+$client->tools->delete($id) -> ?DeleteToolsResponse
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Deletes the tool identified by its ID.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->tools->delete(
+ 'id',
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$id:** `string` — The unique identifier of the tool.
+
+
+
+
+
+
+
+
+
+
+
+$client->tools->update($id, $request) -> ?UpdateToolsResponse
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Updates the specified fields of the tool identified by its ID.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->tools->update(
+ 'id',
+ new UpdateToolsRequest([
+ 'body' => UpdateToolsRequestBody::apiRequest(new UpdateApiRequestToolDto([])),
+ ]),
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$id:** `string` — The unique identifier of the tool.
+
+
+
+
+
+-
+
+**$request:** `UpdateToolsRequestBody`
+
+
+
+
+
+
+
+
+
+
+
+## Files
+$client->files->list($request) -> ?array
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Returns files uploaded to the authenticated organization.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->files->list(
+ new ListFilesRequest([
+ 'purpose' => 'purpose',
+ ]),
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$purpose:** `string`
+
+
+
+
+
+
+
+
+
+
+
+$client->files->create($request) -> ?File
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Uploads a file for use with a Vapi knowledge base.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->files->create(
+ new CreateFileDto([
+ 'file' => File::createFromString("example_file", "example_file"),
+ ]),
+);
+```
+
+
+
+
+
+
+
+
+
+
+$client->files->get($id) -> ?File
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Returns the uploaded file identified by its ID.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->files->get(
+ 'id',
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$id:** `string` — The unique identifier of the file.
+
+
+
+
+
+
+
+
+
+
+
+$client->files->delete($id) -> ?File
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Deletes the uploaded file identified by its ID.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->files->delete(
+ 'id',
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$id:** `string` — The unique identifier of the file.
+
+
+
+
+
+
+
+
+
+
+
+$client->files->update($id, $request) -> ?File
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Updates the name of the uploaded file identified by its ID.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->files->update(
+ 'id',
+ new UpdateFileDto([]),
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$id:** `string` — The unique identifier of the file.
+
+
+
+
+
+-
+
+**$name:** `?string` — This is the name of the file. This is just for your own reference.
+
+
+
+
+
+
+
+
+
+
+
+## KnowledgeBasesV2
+$client->knowledgeBasesV2->knowledgeBaseV2ControllerFindAll($request) -> ?array
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->knowledgeBasesV2->knowledgeBaseV2ControllerFindAll(
+ new KnowledgeBaseV2ControllerFindAllRequest([]),
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$limit:** `?float`
+
+
+
+
+
+
+
+
+
+
+
+$client->knowledgeBasesV2->knowledgeBaseV2ControllerCreate($request) -> ?KnowledgeBaseV2
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->knowledgeBasesV2->knowledgeBaseV2ControllerCreate(
+ new CreateKnowledgeBaseV2Dto([
+ 'name' => 'name',
+ ]),
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$name:** `string`
+
+
+
+
+
+-
+
+**$description:** `?string`
+
+
+
+
+
+
+
+
+
+
+
+$client->knowledgeBasesV2->knowledgeBaseV2ControllerFilesGet($id) -> ?array
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->knowledgeBasesV2->knowledgeBaseV2ControllerFilesGet(
+ 'id',
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$id:** `string` — The unique identifier for the resource.
+
+
+
+
+
+
+
+
+
+
+
+$client->knowledgeBasesV2->knowledgeBaseV2ControllerFileAttach($id, $request) -> ?KnowledgeBaseV2File
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->knowledgeBasesV2->knowledgeBaseV2ControllerFileAttach(
+ 'id',
+ new AttachKnowledgeBaseV2FileDto([
+ 'fileId' => 'fileId',
+ ]),
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$id:** `string` — The unique identifier for the resource.
+
+
+
+
+
+-
+
+**$fileId:** `string`
+
+
+
+
+
+
+
+
+
+
+
+$client->knowledgeBasesV2->knowledgeBaseV2ControllerFileDetach($id, $fileId) -> ?KnowledgeBaseV2File
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->knowledgeBasesV2->knowledgeBaseV2ControllerFileDetach(
+ 'id',
+ 'fileId',
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$id:** `string` — The unique identifier for the resource.
+
+
+
+
+
+-
+
+**$fileId:** `string`
+
+
+
+
+
+
+
+
+
+
+
+$client->knowledgeBasesV2->knowledgeBaseV2ControllerFileRetry($id, $fileId) -> ?KnowledgeBaseV2File
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->knowledgeBasesV2->knowledgeBaseV2ControllerFileRetry(
+ 'id',
+ 'fileId',
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$id:** `string` — The unique identifier for the resource.
+
+
+
+
+
+-
+
+**$fileId:** `string`
+
+
+
+
+
+
+
+
+
+
+
+$client->knowledgeBasesV2->knowledgeBaseV2ControllerFindOne($id) -> ?KnowledgeBaseV2WithFiles
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->knowledgeBasesV2->knowledgeBaseV2ControllerFindOne(
+ 'id',
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$id:** `string` — The unique identifier for the resource.
+
+
+
+
+
+
+
+
+
+
+
+$client->knowledgeBasesV2->knowledgeBaseV2ControllerRemove($id) -> ?KnowledgeBaseV2
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->knowledgeBasesV2->knowledgeBaseV2ControllerRemove(
+ 'id',
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$id:** `string` — The unique identifier for the resource.
+
+
+
+
+
+
+
+
+
+
+
+$client->knowledgeBasesV2->knowledgeBaseV2ControllerUpdate($id, $request) -> ?KnowledgeBaseV2
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->knowledgeBasesV2->knowledgeBaseV2ControllerUpdate(
+ 'id',
+ new UpdateKnowledgeBaseV2Dto([]),
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$id:** `string` — The unique identifier for the resource.
+
+
+
+
+
+-
+
+**$name:** `?string`
+
+
+
+
+
+-
+
+**$description:** `?string`
+
+
+
+
+
+
+
+
+
+
+
+## StructuredOutputs
+$client->structuredOutputs->structuredOutputControllerFindAll($request) -> ?StructuredOutputPaginatedResponse
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Returns structured-output definitions for the authenticated organization. Filter results by ID, name, or creation and update timestamps.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->structuredOutputs->structuredOutputControllerFindAll(
+ new StructuredOutputControllerFindAllRequest([]),
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$id:** `?string` — This will return structured outputs where the id matches the specified value.
+
+
+
+
+
+-
+
+**$name:** `?string` — This will return structured outputs where the name matches the specified value.
+
+
+
+
+
+-
+
+**$page:** `?float` — This is the page number to return. Defaults to 1.
+
+
+
+
+
+-
+
+**$sortOrder:** `?string` — This is the sort order for pagination. Defaults to 'DESC'.
+
+
+
+
+
+-
+
+**$sortBy:** `?string` — This is the column to sort by. Defaults to 'createdAt'.
+
+
+
+
+
+-
+
+**$limit:** `?float` — This is the maximum number of items to return. Defaults to 100.
+
+
+
+
+
+-
+
+**$createdAtGt:** `?DateTime` — This will return items where the createdAt is greater than the specified value.
+
+
+
+
+
+-
+
+**$createdAtLt:** `?DateTime` — This will return items where the createdAt is less than the specified value.
+
+
+
+
+
+-
+
+**$createdAtGe:** `?DateTime` — This will return items where the createdAt is greater than or equal to the specified value.
+
+
+
+
+
+-
+
+**$createdAtLe:** `?DateTime` — This will return items where the createdAt is less than or equal to the specified value.
+
+
+
+
+
+-
+
+**$updatedAtGt:** `?DateTime` — This will return items where the updatedAt is greater than the specified value.
+
+
+
+
+
+-
+
+**$updatedAtLt:** `?DateTime` — This will return items where the updatedAt is less than the specified value.
+
+
+
+
+
+-
+
+**$updatedAtGe:** `?DateTime` — This will return items where the updatedAt is greater than or equal to the specified value.
+
+
+
+
+
+-
+
+**$updatedAtLe:** `?DateTime` — This will return items where the updatedAt is less than or equal to the specified value.
+
+
+
+
+
+
+
+
+
+
+
+$client->structuredOutputs->structuredOutputControllerCreate($request) -> ?StructuredOutput
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Creates a reusable definition for extracting validated data from conversations using an AI model or regular expression.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->structuredOutputs->structuredOutputControllerCreate(
+ new CreateStructuredOutputDto([
+ 'name' => 'name',
+ 'schema' => new JsonSchema([
+ 'type' => JsonSchemaType::String->value,
+ ]),
+ ]),
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$request:** `CreateStructuredOutputDto`
+
+
+
+
+
+
+
+
+
+
+
+$client->structuredOutputs->structuredOutputControllerFindOne($id) -> ?StructuredOutput
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Returns the structured-output definition identified by its ID.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->structuredOutputs->structuredOutputControllerFindOne(
+ 'id',
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$id:** `string` — The unique identifier of the structured output.
+
+
+
+
+
+
+
+
+
+
+
+$client->structuredOutputs->structuredOutputControllerRemove($id) -> ?StructuredOutput
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Deletes the structured-output definition identified by its ID.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->structuredOutputs->structuredOutputControllerRemove(
+ 'id',
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$id:** `string` — The unique identifier of the structured output.
+
+
+
+
+
+
+
+
+
+
+
+$client->structuredOutputs->structuredOutputControllerUpdate($id, $request) -> ?StructuredOutput
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Updates the structured-output definition identified by its ID.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->structuredOutputs->structuredOutputControllerUpdate(
+ 'id',
+ new UpdateStructuredOutputDto([
+ 'schemaOverride' => 'schemaOverride',
+ ]),
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$id:** `string` — The unique identifier of the structured output.
+
+
+
+
+
+-
+
+**$schemaOverride:** `string` — Set to the string `true` to allow changing the schema's top-level type. Other values do not enable schema type changes.
+
+
+
+
+
+-
+
+**$type:** `?string`
+
+This is the type of structured output.
+
+- 'ai': Uses an LLM to extract structured data from the conversation (default).
+- 'regex': Uses a regex pattern to extract data from the transcript without an LLM.
+
+
+
+
+
+-
+
+**$regex:** `?string`
+
+This is the regex pattern to match against the transcript.
+
+Only used when type is 'regex'. Supports both raw patterns (e.g. '\d+') and
+regex literal format (e.g. '/\d+/gi'). Uses RE2 syntax for safety.
+
+The result depends on the schema type:
+- boolean: true if the pattern matches, false otherwise
+- string: the first match or first capture group
+- number/integer: the first match parsed as a number
+- array: all matches
+
+
+
+
+
+-
+
+**$model:** `?UpdateStructuredOutputDtoModel`
+
+This is the model that will be used to extract the structured output.
+
+To provide your own custom system and user prompts for structured output extraction, populate the messages array with your system and user messages. You can specify liquid templating in your system and user messages.
+Between the system or user messages, you must reference either 'transcript' or 'messages' with the `{{}}` syntax to access the conversation history.
+Between the system or user messages, you must reference a variation of the structured output with the `{{}}` syntax to access the structured output definition.
+i.e.:
+`{{structuredOutput}}`
+`{{structuredOutput.name}}`
+`{{structuredOutput.description}}`
+`{{structuredOutput.schema}}`
+
+If model is not specified, GPT-4.1 will be used by default for extraction, utilizing default system and user prompts.
+If messages or required fields are not specified, the default system and user prompts will be used.
+
+
+
+
+
+-
+
+**$compliancePlan:** `?ComplianceOverride` — Compliance configuration for this output. Only enable overrides if no sensitive data will be stored.
+
+
+
+
+
+-
+
+**$conditions:** `?array` — These are the conditions that gate the execution of this structured output. Every condition must pass for the structured output to run (AND semantics). When omitted or empty, no user-defined conditions gate this output. Send null to clear a previously saved gate.
+
+
+
+
+
+-
+
+**$name:** `?string` — This is the name of the structured output.
+
+
+
+
+
+-
+
+**$description:** `?string`
+
+This is the description of what the structured output extracts.
+
+Use this to provide context about what data will be extracted and how it will be used.
+
+
+
+
+
+-
+
+**$assistantIds:** `?array`
+
+These are the assistant IDs that this structured output is linked to.
+
+When linked to assistants, this structured output will be available for extraction during those assistant's calls.
+
+
+
+
+
+-
+
+**$workflowIds:** `?array`
+
+These are the workflow IDs that this structured output is linked to.
+
+When linked to workflows, this structured output will be available for extraction during those workflow's execution.
+
+
+
+
+
+-
+
+**$schema:** `?JsonSchema`
+
+This is the JSON Schema definition for the structured output.
+
+Defines the structure and validation rules for the data that will be extracted. Supports all JSON Schema features including:
+- Objects and nested properties
+- Arrays and array validation
+- String, number, boolean, and null types
+- Enums and const values
+- Validation constraints (min/max, patterns, etc.)
+- Composition with allOf, anyOf, oneOf
+
+
+
+
+
+
+
+
+
+
+
+$client->structuredOutputs->structuredOutputControllerRun($request) -> StructuredOutputControllerRunResponseZero|StructuredOutputRerunResponse|null
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Runs a saved or transient structured-output definition against one or more calls, optionally returning a preview without updating call artifacts.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->structuredOutputs->structuredOutputControllerRun(
+ new StructuredOutputRunDto([
+ 'callIds' => [
+ 'callIds',
+ ],
+ ]),
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$previewEnabled:** `?bool`
+
+This is the preview flag for the re-run. If true, the re-run will be executed and the response will be returned immediately and the call artifact will NOT be updated.
+If false (default), the re-run will be executed and the response will be updated in the call artifact.
+
+
+
+
+
+-
+
+**$structuredOutputId:** `?string`
+
+This is the ID of the structured output that will be run. This must be provided unless a transient structured output is provided.
+When the re-run is executed, only the value of this structured output will be replaced with the new value, or added if not present.
+
+
+
+
+
+-
+
+**$structuredOutput:** `?CreateStructuredOutputDto`
+
+This is the transient structured output that will be run. This must be provided if a structured output ID is not provided.
+When the re-run is executed, the structured output value will be added to the existing artifact.
+
+
+
+
+
+-
+
+**$callIds:** `array`
+
+This is the array of callIds that will be updated with the new structured output value. If preview is true, this array must be provided and contain exactly 1 callId.
+If preview is false, up to 100 callIds may be provided.
+
+
+
+
+
+
+
+
+
+
+
+## SimulationPersonalities
+$client->simulationPersonalities->personalityControllerFindAll($request) -> ?array
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Returns the personalities for the authenticated organization.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->simulationPersonalities->personalityControllerFindAll(
+ new PersonalityControllerFindAllRequest([]),
+);
+```
+
+
+
+#### ⚙️ Parameters
+
-
-**$previousChatId:** `?string` — This is the unique identifier for the previous chat to filter by.
+
+-
+
+**$page:** `?float` — This is the page number to return. Defaults to 1.
@@ -1525,7 +6255,7 @@ $client->chats->list(
-
-**$page:** `?float` — This is the page number to return. Defaults to 1.
+**$sortOrder:** `?string` — This is the sort order for pagination. Defaults to 'DESC'.
@@ -1533,55 +6263,307 @@ $client->chats->list(
-
-**$sortOrder:** `?string` — This is the sort order for pagination. Defaults to 'DESC'.
+**$sortBy:** `?string` — This is the column to sort by. Defaults to 'createdAt'.
+
+
+
+
+
+-
+
+**$limit:** `?float` — This is the maximum number of items to return. Defaults to 100.
+
+
+
+
+
+-
+
+**$createdAtGt:** `?DateTime` — This will return items where the createdAt is greater than the specified value.
+
+
+
+
+
+-
+
+**$createdAtLt:** `?DateTime` — This will return items where the createdAt is less than the specified value.
+
+
+
+
+
+-
+
+**$createdAtGe:** `?DateTime` — This will return items where the createdAt is greater than or equal to the specified value.
+
+
+
+
+
+-
+
+**$createdAtLe:** `?DateTime` — This will return items where the createdAt is less than or equal to the specified value.
+
+
+
+
+
+-
+
+**$updatedAtGt:** `?DateTime` — This will return items where the updatedAt is greater than the specified value.
+
+
+
+
+
+-
+
+**$updatedAtLt:** `?DateTime` — This will return items where the updatedAt is less than the specified value.
+
+
+
+
+
+-
+
+**$updatedAtGe:** `?DateTime` — This will return items where the updatedAt is greater than or equal to the specified value.
+
+
+
+
+
+-
+
+**$updatedAtLe:** `?DateTime` — This will return items where the updatedAt is less than or equal to the specified value.
+
+
+
+
+
+
+
+
+
+
+
+$client->simulationPersonalities->personalityControllerCreate($request) -> ?Personality
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Creates a personality, the AI tester's configuration used in simulations.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->simulationPersonalities->personalityControllerCreate(
+ new CreatePersonalityDto([
+ 'name' => 'name',
+ 'assistant' => new CreateAssistantDto([]),
+ ]),
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$request:** `CreatePersonalityDto`
+
+
+
+
+
+
+
+
+
+
+
+$client->simulationPersonalities->personalityControllerFindOne($id) -> ?Personality
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Returns the specified personality.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->simulationPersonalities->personalityControllerFindOne(
+ 'id',
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$id:** `string` — The unique identifier of the personality.
+
+
+
+
+
+
+
+
+$client->simulationPersonalities->personalityControllerRemove($id) -> ?Personality
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Deletes the specified personality.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->simulationPersonalities->personalityControllerRemove(
+ 'id',
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$id:** `string` — The unique identifier of the personality.
+
+
+
+
+
+
+
+
+
+
+
+$client->simulationPersonalities->personalityControllerUpdate($id, $request) -> ?Personality
+
+-
+
+#### 📝 Description
-
-**$limit:** `?float` — This is the maximum number of items to return. Defaults to 100.
-
-
-
-
-
-**$createdAtGt:** `?DateTime` — This will return items where the createdAt is greater than the specified value.
-
+Updates the specified personality. Changes apply to future runs.
+
+
+#### 🔌 Usage
+
-
-**$createdAtLt:** `?DateTime` — This will return items where the createdAt is less than the specified value.
-
-
-
-
-
-**$createdAtGe:** `?DateTime` — This will return items where the createdAt is greater than or equal to the specified value.
-
+```php
+$client->simulationPersonalities->personalityControllerUpdate(
+ 'id',
+ new UpdatePersonalityDto([]),
+);
+```
+
+
+#### ⚙️ Parameters
+
-
-**$createdAtLe:** `?DateTime` — This will return items where the createdAt is less than or equal to the specified value.
-
-
-
-
-
-**$updatedAtGt:** `?DateTime` — This will return items where the updatedAt is greater than the specified value.
+**$id:** `string` — The unique identifier of the personality.
@@ -1589,7 +6571,7 @@ $client->chats->list(
-
-**$updatedAtLt:** `?DateTime` — This will return items where the updatedAt is less than the specified value.
+**$name:** `?string` — This is the name of the personality.
@@ -1597,7 +6579,7 @@ $client->chats->list(
-
-**$updatedAtGe:** `?DateTime` — This will return items where the updatedAt is greater than or equal to the specified value.
+**$assistant:** `?CreateAssistantDto` — This is the full assistant configuration for this personality.
@@ -1605,7 +6587,11 @@ $client->chats->list(
-
-**$updatedAtLe:** `?DateTime` — This will return items where the updatedAt is less than or equal to the specified value.
+**$path:** `?string`
+
+Optional folder path for organizing personalities.
+Supports up to 3 levels (e.g., "dept/feature/variant").
+Set to null to remove from folder.
@@ -1617,7 +6603,8 @@ $client->chats->list(
-$client->chats->create($request) -> Chat|CreateChatStreamResponse|null
+## SimulationScenarios
+$client->simulationScenarios->scenarioControllerFindAll($request) -> ?array
-
@@ -1629,7 +6616,7 @@ $client->chats->list(
-
-Creates a new chat with optional SMS delivery via transport field. Requires at least one of: assistantId/assistant, sessionId, or previousChatId. Note: sessionId and previousChatId are mutually exclusive. Transport field enables SMS delivery with two modes: (1) New conversation - provide transport.phoneNumberId and transport.customer to create a new session, (2) Existing conversation - provide sessionId to use existing session data. Cannot specify both sessionId and transport fields together. The transport.useLLMGeneratedMessageForOutbound flag controls whether input is processed by LLM (true, default) or forwarded directly as SMS (false).
+Returns the scenarios for the authenticated organization.
@@ -1644,10 +6631,8 @@ Creates a new chat with optional SMS delivery via transport field. Requires at l
-
```php
-$client->chats->create(
- new CreateChatDto([
- 'input' => 'input',
- ]),
+$client->simulationScenarios->scenarioControllerFindAll(
+ new ScenarioControllerFindAllRequest([]),
);
```
@@ -1663,7 +6648,7 @@ $client->chats->create(
-
-**$assistantId:** `?string` — This is the assistant that will be used for the chat. To use an existing assistant, use `assistantId` instead.
+**$idAny:** `?string` — Return only scenarios matching the provided ids
@@ -1671,7 +6656,7 @@ $client->chats->create(
-
-**$assistant:** `?CreateAssistantDto` — This is the assistant that will be used for the chat. To use an existing assistant, use `assistantId` instead.
+**$name:** `?string` — Search by scenario name
@@ -1679,10 +6664,7 @@ $client->chats->create(
-
-**$assistantOverrides:** `?AssistantOverrides`
-
-These are the variable values that will be used to replace template variables in the assistant messages.
-Only variable substitution is supported in chat contexts - other assistant properties cannot be overridden.
+**$page:** `?float` — This is the page number to return. Defaults to 1.
@@ -1690,7 +6672,7 @@ Only variable substitution is supported in chat contexts - other assistant prope
-
-**$squadId:** `?string` — This is the squad that will be used for the chat. To use a transient squad, use `squad` instead.
+**$sortOrder:** `?string` — This is the sort order for pagination. Defaults to 'DESC'.
@@ -1698,7 +6680,7 @@ Only variable substitution is supported in chat contexts - other assistant prope
-
-**$squad:** `?CreateSquadDto` — This is the squad that will be used for the chat. To use an existing squad, use `squadId` instead.
+**$sortBy:** `?string` — This is the column to sort by. Defaults to 'createdAt'.
@@ -1706,7 +6688,7 @@ Only variable substitution is supported in chat contexts - other assistant prope
-
-**$name:** `?string` — This is the name of the chat. This is just for your own reference.
+**$limit:** `?float` — This is the maximum number of items to return. Defaults to 100.
@@ -1714,10 +6696,7 @@ Only variable substitution is supported in chat contexts - other assistant prope
-
-**$sessionId:** `?string`
-
-This is the ID of the session that will be used for the chat.
-Mutually exclusive with previousChatId.
+**$createdAtGt:** `?DateTime` — This will return items where the createdAt is greater than the specified value.
@@ -1725,11 +6704,7 @@ Mutually exclusive with previousChatId.
-
-**$input:** `string|array`
-
-This is the input text for the chat.
-Can be a string or an array of chat messages.
-This field is REQUIRED for chat creation.
+**$createdAtLt:** `?DateTime` — This will return items where the createdAt is less than the specified value.
@@ -1737,10 +6712,15 @@ This field is REQUIRED for chat creation.
-
-**$stream:** `?bool`
+**$createdAtGe:** `?DateTime` — This will return items where the createdAt is greater than or equal to the specified value.
+
+
+
-This is a flag that determines whether the response should be streamed.
-When true, the response will be sent as chunks of text.
+
+-
+
+**$createdAtLe:** `?DateTime` — This will return items where the createdAt is less than or equal to the specified value.
@@ -1748,11 +6728,15 @@ When true, the response will be sent as chunks of text.
-
-**$previousChatId:** `?string`
+**$updatedAtGt:** `?DateTime` — This will return items where the updatedAt is greater than the specified value.
+
+
+
-This is the ID of the chat that will be used as context for the new chat.
-The messages from the previous chat will be used as context.
-Mutually exclusive with sessionId.
+
+-
+
+**$updatedAtLt:** `?DateTime` — This will return items where the updatedAt is less than the specified value.
@@ -1760,12 +6744,15 @@ Mutually exclusive with sessionId.
-
-**$transport:** `?TwilioSmsChatTransport`
+**$updatedAtGe:** `?DateTime` — This will return items where the updatedAt is greater than or equal to the specified value.
+
+
+
-This is used to send the chat through a transport like SMS.
-If transport.phoneNumberId and transport.customer are provided, creates a new session.
-If sessionId is provided without transport fields, uses existing session data.
-Cannot specify both sessionId and transport fields (phoneNumberId/customer) together.
+
+-
+
+**$updatedAtLe:** `?DateTime` — This will return items where the updatedAt is less than or equal to the specified value.
@@ -1777,10 +6764,24 @@ Cannot specify both sessionId and transport fields (phoneNumberId/customer) toge
-$client->chats->get($id) -> ?Chat
+$client->simulationScenarios->scenarioControllerCreate($request) -> ?Scenario
+
+-
+
+#### 📝 Description
+
+
+-
+
-
+Creates a scenario, the AI tester's intent plus the success criteria that score a run.
+
+
+
+
+
#### 🔌 Usage
@@ -1790,8 +6791,17 @@ Cannot specify both sessionId and transport fields (phoneNumberId/customer) toge
-
```php
-$client->chats->get(
- 'id',
+$client->simulationScenarios->scenarioControllerCreate(
+ new CreateScenarioDto([
+ 'name' => 'Health Enrollment - Eligible Path',
+ 'instructions' => 'You are calling to enroll in the Twin Health program. Confirm your identity when asked.',
+ 'evaluations' => [
+ new EvaluationPlanItem([
+ 'comparator' => EvaluationPlanItemComparator::EqualTo->value,
+ 'value' => 1.1,
+ ]),
+ ],
+ ]),
);
```
@@ -1807,7 +6817,7 @@ $client->chats->get(
-
-**$id:** `string`
+**$request:** `CreateScenarioDto`
@@ -1819,10 +6829,24 @@ $client->chats->get(
-$client->chats->delete($id) -> ?Chat
+$client->simulationScenarios->scenarioControllerFindOne($id) -> ?Scenario
+
+-
+
+#### 📝 Description
+
+
+-
+
-
+Returns the specified scenario.
+
+
+
+
+
#### 🔌 Usage
@@ -1832,7 +6856,7 @@ $client->chats->get(
-
```php
-$client->chats->delete(
+$client->simulationScenarios->scenarioControllerFindOne(
'id',
);
```
@@ -1849,7 +6873,7 @@ $client->chats->delete(
-
-**$id:** `string`
+**$id:** `string` — The unique identifier of the scenario.
@@ -1861,10 +6885,24 @@ $client->chats->delete(
-$client->chats->createResponse($request) -> ResponseObject|ResponseTextDeltaEvent|ResponseTextDoneEvent|ResponseCompletedEvent|ResponseErrorEvent|null
+$client->simulationScenarios->scenarioControllerRemove($id) -> ?Scenario
+
+-
+
+#### 📝 Description
+
+
+-
+
-
+Deletes the specified scenario.
+
+
+
+
+
#### 🔌 Usage
@@ -1874,10 +6912,8 @@ $client->chats->delete(
-
```php
-$client->chats->createResponse(
- new OpenAiResponsesRequest([
- 'input' => 'input',
- ]),
+$client->simulationScenarios->scenarioControllerRemove(
+ 'id',
);
```
@@ -1893,34 +6929,64 @@ $client->chats->createResponse(
-
-**$assistantId:** `?string` — This is the assistant that will be used for the chat. To use an existing assistant, use `assistantId` instead.
+**$id:** `string` — The unique identifier of the scenario.
+
+
+
+
+
+
+
+$client->simulationScenarios->scenarioControllerUpdate($id, $request) -> ?Scenario
-
-**$assistant:** `?CreateAssistantDto` — This is the assistant that will be used for the chat. To use an existing assistant, use `assistantId` instead.
-
+#### 📝 Description
+
+
+-
+
+
+-
+
+Updates the specified scenario.
+
+
+#### 🔌 Usage
+
-
-**$assistantOverrides:** `?AssistantOverrides`
+
+-
-These are the variable values that will be used to replace template variables in the assistant messages.
-Only variable substitution is supported in chat contexts - other assistant properties cannot be overridden.
-
+```php
+$client->simulationScenarios->scenarioControllerUpdate(
+ 'id',
+ new UpdateScenarioDto([]),
+);
+```
+
+
+
+#### ⚙️ Parameters
-
-**$squadId:** `?string` — This is the squad that will be used for the chat. To use a transient squad, use `squad` instead.
+
+-
+
+**$id:** `string` — The unique identifier of the scenario.
@@ -1928,7 +6994,7 @@ Only variable substitution is supported in chat contexts - other assistant prope
-
-**$squad:** `?CreateSquadDto` — This is the squad that will be used for the chat. To use an existing squad, use `squadId` instead.
+**$name:** `?string` — This is the name of the scenario.
@@ -1936,7 +7002,7 @@ Only variable substitution is supported in chat contexts - other assistant prope
-
-**$name:** `?string` — This is the name of the chat. This is just for your own reference.
+**$instructions:** `?string` — This is the script/instructions for the tester to follow during the simulation.
@@ -1944,10 +7010,10 @@ Only variable substitution is supported in chat contexts - other assistant prope
-
-**$sessionId:** `?string`
+**$evaluations:** `?array`
-This is the ID of the session that will be used for the chat.
-Mutually exclusive with previousChatId.
+This is the structured output-based evaluation plan for the simulation.
+Each item defines a structured output to extract and evaluate against an expected value.
@@ -1955,11 +7021,7 @@ Mutually exclusive with previousChatId.
-
-**$input:** `string|array`
-
-This is the input text for the chat.
-Can be a string or an array of chat messages.
-This field is REQUIRED for chat creation.
+**$hooks:** `?array` — Hooks to run on simulation lifecycle events
@@ -1967,7 +7029,7 @@ This field is REQUIRED for chat creation.
-
-**$stream:** `?bool` — Whether to stream the response or not.
+**$targetOverrides:** `?AssistantOverrides` — Overrides to inject into the simulated target assistant or squad
@@ -1975,11 +7037,7 @@ This field is REQUIRED for chat creation.
-
-**$previousChatId:** `?string`
-
-This is the ID of the chat that will be used as context for the new chat.
-The messages from the previous chat will be used as context.
-Mutually exclusive with sessionId.
+**$toolMocks:** `?array`
@@ -1987,12 +7045,11 @@ Mutually exclusive with sessionId.
-
-**$transport:** `?TwilioSmsChatTransport`
+**$path:** `?string`
-This is used to send the chat through a transport like SMS.
-If transport.phoneNumberId and transport.customer are provided, creates a new session.
-If sessionId is provided without transport fields, uses existing session data.
-Cannot specify both sessionId and transport fields (phoneNumberId/customer) together.
+Optional folder path for organizing scenarios.
+Supports up to 3 levels (e.g., "dept/feature/variant").
+Set to null to remove from folder.
@@ -2004,11 +7061,25 @@ Cannot specify both sessionId and transport fields (phoneNumberId/customer) toge
-## Campaigns
-$client->campaigns->campaignControllerFindAll($request) -> ?CampaignPaginatedResponse
+## SimulationRuns
+$client->simulationRuns->simulationRunControllerFindAll($request) -> array|SimulationRunsPaginatedResponse|null
+
+-
+
+#### 📝 Description
+
-
+
+-
+
+Returns the simulation runs for the authenticated organization.
+
+
+
+
+
#### 🔌 Usage
@@ -2018,8 +7089,8 @@ Cannot specify both sessionId and transport fields (phoneNumberId/customer) toge
-
```php
-$client->campaigns->campaignControllerFindAll(
- new CampaignControllerFindAllRequest([]),
+$client->simulationRuns->simulationRunControllerFindAll(
+ new SimulationRunControllerFindAllRequest([]),
);
```
@@ -2035,7 +7106,31 @@ $client->campaigns->campaignControllerFindAll(
-
-**$id:** `?string`
+**$status:** `?string` — Filter by status
+
+
+
+
+
+-
+
+**$filterStatus:** `?string` — Filter by aggregate run result status
+
+
+
+
+
+-
+
+**$targetType:** `?string` — Filter by target type
+
+
+
+
+
+-
+
+**$targetId:** `?string` — Filter by target id
@@ -2043,7 +7138,7 @@ $client->campaigns->campaignControllerFindAll(
-
-**$status:** `?string`
+**$page:** `?float` — This is the page number to return. Defaults to 1.
@@ -2051,7 +7146,7 @@ $client->campaigns->campaignControllerFindAll(
-
-**$page:** `?float` — This is the page number to return. Defaults to 1.
+**$sortOrder:** `?string` — This is the sort order for pagination. Defaults to 'DESC'.
@@ -2059,7 +7154,7 @@ $client->campaigns->campaignControllerFindAll(
-
-**$sortOrder:** `?string` — This is the sort order for pagination. Defaults to 'DESC'.
+**$sortBy:** `?string` — This is the column to sort by. Defaults to 'createdAt'.
@@ -2143,11 +7238,11 @@ $client->campaigns->campaignControllerFindAll(
-$client->campaigns->campaignControllerCreate($request) -> ?Campaign
+$client->simulationRuns->simulationRunControllerCreate($request) -> ?CreateSimulationRunResponse
-
-#### 🔌 Usage
+#### 📝 Description
-
@@ -2155,19 +7250,13 @@ $client->campaigns->campaignControllerFindAll(
-
-```php
-$client->campaigns->campaignControllerCreate(
- new CreateCampaignDto([
- 'name' => 'Q2 Sales Campaign',
- ]),
-);
-```
+Starts a simulation run against a target assistant or squad.
-#### ⚙️ Parameters
+#### 🔌 Usage
-
@@ -2175,39 +7264,30 @@ $client->campaigns->campaignControllerCreate(
-
-**$name:** `string` — This is the name of the campaign. This is just for your own reference.
-
+```php
+$client->simulationRuns->simulationRunControllerCreate(
+ new CreateSimulationRunDto([
+ 'simulations' => [
+ CreateSimulationRunDtoSimulationsItem::simulation(new SimulationRunSimulationEntry([])),
+ ],
+ 'target' => CreateSimulationRunDtoTarget::assistant(new SimulationRunTargetAssistant([])),
+ ]),
+);
+```
-
-
--
-
-**$assistantId:** `?string` — This is the assistant ID that will be used for the campaign calls. Note: Only one of assistantId, workflowId, or squadId can be used.
-
-
--
-
-**$workflowId:** `?string` — This is the workflow ID that will be used for the campaign calls. Note: Only one of assistantId, workflowId, or squadId can be used.
-
-
-
+#### ⚙️ Parameters
-
-**$squadId:** `?string` — This is the squad ID that will be used for the campaign calls. Note: Only one of assistantId, workflowId, or squadId can be used.
-
-
-
-
-
-**$phoneNumberId:** `?string` — This is the phone number ID that will be used for the campaign calls. Required if dialPlan is not provided. Note: phoneNumberId and dialPlan are mutually exclusive.
+**$simulations:** `array` — Array of simulations and/or suites to run
@@ -2215,7 +7295,7 @@ $client->campaigns->campaignControllerCreate(
-
-**$dialPlan:** `?array` — This is a list of dial entries, each specifying a phone number and the customers to call using that number. Use this when you want different phone numbers to call different sets of customers. Note: phoneNumberId and dialPlan are mutually exclusive.
+**$target:** `CreateSimulationRunDtoTarget` — Target to test against
@@ -2223,7 +7303,7 @@ $client->campaigns->campaignControllerCreate(
-
-**$schedulePlan:** `?SchedulePlan` — This is the schedule plan for the campaign. Calls will start at startedAt and continue until your organization’s concurrency limit is reached. Any remaining calls will be retried for up to one hour as capacity becomes available. After that hour or after latestAt, whichever comes first, any calls that couldn’t be placed won’t be retried.
+**$iterations:** `?float` — Number of times to run each simulation (default: 1)
@@ -2231,7 +7311,7 @@ $client->campaigns->campaignControllerCreate(
-
-**$customers:** `?array` — These are the customers that will be called in the campaign. Required if dialPlan is not provided.
+**$transport:** `?SimulationRunTransportConfiguration` — Transport configuration for the simulation runs
@@ -2243,29 +7323,11 @@ $client->campaigns->campaignControllerCreate(
-$client->campaigns->campaignControllerFindOne($id) -> ?Campaign
-
--
-
-#### 🔌 Usage
-
-
--
-
+
$client->simulationRuns->simulationRunControllerFindOne($id) -> ?SimulationRun
-
-```php
-$client->campaigns->campaignControllerFindOne(
- 'id',
-);
-```
-
-
-
-
-
-#### ⚙️ Parameters
+#### 📝 Description
-
@@ -2273,21 +7335,11 @@ $client->campaigns->campaignControllerFindOne(
-
-**$id:** `string`
-
-
-
+Returns the specified simulation run, including its status and item counts.
-
-
-
-
-$client->campaigns->campaignControllerRemove($id) -> ?Campaign
-
--
#### 🔌 Usage
@@ -2298,7 +7350,7 @@ $client->campaigns->campaignControllerFindOne(
-
```php
-$client->campaigns->campaignControllerRemove(
+$client->simulationRuns->simulationRunControllerFindOne(
'id',
);
```
@@ -2315,7 +7367,7 @@ $client->campaigns->campaignControllerRemove(
-
-**$id:** `string`
+**$id:** `string` — The unique identifier of the simulation run.
@@ -2327,11 +7379,11 @@ $client->campaigns->campaignControllerRemove(
-$client->campaigns->campaignControllerUpdate($id, $request) -> ?Campaign
+$client->simulationRuns->simulationRunControllerCancelGroup($id) -> ?SimulationRun
-
-#### 🔌 Usage
+#### 📝 Description
-
@@ -2339,18 +7391,13 @@ $client->campaigns->campaignControllerRemove(
-
-```php
-$client->campaigns->campaignControllerUpdate(
- 'id',
- new UpdateCampaignDto([]),
-);
-```
+Cancels the specified simulation run.
-#### ⚙️ Parameters
+#### 🔌 Usage
-
@@ -2358,106 +7405,53 @@ $client->campaigns->campaignControllerUpdate(
-
-**$id:** `string`
-
+```php
+$client->simulationRuns->simulationRunControllerCancelGroup(
+ 'id',
+);
+```
-
-
--
-
-**$name:** `?string` — This is the name of the campaign. This is just for your own reference.
-
+#### ⚙️ Parameters
+
-
-**$assistantId:** `?string`
-
-This is the assistant ID that will be used for the campaign calls.
-Can only be updated if campaign is not in progress or has ended.
-
-
-
-
-
-**$workflowId:** `?string`
-
-This is the workflow ID that will be used for the campaign calls.
-Can only be updated if campaign is not in progress or has ended.
+**$id:** `string` — The unique identifier of the simulation run.
-
-
--
-
-**$squadId:** `?string`
-
-This is the squad ID that will be used for the campaign calls.
-Can only be updated if campaign is not in progress or has ended.
-
-
--
-
-**$phoneNumberId:** `?string`
-This is the phone number ID that will be used for the campaign calls.
-Can only be updated if campaign is not in progress or has ended.
-Note: `phoneNumberId` and `dialPlan` are mutually exclusive.
-
+
+$client->simulationRuns->simulationRunControllerFindItems($id, $request) -> ?array
-
-**$dialPlan:** `?array` — This is a list of dial entries, each specifying a phone number and the customers to call using that number. Can only be updated if campaign is not in progress or has ended. Note: phoneNumberId and dialPlan are mutually exclusive.
-
-
-
+#### 📝 Description
-
-**$schedulePlan:** `?SchedulePlan`
-
-This is the schedule plan for the campaign.
-Can only be updated if campaign is not in progress or has ended.
-
-
-
-
-
-**$status:** `?string`
-
-This is the status of the campaign.
-Can only be updated to 'ended' if you want to end the campaign.
-When set to 'ended', it will delete all scheduled calls. Calls in progress will be allowed to complete.
-
-
-
+Returns the run items for the specified simulation run.
-
-
-
-
-## Sessions
-$client->sessions->list($request) -> ?SessionPaginatedResponse
-
--
#### 🔌 Usage
@@ -2468,11 +7462,9 @@ When set to 'ended', it will delete all scheduled calls. Calls in progress will
-
```php
-$client->sessions->list(
- new ListSessionsRequest([
- 'assistantIdAny' => 'assistant-1,assistant-2,assistant-3',
- 'customerNumberAny' => '+1234567890,+0987654321',
- ]),
+$client->simulationRuns->simulationRunControllerFindItems(
+ 'id',
+ new SimulationRunControllerFindItemsRequest([]),
);
```
@@ -2488,7 +7480,7 @@ $client->sessions->list(
-
-**$id:** `?string` — This is the unique identifier for the session to filter by.
+**$id:** `string` — The unique identifier of the simulation run.
@@ -2496,11 +7488,7 @@ $client->sessions->list(
-
-**$name:** `?string`
-
-This is the name of the customer. This is just for your own reference.
-
-For SIP inbound calls, this is extracted from the `From` SIP header with format `"Display Name" `.
+**$simulationId:** `?string` — Filters run items to a specific simulation.
@@ -2508,7 +7496,7 @@ For SIP inbound calls, this is extracted from the `From` SIP header with format
-
-**$assistantId:** `?string` — This is the ID of the assistant to filter sessions by.
+**$runId:** `?string` — Filters run items to a specific run.
@@ -2516,7 +7504,7 @@ For SIP inbound calls, this is extracted from the `From` SIP header with format
-
-**$assistantIdAny:** `?string` — Filter by multiple assistant IDs. Provide as comma-separated values.
+**$status:** `?string` — Filters run items by status.
@@ -2524,7 +7512,7 @@ For SIP inbound calls, this is extracted from the `From` SIP header with format
-
-**$squadId:** `?string` — This is the ID of the squad to filter sessions by.
+**$page:** `?float` — This is the page number to return. Defaults to 1.
@@ -2532,7 +7520,7 @@ For SIP inbound calls, this is extracted from the `From` SIP header with format
-
-**$workflowId:** `?string` — This is the ID of the workflow to filter sessions by.
+**$sortOrder:** `?string` — This is the sort order for pagination. Defaults to 'DESC'.
@@ -2540,17 +7528,7 @@ For SIP inbound calls, this is extracted from the `From` SIP header with format
-
-**$numberE164CheckEnabled:** `?bool`
-
-This is the flag to toggle the E164 check for the `number` field. This is an advanced property which should be used if you know your use case requires it.
-
-Use cases:
-- `false`: To allow non-E164 numbers like `+001234567890`, `1234`, or `abc`. This is useful for dialing out to non-E164 numbers on your SIP trunks.
-- `true` (default): To allow only E164 numbers like `+14155551234`. This is standard for PSTN calls.
-
-If `false`, the `number` is still required to only contain alphanumeric characters (regex: `/^\+?[a-zA-Z0-9]+$/`).
-
-@default true (E164 check is enabled)
+**$sortBy:** `?string` — This is the column to sort by. Defaults to 'createdAt'.
@@ -2558,7 +7536,7 @@ If `false`, the `number` is still required to only contain alphanumeric characte
-
-**$extension:** `?string` — This is the extension that will be dialed after the call is answered.
+**$limit:** `?float` — This is the maximum number of items to return. Defaults to 100.
@@ -2566,10 +7544,7 @@ If `false`, the `number` is still required to only contain alphanumeric characte
-
-**$assistantOverrides:** `?string`
-
-These are the overrides for the assistant's settings and template variables specific to this customer.
-This allows customization of the assistant's behavior for individual customers in batch calls.
+**$createdAtGt:** `?DateTime` — This will return items where the createdAt is greater than the specified value.
@@ -2577,7 +7552,7 @@ This allows customization of the assistant's behavior for individual customers i
-
-**$number:** `?string` — This is the number of the customer.
+**$createdAtLt:** `?DateTime` — This will return items where the createdAt is less than the specified value.
@@ -2585,7 +7560,7 @@ This allows customization of the assistant's behavior for individual customers i
-
-**$sipUri:** `?string` — This is the SIP URI of the customer.
+**$createdAtGe:** `?DateTime` — This will return items where the createdAt is greater than or equal to the specified value.
@@ -2593,7 +7568,7 @@ This allows customization of the assistant's behavior for individual customers i
-
-**$email:** `?string` — This is the email of the customer.
+**$createdAtLe:** `?DateTime` — This will return items where the createdAt is less than or equal to the specified value.
@@ -2601,7 +7576,7 @@ This allows customization of the assistant's behavior for individual customers i
-
-**$externalId:** `?string` — This is the external ID of the customer.
+**$updatedAtGt:** `?DateTime` — This will return items where the updatedAt is greater than the specified value.
@@ -2609,7 +7584,7 @@ This allows customization of the assistant's behavior for individual customers i
-
-**$customerNumberAny:** `?string` — Filter by any of the specified customer phone numbers (comma-separated).
+**$updatedAtLt:** `?DateTime` — This will return items where the updatedAt is less than the specified value.
@@ -2617,7 +7592,7 @@ This allows customization of the assistant's behavior for individual customers i
-
-**$phoneNumberId:** `?string` — This will return sessions with the specified phoneNumberId.
+**$updatedAtGe:** `?DateTime` — This will return items where the updatedAt is greater than or equal to the specified value.
@@ -2625,87 +7600,64 @@ This allows customization of the assistant's behavior for individual customers i
-
-**$phoneNumberIdAny:** `?string` — This will return sessions with any of the specified phoneNumberIds.
+**$updatedAtLe:** `?DateTime` — This will return items where the updatedAt is less than or equal to the specified value.
-
-
--
-
-**$page:** `?float` — This is the page number to return. Defaults to 1.
-
-
--
-**$sortOrder:** `?string` — This is the sort order for pagination. Defaults to 'DESC'.
-
+
+$client->simulationRuns->simulationRunControllerFindItem($id, $itemId) -> ?SimulationRunItem
-
-**$limit:** `?float` — This is the maximum number of items to return. Defaults to 100.
-
-
-
+#### 📝 Description
-
-**$createdAtGt:** `?DateTime` — This will return items where the createdAt is greater than the specified value.
-
-
-
-
-
-**$createdAtLt:** `?DateTime` — This will return items where the createdAt is less than the specified value.
-
+Returns the specified run item, including its evaluation results and the ID of the call that ran it.
-
-
--
-
-**$createdAtGe:** `?DateTime` — This will return items where the createdAt is greater than or equal to the specified value.
-
+#### 🔌 Usage
+
-
-**$createdAtLe:** `?DateTime` — This will return items where the createdAt is less than or equal to the specified value.
-
-
-
-
-
-**$updatedAtGt:** `?DateTime` — This will return items where the updatedAt is greater than the specified value.
-
+```php
+$client->simulationRuns->simulationRunControllerFindItem(
+ 'id',
+ 'itemId',
+);
+```
+
+
+#### ⚙️ Parameters
+
-
-**$updatedAtLt:** `?DateTime` — This will return items where the updatedAt is less than the specified value.
-
-
-
-
-
-**$updatedAtGe:** `?DateTime` — This will return items where the updatedAt is greater than or equal to the specified value.
+**$id:** `string` — The unique identifier of the simulation run.
@@ -2713,7 +7665,7 @@ This allows customization of the assistant's behavior for individual customers i
-
-**$updatedAtLe:** `?DateTime` — This will return items where the updatedAt is less than or equal to the specified value.
+**$itemId:** `string` — The unique identifier of the run item.
@@ -2725,10 +7677,24 @@ This allows customization of the assistant's behavior for individual customers i
-$client->sessions->create($request) -> ?Session
+$client->simulationRuns->simulationRunControllerCancelItem($id, $itemId) -> ?SimulationRunItem
+
+-
+
+#### 📝 Description
+
-
+
+-
+
+Cancels the specified run item.
+
+
+
+
+
#### 🔌 Usage
@@ -2738,8 +7704,9 @@ This allows customization of the assistant's behavior for individual customers i
-
```php
-$client->sessions->create(
- new CreateSessionDto([]),
+$client->simulationRuns->simulationRunControllerCancelItem(
+ 'id',
+ 'itemId',
);
```
@@ -2755,7 +7722,7 @@ $client->sessions->create(
-
-**$name:** `?string` — This is a user-defined name for the session. Maximum length is 40 characters.
+**$id:** `string` — The unique identifier of the simulation run.
@@ -2763,81 +7730,67 @@ $client->sessions->create(
-
-**$status:** `?string` — This is the current status of the session. Can be either 'active' or 'completed'.
+**$itemId:** `string` — The unique identifier of the run item.
-
-
--
-
-**$expirationSeconds:** `?float` — Session expiration time in seconds. Defaults to 24 hours (86400 seconds) if not set.
-
-
--
-**$assistantId:** `?string` — This is the ID of the assistant associated with this session. Use this when referencing an existing assistant.
-
+
+$client->simulationRuns->simulationRunControllerGenerateSuggestions($id, $itemId, $request)
-
-**$assistant:** `?CreateAssistantDto`
-
-This is the assistant configuration for this session. Use this when creating a new assistant configuration.
-If assistantId is provided, this will be ignored.
-
-
-
+#### 📝 Description
-
-**$assistantOverrides:** `?AssistantOverrides`
-
-These are the overrides for the assistant configuration.
-Use this to provide variable values and other overrides when using assistantId.
-Variable substitution will be applied to the assistant's messages and other text-based fields.
-
-
-
-
-
-**$squadId:** `?string` — This is the squad ID associated with this session. Use this when referencing an existing squad.
-
+Generates AI suggestions for improving the assistant or squad's system prompt, tools, and scenarios, based on the specified run item.
+
+
+#### 🔌 Usage
+
-
-**$squad:** `?CreateSquadDto`
+
+-
-This is the squad configuration for this session. Use this when creating a new squad configuration.
-If squadId is provided, this will be ignored.
-
+```php
+$client->simulationRuns->simulationRunControllerGenerateSuggestions(
+ 'id',
+ 'itemId',
+ new SimulationRunControllerGenerateSuggestionsRequest([
+ 'force' => 'force',
+ ]),
+);
+```
+
+
+#### ⚙️ Parameters
+
-
-**$messages:** `?array` — This is an array of chat messages in the session.
-
-
-
-
-
-**$customer:** `?CreateCustomerDto` — This is the customer information associated with this session.
+**$id:** `string` — The unique identifier of the simulation run.
@@ -2845,7 +7798,7 @@ If squadId is provided, this will be ignored.
-
-**$customerId:** `?string` — This is the customerId of the customer associated with this session.
+**$itemId:** `string` — The unique identifier of the run item.
@@ -2853,7 +7806,7 @@ If squadId is provided, this will be ignored.
-
-**$phoneNumberId:** `?string` — This is the ID of the phone number associated with this session.
+**$force:** `string` — Set to the string `true` to regenerate improvement suggestions even if they already exist.
@@ -2861,7 +7814,7 @@ If squadId is provided, this will be ignored.
-
-**$phoneNumber:** `?ImportTwilioPhoneNumberDto` — This is the phone number configuration for this session.
+**$persist:** `?string`
@@ -2873,29 +7826,12 @@ If squadId is provided, this will be ignored.
-$client->sessions->get($id) -> ?Session
-
--
-
-#### 🔌 Usage
-
-
--
-
+## SimulationSuites
+
$client->simulationSuites->simulationSuiteControllerFindAll($request) -> ?array
-
-```php
-$client->sessions->get(
- 'id',
-);
-```
-
-
-
-
-
-#### ⚙️ Parameters
+#### 📝 Description
-
@@ -2903,21 +7839,11 @@ $client->sessions->get(
-
-**$id:** `string`
-
-
-
+Returns the simulation suites for the authenticated organization.
-
-
-
-
-$client->sessions->delete($id) -> ?Session
-
--
#### 🔌 Usage
@@ -2928,8 +7854,8 @@ $client->sessions->get(
-
```php
-$client->sessions->delete(
- 'id',
+$client->simulationSuites->simulationSuiteControllerFindAll(
+ new SimulationSuiteControllerFindAllRequest([]),
);
```
@@ -2945,50 +7871,71 @@ $client->sessions->delete(
-
-**$id:** `string`
+**$name:** `?string` — Search by simulation suite name
+
+
+-
+
+**$page:** `?float` — This is the page number to return. Defaults to 1.
+
+
+-
+**$sortOrder:** `?string` — This is the sort order for pagination. Defaults to 'DESC'.
+
-
-$client->sessions->update($id, $request) -> ?Session
-
-#### 🔌 Usage
+**$sortBy:** `?string` — This is the column to sort by. Defaults to 'createdAt'.
+
+
+
-
+**$limit:** `?float` — This is the maximum number of items to return. Defaults to 100.
+
+
+
+
-
-```php
-$client->sessions->update(
- 'id',
- new UpdateSessionDto([]),
-);
-```
+**$createdAtGt:** `?DateTime` — This will return items where the createdAt is greater than the specified value.
+
+
+
+-
+
+**$createdAtLt:** `?DateTime` — This will return items where the createdAt is less than the specified value.
+
-#### ⚙️ Parameters
-
-
+**$createdAtGe:** `?DateTime` — This will return items where the createdAt is greater than or equal to the specified value.
+
+
+
+
-
-**$id:** `string`
+**$createdAtLe:** `?DateTime` — This will return items where the createdAt is less than or equal to the specified value.
@@ -2996,7 +7943,7 @@ $client->sessions->update(
-
-**$name:** `?string` — This is the new name for the session. Maximum length is 40 characters.
+**$updatedAtGt:** `?DateTime` — This will return items where the updatedAt is greater than the specified value.
@@ -3004,7 +7951,7 @@ $client->sessions->update(
-
-**$status:** `?string` — This is the new status for the session.
+**$updatedAtLt:** `?DateTime` — This will return items where the updatedAt is less than the specified value.
@@ -3012,7 +7959,7 @@ $client->sessions->update(
-
-**$expirationSeconds:** `?float` — Session expiration time in seconds. Defaults to 24 hours (86400 seconds) if not set.
+**$updatedAtGe:** `?DateTime` — This will return items where the updatedAt is greater than or equal to the specified value.
@@ -3020,7 +7967,7 @@ $client->sessions->update(
-
-**$messages:** `?array` — This is the updated array of chat messages.
+**$updatedAtLe:** `?DateTime` — This will return items where the updatedAt is less than or equal to the specified value.
@@ -3032,11 +7979,24 @@ $client->sessions->update(
-## PhoneNumbers
-$client->phoneNumbers->list($request) -> ?array
+$client->simulationSuites->simulationSuiteControllerCreate($request) -> ?SimulationSuite
+
+-
+
+#### 📝 Description
+
+
+-
+
-
+Creates a simulation suite, a group of simulations that run together.
+
+
+
+
+
#### 🔌 Usage
@@ -3046,8 +8006,13 @@ $client->sessions->update(
-
```php
-$client->phoneNumbers->list(
- new ListPhoneNumbersRequest([]),
+$client->simulationSuites->simulationSuiteControllerCreate(
+ new CreateSimulationSuiteDto([
+ 'name' => 'Checkout Flow Tests',
+ 'simulationIds' => [
+ 'simulationIds',
+ ],
+ ]),
);
```
@@ -3063,7 +8028,7 @@ $client->phoneNumbers->list(
-
-**$limit:** `?float` — This is the maximum number of items to return. Defaults to 100.
+**$name:** `string` — The display name of the suite.
@@ -3071,7 +8036,7 @@ $client->phoneNumbers->list(
-
-**$createdAtGt:** `?DateTime` — This will return items where the createdAt is greater than the specified value.
+**$slackWebhookUrl:** `?string` — A Slack incoming-webhook URL notified when the suite runs.
@@ -3079,7 +8044,7 @@ $client->phoneNumbers->list(
-
-**$createdAtLt:** `?DateTime` — This will return items where the createdAt is less than the specified value.
+**$simulationIds:** `array` — The IDs of the simulations included in the suite.
@@ -3087,7 +8052,7 @@ $client->phoneNumbers->list(
-
-**$createdAtGe:** `?DateTime` — This will return items where the createdAt is greater than or equal to the specified value.
+**$targetAssignments:** `?array` — The assistants or squads the suite's simulations run against.
@@ -3095,53 +8060,39 @@ $client->phoneNumbers->list(
-
-**$createdAtLe:** `?DateTime` — This will return items where the createdAt is less than or equal to the specified value.
+**$path:** `?string`
+
+Optional folder path for organizing simulation suites.
+Supports up to 3 levels (e.g., "dept/feature/variant").
+Maps to GitOps resource folder structure.
+
+
-
--
-**$updatedAtGt:** `?DateTime` — This will return items where the updatedAt is greater than the specified value.
-
+
+$client->simulationSuites->simulationSuiteControllerFindOne($id) -> ?SimulationSuite
-
-**$updatedAtLt:** `?DateTime` — This will return items where the updatedAt is less than the specified value.
-
-
-
+#### 📝 Description
-
-**$updatedAtGe:** `?DateTime` — This will return items where the updatedAt is greater than or equal to the specified value.
-
-
-
-
-
-**$updatedAtLe:** `?DateTime` — This will return items where the updatedAt is less than or equal to the specified value.
-
-
-
+Returns the specified simulation suite.
-
-
-
-
-$client->phoneNumbers->create($request) -> ?CreatePhoneNumbersResponse
-
--
#### 🔌 Usage
@@ -3152,10 +8103,8 @@ $client->phoneNumbers->list(
-
```php
-$client->phoneNumbers->create(
- CreatePhoneNumbersRequest::byoPhoneNumber(new CreateByoPhoneNumberDto([
- 'credentialId' => 'credentialId',
- ])),
+$client->simulationSuites->simulationSuiteControllerFindOne(
+ 'id',
);
```
@@ -3171,7 +8120,7 @@ $client->phoneNumbers->create(
-
-**$request:** `CreatePhoneNumbersRequest`
+**$id:** `string` — The unique identifier of the simulation suite.
@@ -3183,10 +8132,24 @@ $client->phoneNumbers->create(
-$client->phoneNumbers->phoneNumberControllerFindAllPaginated($request) -> ?PhoneNumberPaginatedResponse
+$client->simulationSuites->simulationSuiteControllerRemove($id) -> ?SimulationSuite
+
+-
+
+#### 📝 Description
+
+
+-
+
-
+Deletes the specified simulation suite.
+
+
+
+
+
#### 🔌 Usage
@@ -3196,8 +8159,8 @@ $client->phoneNumbers->create(
-
```php
-$client->phoneNumbers->phoneNumberControllerFindAllPaginated(
- new PhoneNumberControllerFindAllPaginatedRequest([]),
+$client->simulationSuites->simulationSuiteControllerRemove(
+ 'id',
);
```
@@ -3213,55 +8176,64 @@ $client->phoneNumbers->phoneNumberControllerFindAllPaginated(
-
-**$search:** `?string` — This will search phone numbers by name, number, or SIP URI (partial match, case-insensitive).
+**$id:** `string` — The unique identifier of the simulation suite.
+
+
-
--
-**$page:** `?float` — This is the page number to return. Defaults to 1.
-
+
+$client->simulationSuites->simulationSuiteControllerUpdate($id, $request) -> ?SimulationSuite
-
-**$sortOrder:** `?string` — This is the sort order for pagination. Defaults to 'DESC'.
-
-
-
+#### 📝 Description
-
-**$limit:** `?float` — This is the maximum number of items to return. Defaults to 100.
-
+
+-
+
+Updates the specified simulation suite.
+
+
+
+#### 🔌 Usage
-
-**$createdAtGt:** `?DateTime` — This will return items where the createdAt is greater than the specified value.
-
+
+-
+
+```php
+$client->simulationSuites->simulationSuiteControllerUpdate(
+ 'id',
+ new UpdateSimulationSuiteDto([]),
+);
+```
+
+
+#### ⚙️ Parameters
+
-
-**$createdAtLt:** `?DateTime` — This will return items where the createdAt is less than the specified value.
-
-
-
-
-
-**$createdAtGe:** `?DateTime` — This will return items where the createdAt is greater than or equal to the specified value.
+**$id:** `string` — The unique identifier of the simulation suite.
@@ -3269,7 +8241,7 @@ $client->phoneNumbers->phoneNumberControllerFindAllPaginated(
-
-**$createdAtLe:** `?DateTime` — This will return items where the createdAt is less than or equal to the specified value.
+**$name:** `?string` — This is the name of the simulation suite.
@@ -3277,7 +8249,7 @@ $client->phoneNumbers->phoneNumberControllerFindAllPaginated(
-
-**$updatedAtGt:** `?DateTime` — This will return items where the updatedAt is greater than the specified value.
+**$slackWebhookUrl:** `?string` — This is the Slack webhook URL for notifications.
@@ -3285,7 +8257,7 @@ $client->phoneNumbers->phoneNumberControllerFindAllPaginated(
-
-**$updatedAtLt:** `?DateTime` — This will return items where the updatedAt is less than the specified value.
+**$simulationIds:** `?array` — This is the list of simulation IDs to include in the suite (replaces existing).
@@ -3293,7 +8265,7 @@ $client->phoneNumbers->phoneNumberControllerFindAllPaginated(
-
-**$updatedAtGe:** `?DateTime` — This will return items where the updatedAt is greater than or equal to the specified value.
+**$targetAssignments:** `?array` — Optional assistant or squad assignments (replaces existing).
@@ -3301,7 +8273,11 @@ $client->phoneNumbers->phoneNumberControllerFindAllPaginated(
-
-**$updatedAtLe:** `?DateTime` — This will return items where the updatedAt is less than or equal to the specified value.
+**$path:** `?string`
+
+Optional folder path for organizing simulation suites.
+Supports up to 3 levels (e.g., "dept/feature/variant").
+Set to null to remove from folder.
@@ -3313,11 +8289,12 @@ $client->phoneNumbers->phoneNumberControllerFindAllPaginated(
-$client->phoneNumbers->get($id) -> ?GetPhoneNumbersResponse
+## Simulations
+$client->simulations->simulationGenerateControllerGenerate($request) -> ?GenerateScenariosResponse
-
-#### 🔌 Usage
+#### 📝 Description
-
@@ -3325,17 +8302,13 @@ $client->phoneNumbers->phoneNumberControllerFindAllPaginated(
-
-```php
-$client->phoneNumbers->get(
- 'id',
-);
-```
+Generates scenarios for an assistant or squad by analyzing its configuration with AI.
-#### ⚙️ Parameters
+#### 🔌 Usage
-
@@ -3343,23 +8316,17 @@ $client->phoneNumbers->get(
-
-**$id:** `string`
-
-
-
+```php
+$client->simulations->simulationGenerateControllerGenerate(
+ new GenerateScenariosDto([]),
+);
+```
-
-
-
-
-$client->phoneNumbers->delete($id) -> ?DeletePhoneNumbersResponse
-
--
-#### 🔌 Usage
+#### ⚙️ Parameters
-
@@ -3367,25 +8334,15 @@ $client->phoneNumbers->get(
-
-```php
-$client->phoneNumbers->delete(
- 'id',
-);
-```
-
-
+**$assistantId:** `?string` — ID of the assistant to generate scenarios for
+
-#### ⚙️ Parameters
-
-
--
-
-
-**$id:** `string`
+**$squadId:** `?string` — ID of the squad to generate scenarios for
@@ -3397,10 +8354,24 @@ $client->phoneNumbers->delete(
-$client->phoneNumbers->update($id, $request) -> ?UpdatePhoneNumbersResponse
+$client->simulations->simulationControllerFindAll($request) -> ?array
+
+-
+
+#### 📝 Description
+
+
+-
+
-
+Returns the simulations for the authenticated organization.
+
+
+
+
+
#### 🔌 Usage
@@ -3410,11 +8381,8 @@ $client->phoneNumbers->delete(
-
```php
-$client->phoneNumbers->update(
- 'id',
- new UpdatePhoneNumbersRequest([
- 'body' => UpdatePhoneNumbersRequestBody::byoPhoneNumber(new UpdateByoPhoneNumberDto([])),
- ]),
+$client->simulations->simulationControllerFindAll(
+ new SimulationControllerFindAllRequest([]),
);
```
@@ -3430,7 +8398,7 @@ $client->phoneNumbers->update(
-
-**$id:** `string`
+**$idAny:** `?string` — Return only simulations matching the provided ids
@@ -3438,46 +8406,35 @@ $client->phoneNumbers->update(
-
-**$request:** `UpdatePhoneNumbersRequestBody`
+**$standaloneOnly:** `?bool` — Only include simulations that are not part of a suite
-
-
+
+-
+**$page:** `?float` — This is the page number to return. Defaults to 1.
+
-
-## Tools
-$client->tools->list($request) -> ?array
-
-#### 🔌 Usage
-
-
--
+**$sortOrder:** `?string` — This is the sort order for pagination. Defaults to 'DESC'.
+
+
+
-
-```php
-$client->tools->list(
- new ListToolsRequest([]),
-);
-```
-
-
+**$sortBy:** `?string` — This is the column to sort by. Defaults to 'createdAt'.
+
-#### ⚙️ Parameters
-
-
--
-
-
@@ -3557,11 +8514,11 @@ $client->tools->list(
-$client->tools->create($request) -> ?CreateToolsResponse
+$client->simulations->simulationControllerCreate($request) -> ?Simulation
-
-#### 🔌 Usage
+#### 📝 Description
-
@@ -3569,20 +8526,13 @@ $client->tools->list(
-
-```php
-$client->tools->create(
- CreateToolsRequest::apiRequest(new CreateApiRequestToolDto([
- 'method' => CreateApiRequestToolDtoMethod::Post->value,
- 'url' => 'url',
- ])),
-);
-```
+Creates a simulation by pairing a scenario with a personality.
-#### ⚙️ Parameters
+#### 🔌 Usage
-
@@ -3590,49 +8540,56 @@ $client->tools->create(
-
-**$request:** `CreateToolsRequest`
-
+```php
+$client->simulations->simulationControllerCreate(
+ new CreateSimulationDto([
+ 'scenarioId' => 'scenarioId',
+ 'personalityId' => 'personalityId',
+ ]),
+);
+```
+#### ⚙️ Parameters
-
-
-
-
-$client->tools->get($id) -> ?GetToolsResponse
-
-#### 🔌 Usage
-
-
+**$name:** `?string` — Optional display name for the simulation.
+
+
+
+
-
-```php
-$client->tools->get(
- 'id',
-);
-```
-
-
+**$scenarioId:** `string` — The ID of the scenario to run.
+
-#### ⚙️ Parameters
-
-
+**$personalityId:** `string` — The ID of the personality the AI tester uses.
+
+
+
+
-
-**$id:** `string`
+**$path:** `?string`
+
+Optional folder path for organizing simulations.
+Supports up to 3 levels (e.g., "dept/feature/variant").
+Maps to GitOps resource folder structure.
@@ -3644,10 +8601,24 @@ $client->tools->get(
-$client->tools->delete($id) -> ?DeleteToolsResponse
+$client->simulations->simulationControllerFindOne($id) -> ?Simulation
+
+-
+
+#### 📝 Description
+
+
+-
+
-
+Returns the specified simulation.
+
+
+
+
+
#### 🔌 Usage
@@ -3657,7 +8628,7 @@ $client->tools->get(
-
```php
-$client->tools->delete(
+$client->simulations->simulationControllerFindOne(
'id',
);
```
@@ -3674,7 +8645,7 @@ $client->tools->delete(
-
-**$id:** `string`
+**$id:** `string` — The unique identifier of the simulation.
@@ -3686,11 +8657,11 @@ $client->tools->delete(
-$client->tools->update($id, $request) -> ?UpdateToolsResponse
+$client->simulations->simulationControllerRemove($id) -> ?Simulation
-
-#### 🔌 Usage
+#### 📝 Description
-
@@ -3698,53 +8669,31 @@ $client->tools->delete(
-
-```php
-$client->tools->update(
- 'id',
- new UpdateToolsRequest([
- 'body' => UpdateToolsRequestBody::apiRequest(new UpdateApiRequestToolDto([])),
- ]),
-);
-```
+Deletes the specified simulation.
-#### ⚙️ Parameters
-
-
--
+#### 🔌 Usage
-
-**$id:** `string`
-
-
-
-
-
-**$request:** `UpdateToolsRequestBody`
-
-
-
+```php
+$client->simulations->simulationControllerRemove(
+ 'id',
+);
+```
-
-
-
-
-## Files
-$client->files->list() -> ?array
-
--
-#### 🔌 Usage
+#### ⚙️ Parameters
-
@@ -3752,9 +8701,8 @@ $client->tools->update(
-
-```php
-$client->files->list();
-```
+**$id:** `string` — The unique identifier of the simulation.
+
@@ -3765,11 +8713,11 @@ $client->files->list();
-$client->files->create($request) -> ?File
+$client->simulations->simulationControllerUpdate($id, $request) -> ?Simulation
-
-#### 🔌 Usage
+#### 📝 Description
-
@@ -3777,26 +8725,11 @@ $client->files->list();
-
-```php
-$client->files->create(
- new CreateFileDto([
- 'file' => File::createFromString("example_file", "example_file"),
- ]),
-);
-```
-
-
+Updates the specified simulation.
-
-
-
-
-$client->files->get($id) -> ?File
-
--
#### 🔌 Usage
@@ -3807,8 +8740,9 @@ $client->files->create(
-
```php
-$client->files->get(
+$client->simulations->simulationControllerUpdate(
'id',
+ new UpdateSimulationDto([]),
);
```
@@ -3824,49 +8758,43 @@ $client->files->get(
-
-**$id:** `string`
+**$id:** `string` — The unique identifier of the simulation.
-
-
-
-
-
-
-
-$client->files->delete($id) -> ?File
-
-#### 🔌 Usage
-
-
--
+**$name:** `?string` — This is an optional friendly name for the simulation.
+
+
+
-
-
-```php
-$client->files->delete(
- 'id',
-);
-```
-
-
+
+**$scenarioId:** `?string` — This is the ID of the scenario to use for this simulation.
+
-#### ⚙️ Parameters
-
-
+**$personalityId:** `?string` — This is the ID of the personality to use for this simulation.
+
+
+
+
-
-**$id:** `string`
+**$path:** `?string`
+
+Optional folder path for organizing simulations.
+Supports up to 3 levels (e.g., "dept/feature/variant").
+Set to null to remove from folder.
@@ -3878,11 +8806,11 @@ $client->files->delete(
-$client->files->update($id, $request) -> ?File
+$client->simulations->simulationControllerGetConcurrency() -> ?SimulationConcurrencyResponse
-
-#### 🔌 Usage
+#### 📝 Description
-
@@ -3890,35 +8818,23 @@ $client->files->delete(
-
-```php
-$client->files->update(
- 'id',
- new UpdateFileDto([]),
-);
-```
+Returns the organization's simulation concurrency limit, the number of active simulations, and how many more can start.
-#### ⚙️ Parameters
-
-
--
+#### 🔌 Usage
-
-**$id:** `string`
-
-
-
-
-
-**$name:** `?string` — This is the name of the file. This is just for your own reference.
-
+```php
+$client->simulations->simulationControllerGetConcurrency();
+```
@@ -3929,11 +8845,25 @@ $client->files->update(
-## StructuredOutputs
-$client->structuredOutputs->structuredOutputControllerFindAll($request) -> ?StructuredOutputPaginatedResponse
+## Insight
+$client->insight->insightControllerFindAll($request) -> ?InsightPaginatedResponse
+
+-
+
+#### 📝 Description
+
+
+-
+
-
+Returns saved reporting insights for the authenticated organization. Filter results by ID or creation and update timestamps.
+
+
+
+
+
#### 🔌 Usage
@@ -3943,8 +8873,8 @@ $client->files->update(
-
```php
-$client->structuredOutputs->structuredOutputControllerFindAll(
- new StructuredOutputControllerFindAllRequest([]),
+$client->insight->insightControllerFindAll(
+ new InsightControllerFindAllRequest([]),
);
```
@@ -3960,7 +8890,7 @@ $client->structuredOutputs->structuredOutputControllerFindAll(
-
-**$id:** `?string` — This will return structured outputs where the id matches the specified value.
+**$id:** `?string` — Filters reporting insights by ID.
@@ -3968,7 +8898,7 @@ $client->structuredOutputs->structuredOutputControllerFindAll(
-
-**$name:** `?string` — This will return structured outputs where the name matches the specified value.
+**$page:** `?float` — This is the page number to return. Defaults to 1.
@@ -3976,7 +8906,7 @@ $client->structuredOutputs->structuredOutputControllerFindAll(
-
-**$page:** `?float` — This is the page number to return. Defaults to 1.
+**$sortOrder:** `?string` — This is the sort order for pagination. Defaults to 'DESC'.
@@ -3984,7 +8914,7 @@ $client->structuredOutputs->structuredOutputControllerFindAll(
-
-**$sortOrder:** `?string` — This is the sort order for pagination. Defaults to 'DESC'.
+**$sortBy:** `?string` — This is the column to sort by. Defaults to 'createdAt'.
@@ -4068,10 +8998,24 @@ $client->structuredOutputs->structuredOutputControllerFindAll(
-$client->structuredOutputs->structuredOutputControllerCreate($request) -> ?StructuredOutput
+$client->insight->insightControllerCreate($request) -> ?InsightControllerCreateResponse
+
+-
+
+#### 📝 Description
+
+
+-
+
-
+Creates a saved reporting insight that queries call data and presents the results as a bar chart, pie chart, line chart, or text value.
+
+
+
+
+
#### 🔌 Usage
@@ -4081,13 +9025,17 @@ $client->structuredOutputs->structuredOutputControllerFindAll(
-
```php
-$client->structuredOutputs->structuredOutputControllerCreate(
- new CreateStructuredOutputDto([
- 'name' => 'name',
- 'schema' => new JsonSchema([
- 'type' => JsonSchemaType::String->value,
- ]),
- ]),
+$client->insight->insightControllerCreate(
+ InsightControllerCreateRequest::bar(new CreateBarInsightFromCallTableDto([
+ 'queries' => [
+ new JsonQueryOnCallTableWithStringTypeColumn([
+ 'type' => JsonQueryOnCallTableWithStringTypeColumnType::VapiqlJson->value,
+ 'table' => JsonQueryOnCallTableWithStringTypeColumnTable::Call->value,
+ 'column' => JsonQueryOnCallTableWithStringTypeColumnColumn::Id->value,
+ 'operation' => JsonQueryOnCallTableWithStringTypeColumnOperation::Count->value,
+ ]),
+ ],
+ ])),
);
```
@@ -4103,7 +9051,7 @@ $client->structuredOutputs->structuredOutputControllerCreate(
-
-**$request:** `CreateStructuredOutputDto`
+**$request:** `InsightControllerCreateRequest`
@@ -4115,10 +9063,24 @@ $client->structuredOutputs->structuredOutputControllerCreate(
-$client->structuredOutputs->structuredOutputControllerFindOne($id) -> ?StructuredOutput
+$client->insight->insightControllerFindOne($id) -> ?InsightControllerFindOneResponse
+
+-
+
+#### 📝 Description
+
+
+-
+
-
+Returns the reporting insight identified by its ID.
+
+
+
+
+
#### 🔌 Usage
@@ -4128,7 +9090,7 @@ $client->structuredOutputs->structuredOutputControllerCreate(
-
```php
-$client->structuredOutputs->structuredOutputControllerFindOne(
+$client->insight->insightControllerFindOne(
'id',
);
```
@@ -4145,7 +9107,7 @@ $client->structuredOutputs->structuredOutputControllerFindOne(
-
-**$id:** `string`
+**$id:** `string` — The unique identifier of the reporting insight.
@@ -4157,10 +9119,24 @@ $client->structuredOutputs->structuredOutputControllerFindOne(
-$client->structuredOutputs->structuredOutputControllerRemove($id) -> ?StructuredOutput
+$client->insight->insightControllerRemove($id) -> ?InsightControllerRemoveResponse
+
+-
+
+#### 📝 Description
+
-
+
+-
+
+Deletes the reporting insight identified by its ID.
+
+
+
+
+
#### 🔌 Usage
@@ -4170,7 +9146,7 @@ $client->structuredOutputs->structuredOutputControllerFindOne(
-
```php
-$client->structuredOutputs->structuredOutputControllerRemove(
+$client->insight->insightControllerRemove(
'id',
);
```
@@ -4187,7 +9163,7 @@ $client->structuredOutputs->structuredOutputControllerRemove(
-
-**$id:** `string`
+**$id:** `string` — The unique identifier of the reporting insight.
@@ -4199,10 +9175,24 @@ $client->structuredOutputs->structuredOutputControllerRemove(
-$client->structuredOutputs->structuredOutputControllerUpdate($id, $request) -> ?StructuredOutput
+$client->insight->insightControllerUpdate($id, $request) -> ?InsightControllerUpdateResponse
+
+-
+
+#### 📝 Description
+
+
+-
+
-
+Updates the reporting insight identified by its ID.
+
+
+
+
+
#### 🔌 Usage
@@ -4212,10 +9202,10 @@ $client->structuredOutputs->structuredOutputControllerRemove(
-
```php
-$client->structuredOutputs->structuredOutputControllerUpdate(
+$client->insight->insightControllerUpdate(
'id',
- new UpdateStructuredOutputDto([
- 'schemaOverride' => 'schemaOverride',
+ new InsightControllerUpdateRequest([
+ 'body' => InsightControllerUpdateRequestBody::bar(new UpdateBarInsightFromCallTableDto([])),
]),
);
```
@@ -4232,7 +9222,7 @@ $client->structuredOutputs->structuredOutputControllerUpdate(
-
-**$id:** `string`
+**$id:** `string` — The unique identifier of the reporting insight.
@@ -4240,89 +9230,64 @@ $client->structuredOutputs->structuredOutputControllerUpdate(
-
-**$schemaOverride:** `string`
+**$request:** `InsightControllerUpdateRequestBody`
-
-
--
-
-**$type:** `?string`
-
-This is the type of structured output.
-
-- 'ai': Uses an LLM to extract structured data from the conversation (default).
-- 'regex': Uses a regex pattern to extract data from the transcript without an LLM.
-
-
--
-
-**$regex:** `?string`
-
-This is the regex pattern to match against the transcript.
-
-Only used when type is 'regex'. Supports both raw patterns (e.g. '\d+') and
-regex literal format (e.g. '/\d+/gi'). Uses RE2 syntax for safety.
-The result depends on the schema type:
-- boolean: true if the pattern matches, false otherwise
-- string: the first match or first capture group
-- number/integer: the first match parsed as a number
-- array: all matches
-
+
+$client->insight->insightControllerRun($id, $request) -> ?InsightRunResponse
-
-**$model:** `?UpdateStructuredOutputDtoModel`
+#### 📝 Description
-This is the model that will be used to extract the structured output.
+
+-
-To provide your own custom system and user prompts for structured output extraction, populate the messages array with your system and user messages. You can specify liquid templating in your system and user messages.
-Between the system or user messages, you must reference either 'transcript' or 'messages' with the `{{}}` syntax to access the conversation history.
-Between the system or user messages, you must reference a variation of the structured output with the `{{}}` syntax to access the structured output definition.
-i.e.:
-`{{structuredOutput}}`
-`{{structuredOutput.name}}`
-`{{structuredOutput.description}}`
-`{{structuredOutput.schema}}`
+
+-
-If model is not specified, GPT-4.1 will be used by default for extraction, utilizing default system and user prompts.
-If messages or required fields are not specified, the default system and user prompts will be used.
-
+Runs a saved reporting insight, optionally overriding its time range and response format.
+
+
+
+#### 🔌 Usage
-
-**$compliancePlan:** `?ComplianceOverride` — Compliance configuration for this output. Only enable overrides if no sensitive data will be stored.
-
-
-
-
-
-**$name:** `?string` — This is the name of the structured output.
-
+```php
+$client->insight->insightControllerRun(
+ 'id',
+ new InsightRunDto([]),
+);
+```
+
+
+#### ⚙️ Parameters
+
-
-**$description:** `?string`
-
-This is the description of what the structured output extracts.
+
+-
-Use this to provide context about what data will be extracted and how it will be used.
+**$id:** `string` — The unique identifier of the reporting insight.
@@ -4330,11 +9295,7 @@ Use this to provide context about what data will be extracted and how it will be
-
-**$assistantIds:** `?array`
-
-These are the assistant IDs that this structured output is linked to.
-
-When linked to assistants, this structured output will be available for extraction during those assistant's calls.
+**$formatPlan:** `?InsightRunFormatPlan` — Output-formatting instructions applied to the insight run.
@@ -4342,11 +9303,15 @@ When linked to assistants, this structured output will be available for extracti
-
-**$workflowIds:** `?array`
-
-These are the workflow IDs that this structured output is linked to.
+**$timeRangeOverride:** `?InsightTimeRangeWithStep`
-When linked to workflows, this structured output will be available for extraction during those workflow's execution.
+This is the optional time range override for the insight.
+If provided, overrides every field in the insight's timeRange.
+If this is provided with missing fields, defaults will be used, not the insight's timeRange.
+start default - "-7d"
+end default - "now"
+step default - "day"
+For Pie and Text Insights, step will be ignored even if provided.
@@ -4354,17 +9319,10 @@ When linked to workflows, this structured output will be available for extractio
-
-**$schema:** `?JsonSchema`
-
-This is the JSON Schema definition for the structured output.
-
-Defines the structure and validation rules for the data that will be extracted. Supports all JSON Schema features including:
-- Objects and nested properties
-- Arrays and array validation
-- String, number, boolean, and null types
-- Enums and const values
-- Validation constraints (min/max, patterns, etc.)
-- Composition with allOf, anyOf, oneOf
+**$assistantId:** `?string`
+
+Optional runtime assistant scope for dashboards.
+This is applied to call-table queries without mutating the saved insight.
@@ -4376,11 +9334,11 @@ Defines the structure and validation rules for the data that will be extracted.
-$client->structuredOutputs->structuredOutputControllerRun($request) -> ?StructuredOutput
+$client->insight->insightControllerPreview($request) -> ?InsightRunResponse
-
-#### 🔌 Usage
+#### 📝 Description
-
@@ -4388,21 +9346,13 @@ Defines the structure and validation rules for the data that will be extracted.
-
-```php
-$client->structuredOutputs->structuredOutputControllerRun(
- new StructuredOutputRunDto([
- 'callIds' => [
- 'callIds',
- ],
- ]),
-);
-```
+Runs an insight definition without first saving it, returning a preview of the resulting chart or text value.
-#### ⚙️ Parameters
+#### 🔌 Usage
-
@@ -4410,43 +9360,34 @@ $client->structuredOutputs->structuredOutputControllerRun(
-
-**$previewEnabled:** `?bool`
-
-This is the preview flag for the re-run. If true, the re-run will be executed and the response will be returned immediately and the call artifact will NOT be updated.
-If false (default), the re-run will be executed and the response will be updated in the call artifact.
-
+```php
+$client->insight->insightControllerPreview(
+ InsightControllerPreviewRequest::bar(new CreateBarInsightFromCallTableDto([
+ 'queries' => [
+ new JsonQueryOnCallTableWithStringTypeColumn([
+ 'type' => JsonQueryOnCallTableWithStringTypeColumnType::VapiqlJson->value,
+ 'table' => JsonQueryOnCallTableWithStringTypeColumnTable::Call->value,
+ 'column' => JsonQueryOnCallTableWithStringTypeColumnColumn::Id->value,
+ 'operation' => JsonQueryOnCallTableWithStringTypeColumnOperation::Count->value,
+ ]),
+ ],
+ ])),
+);
+```
-
-
--
-
-**$structuredOutputId:** `?string`
-
-This is the ID of the structured output that will be run. This must be provided unless a transient structured output is provided.
-When the re-run is executed, only the value of this structured output will be replaced with the new value, or added if not present.
-
+#### ⚙️ Parameters
+
-
-**$structuredOutput:** `?CreateStructuredOutputDto`
-
-This is the transient structured output that will be run. This must be provided if a structured output ID is not provided.
-When the re-run is executed, the structured output value will be added to the existing artifact.
-
-
-
-
-
-**$callIds:** `array`
-
-This is the array of callIds that will be updated with the new structured output value. If preview is true, this array must be provided and contain exactly 1 callId.
-If preview is false, up to 100 callIds may be provided.
+**$request:** `InsightControllerPreviewRequest`
@@ -4458,8 +9399,8 @@ If preview is false, up to 100 callIds may be provided.
-## Insight
-$client->insight->insightControllerFindAll($request) -> ?InsightPaginatedResponse
+## Board
+$client->board->boardControllerFindAll($request) -> ?BoardPaginatedResponse
-
@@ -4472,8 +9413,8 @@ If preview is false, up to 100 callIds may be provided.
-
```php
-$client->insight->insightControllerFindAll(
- new InsightControllerFindAllRequest([]),
+$client->board->boardControllerFindAll(
+ new BoardControllerFindAllRequest([]),
);
```
@@ -4489,7 +9430,7 @@ $client->insight->insightControllerFindAll(
-
-**$id:** `?string`
+**$page:** `?float` — This is the page number to return. Defaults to 1.
@@ -4497,7 +9438,7 @@ $client->insight->insightControllerFindAll(
-
-**$page:** `?float` — This is the page number to return. Defaults to 1.
+**$sortOrder:** `?string` — This is the sort order for pagination. Defaults to 'DESC'.
@@ -4505,7 +9446,7 @@ $client->insight->insightControllerFindAll(
-
-**$sortOrder:** `?string` — This is the sort order for pagination. Defaults to 'DESC'.
+**$sortBy:** `?string` — This is the column to sort by. Defaults to 'createdAt'.
@@ -4589,7 +9530,7 @@ $client->insight->insightControllerFindAll(
-$client->insight->insightControllerCreate($request) -> ?InsightControllerCreateResponse
+$client->board->boardControllerCreate($request) -> ?Board
-
@@ -4602,17 +9543,13 @@ $client->insight->insightControllerFindAll(
-
```php
-$client->insight->insightControllerCreate(
- InsightControllerCreateRequest::bar(new CreateBarInsightFromCallTableDto([
- 'queries' => [
- new JsonQueryOnCallTableWithStringTypeColumn([
- 'type' => JsonQueryOnCallTableWithStringTypeColumnType::VapiqlJson->value,
- 'table' => JsonQueryOnCallTableWithStringTypeColumnTable::Call->value,
- 'column' => JsonQueryOnCallTableWithStringTypeColumnColumn::Id->value,
- 'operation' => JsonQueryOnCallTableWithStringTypeColumnOperation::Count->value,
- ]),
- ],
- ])),
+$client->board->boardControllerCreate(
+ new CreateBoardDto([
+ 'name' => 'name',
+ 'layout' => new BoardLayout([
+ 'columns' => 1.1,
+ ]),
+ ]),
);
```
@@ -4628,50 +9565,61 @@ $client->insight->insightControllerCreate(
-
-**$request:** `InsightControllerCreateRequest`
+**$items:** `?array` — This is the contents of the Board, which is an array of objects defining the type, contents, and position of the widgets on the Board.
-
-
+
+-
+**$name:** `string` — This is the name of the Board.
+
-
-$client->insight->insightControllerFindOne($id) -> ?InsightControllerFindOneResponse
-
-#### 🔌 Usage
+**$layout:** `BoardLayout` — This is the layout of the Board.
+
+
+
-
-
--
+**$timeRangeOverride:** `?InsightTimeRangeWithStep`
-```php
-$client->insight->insightControllerFindOne(
- 'id',
-);
-```
+This is the timerange override for the board.
+By default, individual insights have their own timerange.
+This is a global override for the board which will be passed to all insights on the board.
+
-#### ⚙️ Parameters
+
+
+
+
+$client->board->boardControllerMetricsOverviewEnsure() -> ?Board
-
+#### 🔌 Usage
+
-
-**$id:** `string`
-
+
+-
+
+```php
+$client->board->boardControllerMetricsOverviewEnsure();
+```
@@ -4682,7 +9630,7 @@ $client->insight->insightControllerFindOne(
-$client->insight->insightControllerRemove($id) -> ?InsightControllerRemoveResponse
+$client->board->boardControllerFindOne($id) -> ?Board
-
@@ -4695,7 +9643,7 @@ $client->insight->insightControllerFindOne(
-
```php
-$client->insight->insightControllerRemove(
+$client->board->boardControllerFindOne(
'id',
);
```
@@ -4712,7 +9660,7 @@ $client->insight->insightControllerRemove(
-
-**$id:** `string`
+**$id:** `string` — The unique identifier for the resource.
@@ -4724,7 +9672,7 @@ $client->insight->insightControllerRemove(
-$client->insight->insightControllerUpdate($id, $request) -> ?InsightControllerUpdateResponse
+$client->board->boardControllerRemove($id) -> ?Board
-
@@ -4737,11 +9685,8 @@ $client->insight->insightControllerRemove(
-
```php
-$client->insight->insightControllerUpdate(
+$client->board->boardControllerRemove(
'id',
- new InsightControllerUpdateRequest([
- 'body' => InsightControllerUpdateRequestBody::bar(new UpdateBarInsightFromCallTableDto([])),
- ]),
);
```
@@ -4757,15 +9702,7 @@ $client->insight->insightControllerUpdate(
-
-**$id:** `string`
-
-
-
-
-
--
-
-**$request:** `InsightControllerUpdateRequestBody`
+**$id:** `string` — The unique identifier for the resource.
@@ -4777,7 +9714,7 @@ $client->insight->insightControllerUpdate(
-$client->insight->insightControllerRun($id, $request) -> ?InsightRunResponse
+$client->board->boardControllerUpdate($id, $request) -> ?Board
-
@@ -4790,9 +9727,9 @@ $client->insight->insightControllerUpdate(
-
```php
-$client->insight->insightControllerRun(
+$client->board->boardControllerUpdate(
'id',
- new InsightRunDto([]),
+ new UpdateBoardDto([]),
);
```
@@ -4808,7 +9745,7 @@ $client->insight->insightControllerRun(
-
-**$id:** `string`
+**$id:** `string` — The unique identifier for the resource.
@@ -4816,7 +9753,7 @@ $client->insight->insightControllerRun(
-
-**$formatPlan:** `?InsightRunFormatPlan`
+**$items:** `?array` — This is the contents of the Board, which is an array of objects defining the type, contents, and position of the widgets on the Board.
@@ -4824,66 +9761,27 @@ $client->insight->insightControllerRun(
-
-**$timeRangeOverride:** `?InsightTimeRangeWithStep`
-
-This is the optional time range override for the insight.
-If provided, overrides every field in the insight's timeRange.
-If this is provided with missing fields, defaults will be used, not the insight's timeRange.
-start default - "-7d"
-end default - "now"
-step default - "day"
-For Pie and Text Insights, step will be ignored even if provided.
+**$name:** `?string` — This is the name of the Board.
-
-
-
-
-
-
-
-
-$client->insight->insightControllerPreview($request) -> ?InsightRunResponse
-
--
-
-#### 🔌 Usage
-
-
--
-
-```php
-$client->insight->insightControllerPreview(
- InsightControllerPreviewRequest::bar(new CreateBarInsightFromCallTableDto([
- 'queries' => [
- new JsonQueryOnCallTableWithStringTypeColumn([
- 'type' => JsonQueryOnCallTableWithStringTypeColumnType::VapiqlJson->value,
- 'table' => JsonQueryOnCallTableWithStringTypeColumnTable::Call->value,
- 'column' => JsonQueryOnCallTableWithStringTypeColumnColumn::Id->value,
- 'operation' => JsonQueryOnCallTableWithStringTypeColumnOperation::Count->value,
- ]),
- ],
- ])),
-);
-```
-
-
+**$layout:** `?BoardLayout` — This is the layout of the Board.
+
-#### ⚙️ Parameters
-
-
-
--
+**$timeRangeOverride:** `?InsightTimeRangeWithStep`
-**$request:** `InsightControllerPreviewRequest`
+This is the timerange override for the board.
+By default, individual insights have their own timerange.
+This is a global override for the board which will be passed to all insights on the board.
@@ -4900,6 +9798,20 @@ $client->insight->insightControllerPreview(
-
+#### 📝 Description
+
+
+-
+
+
+-
+
+Returns eval definitions for the authenticated organization. Filter results by ID or creation and update timestamps.
+
+
+
+
+
#### 🔌 Usage
@@ -4926,7 +9838,7 @@ $client->eval->evalControllerGetPaginated(
-
-**$id:** `?string`
+**$id:** `?string` — Filters eval definitions by ID.
@@ -4950,6 +9862,14 @@ $client->eval->evalControllerGetPaginated(
-
+**$sortBy:** `?string` — This is the column to sort by. Defaults to 'createdAt'.
+
+
+
+
+
+-
+
**$limit:** `?float` — This is the maximum number of items to return. Defaults to 100.
@@ -5030,6 +9950,20 @@ $client->eval->evalControllerGetPaginated(
-
+#### 📝 Description
+
+
+-
+
+
+-
+
+Creates a reusable eval that defines a mock conversation and checkpoints for evaluating assistant responses and tool calls.
+
+
+
+
+
#### 🔌 Usage
@@ -5079,6 +10013,20 @@ $client->eval->evalControllerCreate(
-
+#### 📝 Description
+
+
+-
+
+
+-
+
+Returns the eval definition identified by its ID.
+
+
+
+
+
#### 🔌 Usage
@@ -5105,21 +10053,35 @@ $client->eval->evalControllerGet(
-
-**$id:** `string`
-
-
-
+**$id:** `string` — The unique identifier of the eval definition.
+
+
+
+
+
+
+
+
+
+
+
+$client->eval->evalControllerRemove($id) -> ?Eval_
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Deletes the eval definition identified by its ID.
-
-
-
-
-$client->eval->evalControllerRemove($id) -> ?Eval_
-
--
#### 🔌 Usage
@@ -5147,7 +10109,7 @@ $client->eval->evalControllerRemove(
-
-**$id:** `string`
+**$id:** `string` — The unique identifier of the eval definition.
@@ -5163,6 +10125,20 @@ $client->eval->evalControllerRemove(
-
+#### 📝 Description
+
+
+-
+
+
+-
+
+Updates the eval definition identified by its ID.
+
+
+
+
+
#### 🔌 Usage
@@ -5190,7 +10166,7 @@ $client->eval->evalControllerUpdate(
-
-**$id:** `string`
+**$id:** `string` — The unique identifier of the eval definition.
@@ -5253,6 +10229,20 @@ Currently it is fixed to `chat.mockConversation`.
-
+#### 📝 Description
+
+
+-
+
+
+-
+
+Returns the eval run identified by its ID.
+
+
+
+
+
#### 🔌 Usage
@@ -5279,7 +10269,7 @@ $client->eval->evalControllerGetRun(
-
-**$id:** `string`
+**$id:** `string` — The unique identifier of the eval run.
@@ -5295,6 +10285,20 @@ $client->eval->evalControllerGetRun(
-
+#### 📝 Description
+
+
+-
+
+
+-
+
+Deletes the eval run identified by its ID.
+
+
+
+
+
#### 🔌 Usage
@@ -5321,7 +10325,7 @@ $client->eval->evalControllerRemoveRun(
-
-**$id:** `string`
+**$id:** `string` — The unique identifier of the eval run.
@@ -5337,6 +10341,20 @@ $client->eval->evalControllerRemoveRun(
-
+#### 📝 Description
+
+
+-
+
+
+-
+
+Returns eval runs for the authenticated organization. Filter results by ID or creation and update timestamps.
+
+
+
+
+
#### 🔌 Usage
@@ -5363,7 +10381,7 @@ $client->eval->evalControllerGetRunsPaginated(
-
-**$id:** `?string`
+**$id:** `?string` — Filters eval runs by ID.
@@ -5387,6 +10405,14 @@ $client->eval->evalControllerGetRunsPaginated(
-
+**$sortBy:** `?string` — This is the column to sort by. Defaults to 'createdAt'.
+
+
+
+
+
+-
+
**$limit:** `?float` — This is the maximum number of items to return. Defaults to 100.
@@ -5467,6 +10493,20 @@ $client->eval->evalControllerGetRunsPaginated(
-
+#### 📝 Description
+
+
+-
+
+
+-
+
+Runs a saved or transient eval against an assistant or squad and creates an eval-run record containing the results.
+
+
+
+
+
#### 🔌 Usage
@@ -5540,6 +10580,20 @@ Currently it is fixed to `eval`.
-
+#### 📝 Description
+
+
+-
+
+
+-
+
+Returns the scorecard identified by its ID.
+
+
+
+
+
#### 🔌 Usage
@@ -5566,7 +10620,7 @@ $client->observabilityScorecard->scorecardControllerGet(
-
-**$id:** `string`
+**$id:** `string` — The unique identifier of the scorecard.
@@ -5582,6 +10636,20 @@ $client->observabilityScorecard->scorecardControllerGet(
-
+#### 📝 Description
+
+
+-
+
+
+-
+
+Deletes the scorecard identified by its ID.
+
+
+
+
+
#### 🔌 Usage
@@ -5608,7 +10676,7 @@ $client->observabilityScorecard->scorecardControllerRemove(
-
-**$id:** `string`
+**$id:** `string` — The unique identifier of the scorecard.
@@ -5624,6 +10692,20 @@ $client->observabilityScorecard->scorecardControllerRemove(
-
+#### 📝 Description
+
+
+-
+
+
+-
+
+Updates the scorecard identified by its ID.
+
+
+
+
+
#### 🔌 Usage
@@ -5651,7 +10733,7 @@ $client->observabilityScorecard->scorecardControllerUpdate(
-
-**$id:** `string`
+**$id:** `string` — The unique identifier of the scorecard.
@@ -5705,6 +10787,20 @@ When linked to assistants, this scorecard will be available for evaluation durin
-
+#### 📝 Description
+
+
+-
+
+
+-
+
+Returns scorecards for the authenticated organization. Filter results by ID or creation and update timestamps.
+
+
+
+
+
#### 🔌 Usage
@@ -5731,7 +10827,7 @@ $client->observabilityScorecard->scorecardControllerGetPaginated(
-
-**$id:** `?string`
+**$id:** `?string` — Filters scorecards by ID.
@@ -5755,6 +10851,14 @@ $client->observabilityScorecard->scorecardControllerGetPaginated(
-
+**$sortBy:** `?string` — This is the column to sort by. Defaults to 'createdAt'.
+
+
+
+
+
+-
+
**$limit:** `?float` — This is the maximum number of items to return. Defaults to 100.
@@ -5835,6 +10939,20 @@ $client->observabilityScorecard->scorecardControllerGetPaginated(
-
+#### 📝 Description
+
+
+-
+
+
+-
+
+Creates a scorecard containing metrics, scoring conditions, and optional links to assistants whose calls should be evaluated.
+
+
+
+
+
#### 🔌 Usage
@@ -5848,12 +10966,15 @@ $client->observabilityScorecard->scorecardControllerCreate(
new CreateScorecardDto([
'metrics' => [
new ScorecardMetric([
- 'structuredOutputId' => 'structuredOutputId',
'conditions' => [
- [
- 'key' => "value",
- ],
+ new NumberComparatorScorecardMetricCondition([
+ 'type' => NumberComparatorScorecardMetricConditionType::Comparator->value,
+ 'comparator' => NumberComparatorScorecardMetricConditionComparator::EqualTo->value,
+ 'value' => 1.1,
+ 'points' => 1.1,
+ ]),
],
+ 'structuredOutputId' => 'structuredOutputId',
]),
],
]),
@@ -5889,6 +11010,20 @@ $client->observabilityScorecard->scorecardControllerCreate(
-
+#### 📝 Description
+
+
+-
+
+
+-
+
+Returns a paginated list of provider resources for the authenticated organization. Filter pronunciation dictionaries by provider, resource ID, or creation and update timestamps.
+
+
+
+
+
#### 🔌 Usage
@@ -5933,7 +11068,7 @@ $client->providerResources->providerResourceControllerGetProviderResourcesPagina
-
-**$id:** `?string`
+**$id:** `?string` — Filters provider resources by their resource ID.
@@ -5941,7 +11076,7 @@ $client->providerResources->providerResourceControllerGetProviderResourcesPagina
-
-**$resourceId:** `?string`
+**$resourceId:** `?string` — Filters provider resources by their provider-specific resource ID.
@@ -5965,6 +11100,14 @@ $client->providerResources->providerResourceControllerGetProviderResourcesPagina
-
+**$sortBy:** `?string` — This is the column to sort by. Defaults to 'createdAt'.
+
+
+
+
+
+-
+
**$limit:** `?float` — This is the maximum number of items to return. Defaults to 100.
@@ -6045,6 +11188,20 @@ $client->providerResources->providerResourceControllerGetProviderResourcesPagina
-
+#### 📝 Description
+
+
+-
+
+
+-
+
+Creates a pronunciation-dictionary resource for a supported provider, currently Cartesia or ElevenLabs.
+
+
+
+
+
#### 🔌 Usage
@@ -6096,6 +11253,20 @@ $client->providerResources->providerResourceControllerCreateProviderResource(
-
+#### 📝 Description
+
+
+-
+
+
+-
+
+Returns the provider resource identified by its Vapi resource ID.
+
+
+
+
+
#### 🔌 Usage
@@ -6140,7 +11311,7 @@ $client->providerResources->providerResourceControllerGetProviderResource(
-
-**$id:** `string`
+**$id:** `string` — The unique identifier of the provider resource.
@@ -6156,6 +11327,20 @@ $client->providerResources->providerResourceControllerGetProviderResource(
-
+#### 📝 Description
+
+
+-
+
+
+-
+
+Deletes the provider resource identified by its Vapi resource ID.
+
+
+
+
+
#### 🔌 Usage
@@ -6200,7 +11385,7 @@ $client->providerResources->providerResourceControllerDeleteProviderResource(
-
-**$id:** `string`
+**$id:** `string` — The unique identifier of the provider resource.
@@ -6216,6 +11401,20 @@ $client->providerResources->providerResourceControllerDeleteProviderResource(
-
+#### 📝 Description
+
+
+-
+
+
+-
+
+Updates the provider resource identified by its Vapi resource ID.
+
+
+
+
+
#### 🔌 Usage
@@ -6260,7 +11459,7 @@ $client->providerResources->providerResourceControllerUpdateProviderResource(
-
-**$id:** `string`
+**$id:** `string` — The unique identifier of the provider resource.
@@ -6277,6 +11476,20 @@ $client->providerResources->providerResourceControllerUpdateProviderResource(
-
+#### 📝 Description
+
+
+-
+
+
+-
+
+Runs one or more metric queries against call or subscription data using the requested time range, groupings, and aggregate operations.
+
+
+
+
+
#### 🔌 Usage
diff --git a/src/Analytics/AnalyticsClient.php b/src/Analytics/AnalyticsClient.php
index 15fdf09..9000242 100644
--- a/src/Analytics/AnalyticsClient.php
+++ b/src/Analytics/AnalyticsClient.php
@@ -52,6 +52,8 @@ public function __construct(
}
/**
+ * Runs one or more metric queries against call or subscription data using the requested time range, groupings, and aggregate operations.
+ *
* @param AnalyticsQueryDto $request
* @param ?array{
* baseUrl?: string,
diff --git a/src/Assistants/AssistantsClient.php b/src/Assistants/AssistantsClient.php
index 023b75c..e993c67 100644
--- a/src/Assistants/AssistantsClient.php
+++ b/src/Assistants/AssistantsClient.php
@@ -55,6 +55,8 @@ public function __construct(
}
/**
+ * Returns assistants for the authenticated organization. Filter results by creation or update timestamps and limit the number returned.
+ *
* @param ListAssistantsRequest $request
* @param ?array{
* baseUrl?: string,
@@ -130,6 +132,8 @@ public function list(ListAssistantsRequest $request = new ListAssistantsRequest(
}
/**
+ * Creates a reusable assistant configuration containing the model, voice, transcriber, tools, prompts, and call behavior.
+ *
* @param CreateAssistantDto $request
* @param ?array{
* baseUrl?: string,
@@ -177,7 +181,9 @@ public function create(CreateAssistantDto $request, ?array $options = null): ?As
}
/**
- * @param string $id
+ * Returns the assistant identified by its ID.
+ *
+ * @param string $id The unique identifier of the assistant.
* @param ?array{
* baseUrl?: string,
* maxRetries?: int,
@@ -223,7 +229,9 @@ public function get(string $id, ?array $options = null): ?Assistant
}
/**
- * @param string $id
+ * Deletes the assistant identified by its ID.
+ *
+ * @param string $id The unique identifier of the assistant.
* @param ?array{
* baseUrl?: string,
* maxRetries?: int,
@@ -269,7 +277,9 @@ public function delete(string $id, ?array $options = null): ?Assistant
}
/**
- * @param string $id
+ * Updates the specified fields of the assistant identified by its ID.
+ *
+ * @param string $id The unique identifier of the assistant.
* @param UpdateAssistantDto $request
* @param ?array{
* baseUrl?: string,
diff --git a/src/Assistants/Requests/UpdateAssistantDto.php b/src/Assistants/Requests/UpdateAssistantDto.php
index 2cc64ee..e0a47c0 100644
--- a/src/Assistants/Requests/UpdateAssistantDto.php
+++ b/src/Assistants/Requests/UpdateAssistantDto.php
@@ -67,7 +67,7 @@ class UpdateAssistantDto extends JsonSerializableType
public ?string $firstMessage;
/**
- * @var ?bool $firstMessageInterruptionsEnabled
+ * @var ?bool $firstMessageInterruptionsEnabled Set to `true` to allow the user to interrupt the assistant while it speaks the first message. Default is `false`.
*/
#[JsonProperty('firstMessageInterruptionsEnabled')]
public ?bool $firstMessageInterruptionsEnabled;
@@ -217,7 +217,7 @@ class UpdateAssistantDto extends JsonSerializableType
public ?array $endCallPhrases;
/**
- * @var ?CompliancePlan $compliancePlan
+ * @var ?CompliancePlan $compliancePlan Compliance settings for the assistant, including HIPAA and PCI behavior, security filtering, and recording consent.
*/
#[JsonProperty('compliancePlan')]
public ?CompliancePlan $compliancePlan;
@@ -320,7 +320,7 @@ class UpdateAssistantDto extends JsonSerializableType
public ?Server $server;
/**
- * @var ?KeypadInputPlan $keypadInputPlan
+ * @var ?KeypadInputPlan $keypadInputPlan Configuration for collecting and processing DTMF keypad input during calls.
*/
#[JsonProperty('keypadInputPlan')]
public ?KeypadInputPlan $keypadInputPlan;
diff --git a/src/Assistants/Types/UpdateAssistantDtoCredentialsItem.php b/src/Assistants/Types/UpdateAssistantDtoCredentialsItem.php
index f0401ae..26ee9c9 100644
--- a/src/Assistants/Types/UpdateAssistantDtoCredentialsItem.php
+++ b/src/Assistants/Types/UpdateAssistantDtoCredentialsItem.php
@@ -34,6 +34,7 @@
use Vapi\Types\CreateRimeAiCredentialDto;
use Vapi\Types\CreateRunpodCredentialDto;
use Vapi\Types\CreateS3CredentialDto;
+use Vapi\Types\CreateS3CompatibleCredentialDto;
use Vapi\Types\CreateSupabaseCredentialDto;
use Vapi\Types\CreateSmallestAiCredentialDto;
use Vapi\Types\CreateTavusCredentialDto;
@@ -43,12 +44,12 @@
use Vapi\Types\CreateWebhookCredentialDto;
use Vapi\Types\CreateCustomCredentialDto;
use Vapi\Types\CreateXAiCredentialDto;
+use Vapi\Types\CreateMicrosoftCredentialDto;
use Vapi\Types\CreateNeuphonicCredentialDto;
use Vapi\Types\CreateHumeCredentialDto;
use Vapi\Types\CreateMistralCredentialDto;
use Vapi\Types\CreateSpeechmaticsCredentialDto;
use Vapi\Types\CreateSonioxCredentialDto;
-use Vapi\Types\CreateTrieveCredentialDto;
use Vapi\Types\CreateGoogleCalendarOAuth2ClientCredentialDto;
use Vapi\Types\CreateGoogleCalendarOAuth2AuthorizationCredentialDto;
use Vapi\Types\CreateGoogleSheetsOAuth2AuthorizationCredentialDto;
@@ -97,6 +98,7 @@ class UpdateAssistantDtoCredentialsItem extends JsonSerializableType
* |'rime-ai'
* |'runpod'
* |'s3'
+ * |'s3-compatible'
* |'supabase'
* |'smallest-ai'
* |'tavus'
@@ -106,12 +108,12 @@ class UpdateAssistantDtoCredentialsItem extends JsonSerializableType
* |'webhook'
* |'custom-credential'
* |'xai'
+ * |'microsoft'
* |'neuphonic'
* |'hume'
* |'mistral'
* |'speechmatics'
* |'soniox'
- * |'trieve'
* |'google.calendar.oauth2-client'
* |'google.calendar.oauth2-authorization'
* |'google.sheets.oauth2-authorization'
@@ -160,6 +162,7 @@ class UpdateAssistantDtoCredentialsItem extends JsonSerializableType
* |CreateRimeAiCredentialDto
* |CreateRunpodCredentialDto
* |CreateS3CredentialDto
+ * |CreateS3CompatibleCredentialDto
* |CreateSupabaseCredentialDto
* |CreateSmallestAiCredentialDto
* |CreateTavusCredentialDto
@@ -169,12 +172,12 @@ class UpdateAssistantDtoCredentialsItem extends JsonSerializableType
* |CreateWebhookCredentialDto
* |CreateCustomCredentialDto
* |CreateXAiCredentialDto
+ * |CreateMicrosoftCredentialDto
* |CreateNeuphonicCredentialDto
* |CreateHumeCredentialDto
* |CreateMistralCredentialDto
* |CreateSpeechmaticsCredentialDto
* |CreateSonioxCredentialDto
- * |CreateTrieveCredentialDto
* |CreateGoogleCalendarOAuth2ClientCredentialDto
* |CreateGoogleCalendarOAuth2AuthorizationCredentialDto
* |CreateGoogleSheetsOAuth2AuthorizationCredentialDto
@@ -224,6 +227,7 @@ class UpdateAssistantDtoCredentialsItem extends JsonSerializableType
* |'rime-ai'
* |'runpod'
* |'s3'
+ * |'s3-compatible'
* |'supabase'
* |'smallest-ai'
* |'tavus'
@@ -233,12 +237,12 @@ class UpdateAssistantDtoCredentialsItem extends JsonSerializableType
* |'webhook'
* |'custom-credential'
* |'xai'
+ * |'microsoft'
* |'neuphonic'
* |'hume'
* |'mistral'
* |'speechmatics'
* |'soniox'
- * |'trieve'
* |'google.calendar.oauth2-client'
* |'google.calendar.oauth2-authorization'
* |'google.sheets.oauth2-authorization'
@@ -283,6 +287,7 @@ class UpdateAssistantDtoCredentialsItem extends JsonSerializableType
* |CreateRimeAiCredentialDto
* |CreateRunpodCredentialDto
* |CreateS3CredentialDto
+ * |CreateS3CompatibleCredentialDto
* |CreateSupabaseCredentialDto
* |CreateSmallestAiCredentialDto
* |CreateTavusCredentialDto
@@ -292,12 +297,12 @@ class UpdateAssistantDtoCredentialsItem extends JsonSerializableType
* |CreateWebhookCredentialDto
* |CreateCustomCredentialDto
* |CreateXAiCredentialDto
+ * |CreateMicrosoftCredentialDto
* |CreateNeuphonicCredentialDto
* |CreateHumeCredentialDto
* |CreateMistralCredentialDto
* |CreateSpeechmaticsCredentialDto
* |CreateSonioxCredentialDto
- * |CreateTrieveCredentialDto
* |CreateGoogleCalendarOAuth2ClientCredentialDto
* |CreateGoogleCalendarOAuth2AuthorizationCredentialDto
* |CreateGoogleSheetsOAuth2AuthorizationCredentialDto
@@ -691,6 +696,18 @@ public static function s3(CreateS3CredentialDto $s3): UpdateAssistantDtoCredenti
]);
}
+ /**
+ * @param CreateS3CompatibleCredentialDto $s3Compatible
+ * @return UpdateAssistantDtoCredentialsItem
+ */
+ public static function s3Compatible(CreateS3CompatibleCredentialDto $s3Compatible): UpdateAssistantDtoCredentialsItem
+ {
+ return new UpdateAssistantDtoCredentialsItem([
+ 'provider' => 's3-compatible',
+ 'value' => $s3Compatible,
+ ]);
+ }
+
/**
* @param CreateSupabaseCredentialDto $supabase
* @return UpdateAssistantDtoCredentialsItem
@@ -799,6 +816,18 @@ public static function xai(CreateXAiCredentialDto $xai): UpdateAssistantDtoCrede
]);
}
+ /**
+ * @param CreateMicrosoftCredentialDto $microsoft
+ * @return UpdateAssistantDtoCredentialsItem
+ */
+ public static function microsoft(CreateMicrosoftCredentialDto $microsoft): UpdateAssistantDtoCredentialsItem
+ {
+ return new UpdateAssistantDtoCredentialsItem([
+ 'provider' => 'microsoft',
+ 'value' => $microsoft,
+ ]);
+ }
+
/**
* @param CreateNeuphonicCredentialDto $neuphonic
* @return UpdateAssistantDtoCredentialsItem
@@ -859,18 +888,6 @@ public static function soniox(CreateSonioxCredentialDto $soniox): UpdateAssistan
]);
}
- /**
- * @param CreateTrieveCredentialDto $trieve
- * @return UpdateAssistantDtoCredentialsItem
- */
- public static function trieve(CreateTrieveCredentialDto $trieve): UpdateAssistantDtoCredentialsItem
- {
- return new UpdateAssistantDtoCredentialsItem([
- 'provider' => 'trieve',
- 'value' => $trieve,
- ]);
- }
-
/**
* @param CreateGoogleCalendarOAuth2ClientCredentialDto $googleCalendarOauth2Client
* @return UpdateAssistantDtoCredentialsItem
@@ -1673,6 +1690,28 @@ public function asS3(): CreateS3CredentialDto
return $this->value;
}
+ /**
+ * @return bool
+ */
+ public function isS3Compatible(): bool
+ {
+ return $this->value instanceof CreateS3CompatibleCredentialDto && $this->provider === 's3-compatible';
+ }
+
+ /**
+ * @return CreateS3CompatibleCredentialDto
+ */
+ public function asS3Compatible(): CreateS3CompatibleCredentialDto
+ {
+ if (!($this->value instanceof CreateS3CompatibleCredentialDto && $this->provider === 's3-compatible')) {
+ throw new Exception(
+ "Expected s3-compatible; got " . $this->provider . " with value of type " . get_debug_type($this->value),
+ );
+ }
+
+ return $this->value;
+ }
+
/**
* @return bool
*/
@@ -1871,6 +1910,28 @@ public function asXai(): CreateXAiCredentialDto
return $this->value;
}
+ /**
+ * @return bool
+ */
+ public function isMicrosoft(): bool
+ {
+ return $this->value instanceof CreateMicrosoftCredentialDto && $this->provider === 'microsoft';
+ }
+
+ /**
+ * @return CreateMicrosoftCredentialDto
+ */
+ public function asMicrosoft(): CreateMicrosoftCredentialDto
+ {
+ if (!($this->value instanceof CreateMicrosoftCredentialDto && $this->provider === 'microsoft')) {
+ throw new Exception(
+ "Expected microsoft; got " . $this->provider . " with value of type " . get_debug_type($this->value),
+ );
+ }
+
+ return $this->value;
+ }
+
/**
* @return bool
*/
@@ -1981,28 +2042,6 @@ public function asSoniox(): CreateSonioxCredentialDto
return $this->value;
}
- /**
- * @return bool
- */
- public function isTrieve(): bool
- {
- return $this->value instanceof CreateTrieveCredentialDto && $this->provider === 'trieve';
- }
-
- /**
- * @return CreateTrieveCredentialDto
- */
- public function asTrieve(): CreateTrieveCredentialDto
- {
- if (!($this->value instanceof CreateTrieveCredentialDto && $this->provider === 'trieve')) {
- throw new Exception(
- "Expected trieve; got " . $this->provider . " with value of type " . get_debug_type($this->value),
- );
- }
-
- return $this->value;
- }
-
/**
* @return bool
*/
@@ -2367,6 +2406,10 @@ public function jsonSerialize(): array
$value = $this->asS3()->jsonSerialize();
$result = array_merge($value, $result);
break;
+ case 's3-compatible':
+ $value = $this->asS3Compatible()->jsonSerialize();
+ $result = array_merge($value, $result);
+ break;
case 'supabase':
$value = $this->asSupabase()->jsonSerialize();
$result = array_merge($value, $result);
@@ -2403,6 +2446,10 @@ public function jsonSerialize(): array
$value = $this->asXai()->jsonSerialize();
$result = array_merge($value, $result);
break;
+ case 'microsoft':
+ $value = $this->asMicrosoft()->jsonSerialize();
+ $result = array_merge($value, $result);
+ break;
case 'neuphonic':
$value = $this->asNeuphonic()->jsonSerialize();
$result = array_merge($value, $result);
@@ -2423,10 +2470,6 @@ public function jsonSerialize(): array
$value = $this->asSoniox()->jsonSerialize();
$result = array_merge($value, $result);
break;
- case 'trieve':
- $value = $this->asTrieve()->jsonSerialize();
- $result = array_merge($value, $result);
- break;
case 'google.calendar.oauth2-client':
$value = $this->asGoogleCalendarOauth2Client()->jsonSerialize();
$result = array_merge($value, $result);
@@ -2608,6 +2651,9 @@ public static function jsonDeserialize(array $data): static
case 's3':
$args['value'] = CreateS3CredentialDto::jsonDeserialize($data);
break;
+ case 's3-compatible':
+ $args['value'] = CreateS3CompatibleCredentialDto::jsonDeserialize($data);
+ break;
case 'supabase':
$args['value'] = CreateSupabaseCredentialDto::jsonDeserialize($data);
break;
@@ -2635,6 +2681,9 @@ public static function jsonDeserialize(array $data): static
case 'xai':
$args['value'] = CreateXAiCredentialDto::jsonDeserialize($data);
break;
+ case 'microsoft':
+ $args['value'] = CreateMicrosoftCredentialDto::jsonDeserialize($data);
+ break;
case 'neuphonic':
$args['value'] = CreateNeuphonicCredentialDto::jsonDeserialize($data);
break;
@@ -2650,9 +2699,6 @@ public static function jsonDeserialize(array $data): static
case 'soniox':
$args['value'] = CreateSonioxCredentialDto::jsonDeserialize($data);
break;
- case 'trieve':
- $args['value'] = CreateTrieveCredentialDto::jsonDeserialize($data);
- break;
case 'google.calendar.oauth2-client':
$args['value'] = CreateGoogleCalendarOAuth2ClientCredentialDto::jsonDeserialize($data);
break;
diff --git a/src/Assistants/Types/UpdateAssistantDtoModel.php b/src/Assistants/Types/UpdateAssistantDtoModel.php
index 9a7e949..991218b 100644
--- a/src/Assistants/Types/UpdateAssistantDtoModel.php
+++ b/src/Assistants/Types/UpdateAssistantDtoModel.php
@@ -19,6 +19,7 @@
use Vapi\Types\PerplexityAiModel;
use Vapi\Types\TogetherAiModel;
use Vapi\Types\XaiModel;
+use Vapi\Types\VapiModel;
use Exception;
use Vapi\Core\Json\JsonDecoder;
@@ -45,6 +46,7 @@ class UpdateAssistantDtoModel extends JsonSerializableType
* |'perplexity-ai'
* |'together-ai'
* |'xai'
+ * |'vapi'
* |'_unknown'
* ) $provider
*/
@@ -68,6 +70,7 @@ class UpdateAssistantDtoModel extends JsonSerializableType
* |PerplexityAiModel
* |TogetherAiModel
* |XaiModel
+ * |VapiModel
* |mixed
* ) $value
*/
@@ -92,6 +95,7 @@ class UpdateAssistantDtoModel extends JsonSerializableType
* |'perplexity-ai'
* |'together-ai'
* |'xai'
+ * |'vapi'
* |'_unknown'
* ),
* value: (
@@ -111,6 +115,7 @@ class UpdateAssistantDtoModel extends JsonSerializableType
* |PerplexityAiModel
* |TogetherAiModel
* |XaiModel
+ * |VapiModel
* |mixed
* ),
* } $values
@@ -314,6 +319,18 @@ public static function xai(XaiModel $xai): UpdateAssistantDtoModel
]);
}
+ /**
+ * @param VapiModel $vapi
+ * @return UpdateAssistantDtoModel
+ */
+ public static function vapi(VapiModel $vapi): UpdateAssistantDtoModel
+ {
+ return new UpdateAssistantDtoModel([
+ 'provider' => 'vapi',
+ 'value' => $vapi,
+ ]);
+ }
+
/**
* @return bool
*/
@@ -666,6 +683,28 @@ public function asXai(): XaiModel
return $this->value;
}
+ /**
+ * @return bool
+ */
+ public function isVapi(): bool
+ {
+ return $this->value instanceof VapiModel && $this->provider === 'vapi';
+ }
+
+ /**
+ * @return VapiModel
+ */
+ public function asVapi(): VapiModel
+ {
+ if (!($this->value instanceof VapiModel && $this->provider === 'vapi')) {
+ throw new Exception(
+ "Expected vapi; got " . $this->provider . " with value of type " . get_debug_type($this->value),
+ );
+ }
+
+ return $this->value;
+ }
+
/**
* @return string
*/
@@ -750,6 +789,10 @@ public function jsonSerialize(): array
$value = $this->asXai()->jsonSerialize();
$result = array_merge($value, $result);
break;
+ case 'vapi':
+ $value = $this->asVapi()->jsonSerialize();
+ $result = array_merge($value, $result);
+ break;
case '_unknown':
default:
if (is_null($this->value)) {
@@ -846,6 +889,9 @@ public static function jsonDeserialize(array $data): static
case 'xai':
$args['value'] = XaiModel::jsonDeserialize($data);
break;
+ case 'vapi':
+ $args['value'] = VapiModel::jsonDeserialize($data);
+ break;
case '_unknown':
default:
$args['provider'] = '_unknown';
diff --git a/src/Assistants/Types/UpdateAssistantDtoServerMessagesItem.php b/src/Assistants/Types/UpdateAssistantDtoServerMessagesItem.php
index 4c78c05..89d4fb6 100644
--- a/src/Assistants/Types/UpdateAssistantDtoServerMessagesItem.php
+++ b/src/Assistants/Types/UpdateAssistantDtoServerMessagesItem.php
@@ -31,4 +31,5 @@ enum UpdateAssistantDtoServerMessagesItem: string
case SessionDeleted = "session.deleted";
case CallDeleted = "call.deleted";
case CallDeleteFailed = "call.delete.failed";
+ case CallArtifactUpload = "call.artifact.upload";
}
diff --git a/src/Assistants/Types/UpdateAssistantDtoTranscriber.php b/src/Assistants/Types/UpdateAssistantDtoTranscriber.php
index 41ff848..f94d90b 100644
--- a/src/Assistants/Types/UpdateAssistantDtoTranscriber.php
+++ b/src/Assistants/Types/UpdateAssistantDtoTranscriber.php
@@ -15,6 +15,8 @@
use Vapi\Types\OpenAiTranscriber;
use Vapi\Types\CartesiaTranscriber;
use Vapi\Types\SonioxTranscriber;
+use Vapi\Types\XaiTranscriber;
+use Vapi\Types\VapiTranscriber;
use Exception;
use Vapi\Core\Json\JsonDecoder;
@@ -37,6 +39,8 @@ class UpdateAssistantDtoTranscriber extends JsonSerializableType
* |'openai'
* |'cartesia'
* |'soniox'
+ * |'xai'
+ * |'vapi'
* |'_unknown'
* ) $provider
*/
@@ -56,6 +60,8 @@ class UpdateAssistantDtoTranscriber extends JsonSerializableType
* |OpenAiTranscriber
* |CartesiaTranscriber
* |SonioxTranscriber
+ * |XaiTranscriber
+ * |VapiTranscriber
* |mixed
* ) $value
*/
@@ -76,6 +82,8 @@ class UpdateAssistantDtoTranscriber extends JsonSerializableType
* |'openai'
* |'cartesia'
* |'soniox'
+ * |'xai'
+ * |'vapi'
* |'_unknown'
* ),
* value: (
@@ -91,6 +99,8 @@ class UpdateAssistantDtoTranscriber extends JsonSerializableType
* |OpenAiTranscriber
* |CartesiaTranscriber
* |SonioxTranscriber
+ * |XaiTranscriber
+ * |VapiTranscriber
* |mixed
* ),
* } $values
@@ -246,6 +256,30 @@ public static function soniox(SonioxTranscriber $soniox): UpdateAssistantDtoTran
]);
}
+ /**
+ * @param XaiTranscriber $xai
+ * @return UpdateAssistantDtoTranscriber
+ */
+ public static function xai(XaiTranscriber $xai): UpdateAssistantDtoTranscriber
+ {
+ return new UpdateAssistantDtoTranscriber([
+ 'provider' => 'xai',
+ 'value' => $xai,
+ ]);
+ }
+
+ /**
+ * @param VapiTranscriber $vapi
+ * @return UpdateAssistantDtoTranscriber
+ */
+ public static function vapi(VapiTranscriber $vapi): UpdateAssistantDtoTranscriber
+ {
+ return new UpdateAssistantDtoTranscriber([
+ 'provider' => 'vapi',
+ 'value' => $vapi,
+ ]);
+ }
+
/**
* @return bool
*/
@@ -510,6 +544,50 @@ public function asSoniox(): SonioxTranscriber
return $this->value;
}
+ /**
+ * @return bool
+ */
+ public function isXai(): bool
+ {
+ return $this->value instanceof XaiTranscriber && $this->provider === 'xai';
+ }
+
+ /**
+ * @return XaiTranscriber
+ */
+ public function asXai(): XaiTranscriber
+ {
+ if (!($this->value instanceof XaiTranscriber && $this->provider === 'xai')) {
+ throw new Exception(
+ "Expected xai; got " . $this->provider . " with value of type " . get_debug_type($this->value),
+ );
+ }
+
+ return $this->value;
+ }
+
+ /**
+ * @return bool
+ */
+ public function isVapi(): bool
+ {
+ return $this->value instanceof VapiTranscriber && $this->provider === 'vapi';
+ }
+
+ /**
+ * @return VapiTranscriber
+ */
+ public function asVapi(): VapiTranscriber
+ {
+ if (!($this->value instanceof VapiTranscriber && $this->provider === 'vapi')) {
+ throw new Exception(
+ "Expected vapi; got " . $this->provider . " with value of type " . get_debug_type($this->value),
+ );
+ }
+
+ return $this->value;
+ }
+
/**
* @return string
*/
@@ -578,6 +656,14 @@ public function jsonSerialize(): array
$value = $this->asSoniox()->jsonSerialize();
$result = array_merge($value, $result);
break;
+ case 'xai':
+ $value = $this->asXai()->jsonSerialize();
+ $result = array_merge($value, $result);
+ break;
+ case 'vapi':
+ $value = $this->asVapi()->jsonSerialize();
+ $result = array_merge($value, $result);
+ break;
case '_unknown':
default:
if (is_null($this->value)) {
@@ -662,6 +748,12 @@ public static function jsonDeserialize(array $data): static
case 'soniox':
$args['value'] = SonioxTranscriber::jsonDeserialize($data);
break;
+ case 'xai':
+ $args['value'] = XaiTranscriber::jsonDeserialize($data);
+ break;
+ case 'vapi':
+ $args['value'] = VapiTranscriber::jsonDeserialize($data);
+ break;
case '_unknown':
default:
$args['provider'] = '_unknown';
diff --git a/src/Assistants/Types/UpdateAssistantDtoVoice.php b/src/Assistants/Types/UpdateAssistantDtoVoice.php
index 1242bff..7472faf 100644
--- a/src/Assistants/Types/UpdateAssistantDtoVoice.php
+++ b/src/Assistants/Types/UpdateAssistantDtoVoice.php
@@ -21,6 +21,8 @@
use Vapi\Types\SesameVoice;
use Vapi\Types\InworldVoice;
use Vapi\Types\MinimaxVoice;
+use Vapi\Types\XaiVoice;
+use Vapi\Types\MicrosoftVoice;
use Exception;
use Vapi\Core\Json\JsonDecoder;
@@ -49,6 +51,8 @@ class UpdateAssistantDtoVoice extends JsonSerializableType
* |'sesame'
* |'inworld'
* |'minimax'
+ * |'xai'
+ * |'microsoft'
* |'_unknown'
* ) $provider
*/
@@ -74,6 +78,8 @@ class UpdateAssistantDtoVoice extends JsonSerializableType
* |SesameVoice
* |InworldVoice
* |MinimaxVoice
+ * |XaiVoice
+ * |MicrosoftVoice
* |mixed
* ) $value
*/
@@ -100,6 +106,8 @@ class UpdateAssistantDtoVoice extends JsonSerializableType
* |'sesame'
* |'inworld'
* |'minimax'
+ * |'xai'
+ * |'microsoft'
* |'_unknown'
* ),
* value: (
@@ -121,6 +129,8 @@ class UpdateAssistantDtoVoice extends JsonSerializableType
* |SesameVoice
* |InworldVoice
* |MinimaxVoice
+ * |XaiVoice
+ * |MicrosoftVoice
* |mixed
* ),
* } $values
@@ -348,6 +358,30 @@ public static function minimax(MinimaxVoice $minimax): UpdateAssistantDtoVoice
]);
}
+ /**
+ * @param XaiVoice $xai
+ * @return UpdateAssistantDtoVoice
+ */
+ public static function xai(XaiVoice $xai): UpdateAssistantDtoVoice
+ {
+ return new UpdateAssistantDtoVoice([
+ 'provider' => 'xai',
+ 'value' => $xai,
+ ]);
+ }
+
+ /**
+ * @param MicrosoftVoice $microsoft
+ * @return UpdateAssistantDtoVoice
+ */
+ public static function microsoft(MicrosoftVoice $microsoft): UpdateAssistantDtoVoice
+ {
+ return new UpdateAssistantDtoVoice([
+ 'provider' => 'microsoft',
+ 'value' => $microsoft,
+ ]);
+ }
+
/**
* @return bool
*/
@@ -744,6 +778,50 @@ public function asMinimax(): MinimaxVoice
return $this->value;
}
+ /**
+ * @return bool
+ */
+ public function isXai(): bool
+ {
+ return $this->value instanceof XaiVoice && $this->provider === 'xai';
+ }
+
+ /**
+ * @return XaiVoice
+ */
+ public function asXai(): XaiVoice
+ {
+ if (!($this->value instanceof XaiVoice && $this->provider === 'xai')) {
+ throw new Exception(
+ "Expected xai; got " . $this->provider . " with value of type " . get_debug_type($this->value),
+ );
+ }
+
+ return $this->value;
+ }
+
+ /**
+ * @return bool
+ */
+ public function isMicrosoft(): bool
+ {
+ return $this->value instanceof MicrosoftVoice && $this->provider === 'microsoft';
+ }
+
+ /**
+ * @return MicrosoftVoice
+ */
+ public function asMicrosoft(): MicrosoftVoice
+ {
+ if (!($this->value instanceof MicrosoftVoice && $this->provider === 'microsoft')) {
+ throw new Exception(
+ "Expected microsoft; got " . $this->provider . " with value of type " . get_debug_type($this->value),
+ );
+ }
+
+ return $this->value;
+ }
+
/**
* @return string
*/
@@ -836,6 +914,14 @@ public function jsonSerialize(): array
$value = $this->asMinimax()->jsonSerialize();
$result = array_merge($value, $result);
break;
+ case 'xai':
+ $value = $this->asXai()->jsonSerialize();
+ $result = array_merge($value, $result);
+ break;
+ case 'microsoft':
+ $value = $this->asMicrosoft()->jsonSerialize();
+ $result = array_merge($value, $result);
+ break;
case '_unknown':
default:
if (is_null($this->value)) {
@@ -938,6 +1024,12 @@ public static function jsonDeserialize(array $data): static
case 'minimax':
$args['value'] = MinimaxVoice::jsonDeserialize($data);
break;
+ case 'xai':
+ $args['value'] = XaiVoice::jsonDeserialize($data);
+ break;
+ case 'microsoft':
+ $args['value'] = MicrosoftVoice::jsonDeserialize($data);
+ break;
case '_unknown':
default:
$args['provider'] = '_unknown';
diff --git a/src/Board/BoardClient.php b/src/Board/BoardClient.php
new file mode 100644
index 0000000..1326904
--- /dev/null
+++ b/src/Board/BoardClient.php
@@ -0,0 +1,372 @@
+,
+ * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator
+ */
+ private array $options;
+
+ /**
+ * @var RawClient $client
+ */
+ private RawClient $client;
+
+ /**
+ * @param RawClient $client
+ * @param ?array{
+ * baseUrl?: string,
+ * client?: ClientInterface,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * } $options
+ */
+ public function __construct(
+ RawClient $client,
+ ?array $options = null,
+ ) {
+ $this->client = $client;
+ $this->options = $options ?? [];
+ }
+
+ /**
+ * @param BoardControllerFindAllRequest $request
+ * @param ?array{
+ * baseUrl?: string,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * queryParameters?: array,
+ * bodyProperties?: array,
+ * } $options
+ * @return ?BoardPaginatedResponse
+ * @throws VapiException
+ * @throws VapiApiException
+ */
+ public function boardControllerFindAll(BoardControllerFindAllRequest $request = new BoardControllerFindAllRequest(), ?array $options = null): ?BoardPaginatedResponse
+ {
+ $options = array_merge($this->options, $options ?? []);
+ $query = [];
+ if ($request->page != null) {
+ $query['page'] = $request->page;
+ }
+ if ($request->sortOrder != null) {
+ $query['sortOrder'] = $request->sortOrder;
+ }
+ if ($request->sortBy != null) {
+ $query['sortBy'] = $request->sortBy;
+ }
+ if ($request->limit != null) {
+ $query['limit'] = $request->limit;
+ }
+ if ($request->createdAtGt != null) {
+ $query['createdAtGt'] = JsonSerializer::serializeDateTime($request->createdAtGt);
+ }
+ if ($request->createdAtLt != null) {
+ $query['createdAtLt'] = JsonSerializer::serializeDateTime($request->createdAtLt);
+ }
+ if ($request->createdAtGe != null) {
+ $query['createdAtGe'] = JsonSerializer::serializeDateTime($request->createdAtGe);
+ }
+ if ($request->createdAtLe != null) {
+ $query['createdAtLe'] = JsonSerializer::serializeDateTime($request->createdAtLe);
+ }
+ if ($request->updatedAtGt != null) {
+ $query['updatedAtGt'] = JsonSerializer::serializeDateTime($request->updatedAtGt);
+ }
+ if ($request->updatedAtLt != null) {
+ $query['updatedAtLt'] = JsonSerializer::serializeDateTime($request->updatedAtLt);
+ }
+ if ($request->updatedAtGe != null) {
+ $query['updatedAtGe'] = JsonSerializer::serializeDateTime($request->updatedAtGe);
+ }
+ if ($request->updatedAtLe != null) {
+ $query['updatedAtLe'] = JsonSerializer::serializeDateTime($request->updatedAtLe);
+ }
+ try {
+ $response = $this->client->sendRequest(
+ new JsonApiRequest(
+ baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value,
+ path: "reporting/board",
+ method: HttpMethod::GET,
+ query: $query,
+ ),
+ $options,
+ );
+ $statusCode = $response->getStatusCode();
+ if ($statusCode >= 200 && $statusCode < 400) {
+ $json = $response->getBody()->getContents();
+ if (empty($json)) {
+ return null;
+ }
+ return BoardPaginatedResponse::fromJson($json);
+ }
+ } catch (JsonException $e) {
+ throw new VapiException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e);
+ } catch (ClientExceptionInterface $e) {
+ throw new VapiException(message: $e->getMessage(), previous: $e);
+ }
+ throw new VapiApiException(
+ message: 'API request failed',
+ statusCode: $statusCode,
+ body: $response->getBody()->getContents(),
+ );
+ }
+
+ /**
+ * @param CreateBoardDto $request
+ * @param ?array{
+ * baseUrl?: string,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * queryParameters?: array,
+ * bodyProperties?: array,
+ * } $options
+ * @return ?Board
+ * @throws VapiException
+ * @throws VapiApiException
+ */
+ public function boardControllerCreate(CreateBoardDto $request, ?array $options = null): ?Board
+ {
+ $options = array_merge($this->options, $options ?? []);
+ try {
+ $response = $this->client->sendRequest(
+ new JsonApiRequest(
+ baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value,
+ path: "reporting/board",
+ method: HttpMethod::POST,
+ body: $request,
+ ),
+ $options,
+ );
+ $statusCode = $response->getStatusCode();
+ if ($statusCode >= 200 && $statusCode < 400) {
+ $json = $response->getBody()->getContents();
+ if (empty($json)) {
+ return null;
+ }
+ return Board::fromJson($json);
+ }
+ } catch (JsonException $e) {
+ throw new VapiException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e);
+ } catch (ClientExceptionInterface $e) {
+ throw new VapiException(message: $e->getMessage(), previous: $e);
+ }
+ throw new VapiApiException(
+ message: 'API request failed',
+ statusCode: $statusCode,
+ body: $response->getBody()->getContents(),
+ );
+ }
+
+ /**
+ * @param ?array{
+ * baseUrl?: string,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * queryParameters?: array,
+ * bodyProperties?: array,
+ * } $options
+ * @return ?Board
+ * @throws VapiException
+ * @throws VapiApiException
+ */
+ public function boardControllerMetricsOverviewEnsure(?array $options = null): ?Board
+ {
+ $options = array_merge($this->options, $options ?? []);
+ try {
+ $response = $this->client->sendRequest(
+ new JsonApiRequest(
+ baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value,
+ path: "reporting/board/default/metrics-overview",
+ method: HttpMethod::GET,
+ ),
+ $options,
+ );
+ $statusCode = $response->getStatusCode();
+ if ($statusCode >= 200 && $statusCode < 400) {
+ $json = $response->getBody()->getContents();
+ if (empty($json)) {
+ return null;
+ }
+ return Board::fromJson($json);
+ }
+ } catch (JsonException $e) {
+ throw new VapiException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e);
+ } catch (ClientExceptionInterface $e) {
+ throw new VapiException(message: $e->getMessage(), previous: $e);
+ }
+ throw new VapiApiException(
+ message: 'API request failed',
+ statusCode: $statusCode,
+ body: $response->getBody()->getContents(),
+ );
+ }
+
+ /**
+ * @param string $id The unique identifier for the resource.
+ * @param ?array{
+ * baseUrl?: string,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * queryParameters?: array,
+ * bodyProperties?: array,
+ * } $options
+ * @return ?Board
+ * @throws VapiException
+ * @throws VapiApiException
+ */
+ public function boardControllerFindOne(string $id, ?array $options = null): ?Board
+ {
+ $options = array_merge($this->options, $options ?? []);
+ try {
+ $response = $this->client->sendRequest(
+ new JsonApiRequest(
+ baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value,
+ path: "reporting/board/{$id}",
+ method: HttpMethod::GET,
+ ),
+ $options,
+ );
+ $statusCode = $response->getStatusCode();
+ if ($statusCode >= 200 && $statusCode < 400) {
+ $json = $response->getBody()->getContents();
+ if (empty($json)) {
+ return null;
+ }
+ return Board::fromJson($json);
+ }
+ } catch (JsonException $e) {
+ throw new VapiException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e);
+ } catch (ClientExceptionInterface $e) {
+ throw new VapiException(message: $e->getMessage(), previous: $e);
+ }
+ throw new VapiApiException(
+ message: 'API request failed',
+ statusCode: $statusCode,
+ body: $response->getBody()->getContents(),
+ );
+ }
+
+ /**
+ * @param string $id The unique identifier for the resource.
+ * @param ?array{
+ * baseUrl?: string,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * queryParameters?: array,
+ * bodyProperties?: array,
+ * } $options
+ * @return ?Board
+ * @throws VapiException
+ * @throws VapiApiException
+ */
+ public function boardControllerRemove(string $id, ?array $options = null): ?Board
+ {
+ $options = array_merge($this->options, $options ?? []);
+ try {
+ $response = $this->client->sendRequest(
+ new JsonApiRequest(
+ baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value,
+ path: "reporting/board/{$id}",
+ method: HttpMethod::DELETE,
+ ),
+ $options,
+ );
+ $statusCode = $response->getStatusCode();
+ if ($statusCode >= 200 && $statusCode < 400) {
+ $json = $response->getBody()->getContents();
+ if (empty($json)) {
+ return null;
+ }
+ return Board::fromJson($json);
+ }
+ } catch (JsonException $e) {
+ throw new VapiException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e);
+ } catch (ClientExceptionInterface $e) {
+ throw new VapiException(message: $e->getMessage(), previous: $e);
+ }
+ throw new VapiApiException(
+ message: 'API request failed',
+ statusCode: $statusCode,
+ body: $response->getBody()->getContents(),
+ );
+ }
+
+ /**
+ * @param string $id The unique identifier for the resource.
+ * @param UpdateBoardDto $request
+ * @param ?array{
+ * baseUrl?: string,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * queryParameters?: array,
+ * bodyProperties?: array,
+ * } $options
+ * @return ?Board
+ * @throws VapiException
+ * @throws VapiApiException
+ */
+ public function boardControllerUpdate(string $id, UpdateBoardDto $request = new UpdateBoardDto(), ?array $options = null): ?Board
+ {
+ $options = array_merge($this->options, $options ?? []);
+ try {
+ $response = $this->client->sendRequest(
+ new JsonApiRequest(
+ baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value,
+ path: "reporting/board/{$id}",
+ method: HttpMethod::PATCH,
+ body: $request,
+ ),
+ $options,
+ );
+ $statusCode = $response->getStatusCode();
+ if ($statusCode >= 200 && $statusCode < 400) {
+ $json = $response->getBody()->getContents();
+ if (empty($json)) {
+ return null;
+ }
+ return Board::fromJson($json);
+ }
+ } catch (JsonException $e) {
+ throw new VapiException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e);
+ } catch (ClientExceptionInterface $e) {
+ throw new VapiException(message: $e->getMessage(), previous: $e);
+ }
+ throw new VapiApiException(
+ message: 'API request failed',
+ statusCode: $statusCode,
+ body: $response->getBody()->getContents(),
+ );
+ }
+}
diff --git a/src/Board/Requests/BoardControllerFindAllRequest.php b/src/Board/Requests/BoardControllerFindAllRequest.php
new file mode 100644
index 0000000..1744e9d
--- /dev/null
+++ b/src/Board/Requests/BoardControllerFindAllRequest.php
@@ -0,0 +1,104 @@
+ $sortOrder This is the sort order for pagination. Defaults to 'DESC'.
+ */
+ public ?string $sortOrder;
+
+ /**
+ * @var ?value-of $sortBy This is the column to sort by. Defaults to 'createdAt'.
+ */
+ public ?string $sortBy;
+
+ /**
+ * @var ?float $limit This is the maximum number of items to return. Defaults to 100.
+ */
+ public ?float $limit;
+
+ /**
+ * @var ?DateTime $createdAtGt This will return items where the createdAt is greater than the specified value.
+ */
+ public ?DateTime $createdAtGt;
+
+ /**
+ * @var ?DateTime $createdAtLt This will return items where the createdAt is less than the specified value.
+ */
+ public ?DateTime $createdAtLt;
+
+ /**
+ * @var ?DateTime $createdAtGe This will return items where the createdAt is greater than or equal to the specified value.
+ */
+ public ?DateTime $createdAtGe;
+
+ /**
+ * @var ?DateTime $createdAtLe This will return items where the createdAt is less than or equal to the specified value.
+ */
+ public ?DateTime $createdAtLe;
+
+ /**
+ * @var ?DateTime $updatedAtGt This will return items where the updatedAt is greater than the specified value.
+ */
+ public ?DateTime $updatedAtGt;
+
+ /**
+ * @var ?DateTime $updatedAtLt This will return items where the updatedAt is less than the specified value.
+ */
+ public ?DateTime $updatedAtLt;
+
+ /**
+ * @var ?DateTime $updatedAtGe This will return items where the updatedAt is greater than or equal to the specified value.
+ */
+ public ?DateTime $updatedAtGe;
+
+ /**
+ * @var ?DateTime $updatedAtLe This will return items where the updatedAt is less than or equal to the specified value.
+ */
+ public ?DateTime $updatedAtLe;
+
+ /**
+ * @param array{
+ * page?: ?float,
+ * sortOrder?: ?value-of,
+ * sortBy?: ?value-of,
+ * limit?: ?float,
+ * createdAtGt?: ?DateTime,
+ * createdAtLt?: ?DateTime,
+ * createdAtGe?: ?DateTime,
+ * createdAtLe?: ?DateTime,
+ * updatedAtGt?: ?DateTime,
+ * updatedAtLt?: ?DateTime,
+ * updatedAtGe?: ?DateTime,
+ * updatedAtLe?: ?DateTime,
+ * } $values
+ */
+ public function __construct(
+ array $values = [],
+ ) {
+ $this->page = $values['page'] ?? null;
+ $this->sortOrder = $values['sortOrder'] ?? null;
+ $this->sortBy = $values['sortBy'] ?? null;
+ $this->limit = $values['limit'] ?? null;
+ $this->createdAtGt = $values['createdAtGt'] ?? null;
+ $this->createdAtLt = $values['createdAtLt'] ?? null;
+ $this->createdAtGe = $values['createdAtGe'] ?? null;
+ $this->createdAtLe = $values['createdAtLe'] ?? null;
+ $this->updatedAtGt = $values['updatedAtGt'] ?? null;
+ $this->updatedAtLt = $values['updatedAtLt'] ?? null;
+ $this->updatedAtGe = $values['updatedAtGe'] ?? null;
+ $this->updatedAtLe = $values['updatedAtLe'] ?? null;
+ }
+}
diff --git a/src/Board/Requests/CreateBoardDto.php b/src/Board/Requests/CreateBoardDto.php
new file mode 100644
index 0000000..ad90176
--- /dev/null
+++ b/src/Board/Requests/CreateBoardDto.php
@@ -0,0 +1,66 @@
+ $items This is the contents of the Board, which is an array of objects defining the type, contents, and position of the widgets on the Board.
+ */
+ #[JsonProperty('items'), ArrayType([new Union(BoardInsightItem::class, BoardMetricWidgetItem::class)])]
+ public ?array $items;
+
+ /**
+ * @var string $name This is the name of the Board.
+ */
+ #[JsonProperty('name')]
+ public string $name;
+
+ /**
+ * @var BoardLayout $layout This is the layout of the Board.
+ */
+ #[JsonProperty('layout')]
+ public BoardLayout $layout;
+
+ /**
+ * This is the timerange override for the board.
+ * By default, individual insights have their own timerange.
+ * This is a global override for the board which will be passed to all insights on the board.
+ *
+ * @var ?InsightTimeRangeWithStep $timeRangeOverride
+ */
+ #[JsonProperty('timeRangeOverride')]
+ public ?InsightTimeRangeWithStep $timeRangeOverride;
+
+ /**
+ * @param array{
+ * name: string,
+ * layout: BoardLayout,
+ * items?: ?array<(
+ * BoardInsightItem
+ * |BoardMetricWidgetItem
+ * )>,
+ * timeRangeOverride?: ?InsightTimeRangeWithStep,
+ * } $values
+ */
+ public function __construct(
+ array $values,
+ ) {
+ $this->items = $values['items'] ?? null;
+ $this->name = $values['name'];
+ $this->layout = $values['layout'];
+ $this->timeRangeOverride = $values['timeRangeOverride'] ?? null;
+ }
+}
diff --git a/src/Board/Requests/UpdateBoardDto.php b/src/Board/Requests/UpdateBoardDto.php
new file mode 100644
index 0000000..440b60f
--- /dev/null
+++ b/src/Board/Requests/UpdateBoardDto.php
@@ -0,0 +1,66 @@
+ $items This is the contents of the Board, which is an array of objects defining the type, contents, and position of the widgets on the Board.
+ */
+ #[JsonProperty('items'), ArrayType([new Union(BoardInsightItem::class, BoardMetricWidgetItem::class)])]
+ public ?array $items;
+
+ /**
+ * @var ?string $name This is the name of the Board.
+ */
+ #[JsonProperty('name')]
+ public ?string $name;
+
+ /**
+ * @var ?BoardLayout $layout This is the layout of the Board.
+ */
+ #[JsonProperty('layout')]
+ public ?BoardLayout $layout;
+
+ /**
+ * This is the timerange override for the board.
+ * By default, individual insights have their own timerange.
+ * This is a global override for the board which will be passed to all insights on the board.
+ *
+ * @var ?InsightTimeRangeWithStep $timeRangeOverride
+ */
+ #[JsonProperty('timeRangeOverride')]
+ public ?InsightTimeRangeWithStep $timeRangeOverride;
+
+ /**
+ * @param array{
+ * items?: ?array<(
+ * BoardInsightItem
+ * |BoardMetricWidgetItem
+ * )>,
+ * name?: ?string,
+ * layout?: ?BoardLayout,
+ * timeRangeOverride?: ?InsightTimeRangeWithStep,
+ * } $values
+ */
+ public function __construct(
+ array $values = [],
+ ) {
+ $this->items = $values['items'] ?? null;
+ $this->name = $values['name'] ?? null;
+ $this->layout = $values['layout'] ?? null;
+ $this->timeRangeOverride = $values['timeRangeOverride'] ?? null;
+ }
+}
diff --git a/src/Board/Types/BoardControllerFindAllRequestSortBy.php b/src/Board/Types/BoardControllerFindAllRequestSortBy.php
new file mode 100644
index 0000000..5f045fe
--- /dev/null
+++ b/src/Board/Types/BoardControllerFindAllRequestSortBy.php
@@ -0,0 +1,10 @@
+getBody()->getContents(),
);
}
+
+ /**
+ * @param string $id Call ID
+ * @param ?array{
+ * baseUrl?: string,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * queryParameters?: array,
+ * bodyProperties?: array,
+ * } $options
+ * @throws VapiException
+ * @throws VapiApiException
+ */
+ public function callArtifactControllerMonoRecordingDownload(string $id, ?array $options = null): void
+ {
+ $options = array_merge($this->options, $options ?? []);
+ try {
+ $response = $this->client->sendRequest(
+ new JsonApiRequest(
+ baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value,
+ path: "call/{$id}/mono-recording",
+ method: HttpMethod::GET,
+ ),
+ $options,
+ );
+ $statusCode = $response->getStatusCode();
+ if ($statusCode >= 200 && $statusCode < 400) {
+ return;
+ }
+ } catch (ClientExceptionInterface $e) {
+ throw new VapiException(message: $e->getMessage(), previous: $e);
+ }
+ throw new VapiApiException(
+ message: 'API request failed',
+ statusCode: $statusCode,
+ body: $response->getBody()->getContents(),
+ );
+ }
+
+ /**
+ * @param string $id Call ID
+ * @param ?array{
+ * baseUrl?: string,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * queryParameters?: array,
+ * bodyProperties?: array,
+ * } $options
+ * @throws VapiException
+ * @throws VapiApiException
+ */
+ public function callArtifactControllerStereoRecordingDownload(string $id, ?array $options = null): void
+ {
+ $options = array_merge($this->options, $options ?? []);
+ try {
+ $response = $this->client->sendRequest(
+ new JsonApiRequest(
+ baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value,
+ path: "call/{$id}/stereo-recording",
+ method: HttpMethod::GET,
+ ),
+ $options,
+ );
+ $statusCode = $response->getStatusCode();
+ if ($statusCode >= 200 && $statusCode < 400) {
+ return;
+ }
+ } catch (ClientExceptionInterface $e) {
+ throw new VapiException(message: $e->getMessage(), previous: $e);
+ }
+ throw new VapiApiException(
+ message: 'API request failed',
+ statusCode: $statusCode,
+ body: $response->getBody()->getContents(),
+ );
+ }
+
+ /**
+ * @param string $id Call ID
+ * @param ?array{
+ * baseUrl?: string,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * queryParameters?: array,
+ * bodyProperties?: array,
+ * } $options
+ * @throws VapiException
+ * @throws VapiApiException
+ */
+ public function callArtifactControllerVideoRecordingDownload(string $id, ?array $options = null): void
+ {
+ $options = array_merge($this->options, $options ?? []);
+ try {
+ $response = $this->client->sendRequest(
+ new JsonApiRequest(
+ baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value,
+ path: "call/{$id}/video-recording",
+ method: HttpMethod::GET,
+ ),
+ $options,
+ );
+ $statusCode = $response->getStatusCode();
+ if ($statusCode >= 200 && $statusCode < 400) {
+ return;
+ }
+ } catch (ClientExceptionInterface $e) {
+ throw new VapiException(message: $e->getMessage(), previous: $e);
+ }
+ throw new VapiApiException(
+ message: 'API request failed',
+ statusCode: $statusCode,
+ body: $response->getBody()->getContents(),
+ );
+ }
+
+ /**
+ * @param string $id Call ID
+ * @param ?array{
+ * baseUrl?: string,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * queryParameters?: array,
+ * bodyProperties?: array,
+ * } $options
+ * @throws VapiException
+ * @throws VapiApiException
+ */
+ public function callArtifactControllerCustomerRecordingDownload(string $id, ?array $options = null): void
+ {
+ $options = array_merge($this->options, $options ?? []);
+ try {
+ $response = $this->client->sendRequest(
+ new JsonApiRequest(
+ baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value,
+ path: "call/{$id}/customer-recording",
+ method: HttpMethod::GET,
+ ),
+ $options,
+ );
+ $statusCode = $response->getStatusCode();
+ if ($statusCode >= 200 && $statusCode < 400) {
+ return;
+ }
+ } catch (ClientExceptionInterface $e) {
+ throw new VapiException(message: $e->getMessage(), previous: $e);
+ }
+ throw new VapiApiException(
+ message: 'API request failed',
+ statusCode: $statusCode,
+ body: $response->getBody()->getContents(),
+ );
+ }
+
+ /**
+ * @param string $id Call ID
+ * @param ?array{
+ * baseUrl?: string,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * queryParameters?: array,
+ * bodyProperties?: array,
+ * } $options
+ * @throws VapiException
+ * @throws VapiApiException
+ */
+ public function callArtifactControllerAssistantRecordingDownload(string $id, ?array $options = null): void
+ {
+ $options = array_merge($this->options, $options ?? []);
+ try {
+ $response = $this->client->sendRequest(
+ new JsonApiRequest(
+ baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value,
+ path: "call/{$id}/assistant-recording",
+ method: HttpMethod::GET,
+ ),
+ $options,
+ );
+ $statusCode = $response->getStatusCode();
+ if ($statusCode >= 200 && $statusCode < 400) {
+ return;
+ }
+ } catch (ClientExceptionInterface $e) {
+ throw new VapiException(message: $e->getMessage(), previous: $e);
+ }
+ throw new VapiApiException(
+ message: 'API request failed',
+ statusCode: $statusCode,
+ body: $response->getBody()->getContents(),
+ );
+ }
+
+ /**
+ * @param string $id Call ID
+ * @param ?array{
+ * baseUrl?: string,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * queryParameters?: array,
+ * bodyProperties?: array,
+ * } $options
+ * @throws VapiException
+ * @throws VapiApiException
+ */
+ public function callArtifactControllerPcapDownload(string $id, ?array $options = null): void
+ {
+ $options = array_merge($this->options, $options ?? []);
+ try {
+ $response = $this->client->sendRequest(
+ new JsonApiRequest(
+ baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value,
+ path: "call/{$id}/pcap",
+ method: HttpMethod::GET,
+ ),
+ $options,
+ );
+ $statusCode = $response->getStatusCode();
+ if ($statusCode >= 200 && $statusCode < 400) {
+ return;
+ }
+ } catch (ClientExceptionInterface $e) {
+ throw new VapiException(message: $e->getMessage(), previous: $e);
+ }
+ throw new VapiApiException(
+ message: 'API request failed',
+ statusCode: $statusCode,
+ body: $response->getBody()->getContents(),
+ );
+ }
+
+ /**
+ * @param string $id Call ID
+ * @param ?array{
+ * baseUrl?: string,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * queryParameters?: array,
+ * bodyProperties?: array,
+ * } $options
+ * @throws VapiException
+ * @throws VapiApiException
+ */
+ public function callArtifactControllerCallLogsDownload(string $id, ?array $options = null): void
+ {
+ $options = array_merge($this->options, $options ?? []);
+ try {
+ $response = $this->client->sendRequest(
+ new JsonApiRequest(
+ baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value,
+ path: "call/{$id}/call-logs",
+ method: HttpMethod::GET,
+ ),
+ $options,
+ );
+ $statusCode = $response->getStatusCode();
+ if ($statusCode >= 200 && $statusCode < 400) {
+ return;
+ }
+ } catch (ClientExceptionInterface $e) {
+ throw new VapiException(message: $e->getMessage(), previous: $e);
+ }
+ throw new VapiApiException(
+ message: 'API request failed',
+ statusCode: $statusCode,
+ body: $response->getBody()->getContents(),
+ );
+ }
}
diff --git a/src/Calls/Requests/CreateCallDto.php b/src/Calls/Requests/CreateCallDto.php
index 4f5c964..5c142a2 100644
--- a/src/Calls/Requests/CreateCallDto.php
+++ b/src/Calls/Requests/CreateCallDto.php
@@ -3,8 +3,9 @@
namespace Vapi\Calls\Requests;
use Vapi\Core\Json\JsonSerializableType;
-use Vapi\Types\CreateCustomerDto;
use Vapi\Core\Json\JsonProperty;
+use Vapi\Calls\Types\CreateCallDtoTransport;
+use Vapi\Types\CreateCustomerDto;
use Vapi\Core\Types\ArrayType;
use Vapi\Types\SchedulePlan;
use Vapi\Types\CreateAssistantDto;
@@ -16,6 +17,21 @@
class CreateCallDto extends JsonSerializableType
{
+ /**
+ * This is the assistant version to use for this call. Supported only with
+ * direct `assistantId`. Omit to follow the latest version.
+ *
+ * @var ?string $assistantVersion
+ */
+ #[JsonProperty('assistantVersion')]
+ public ?string $assistantVersion;
+
+ /**
+ * @var ?CreateCallDtoTransport $transport This is the transport of the call.
+ */
+ #[JsonProperty('transport')]
+ public ?CreateCallDtoTransport $transport;
+
/**
* This is used to issue batch calls to multiple customers.
*
@@ -38,12 +54,6 @@ class CreateCallDto extends JsonSerializableType
#[JsonProperty('schedulePlan')]
public ?SchedulePlan $schedulePlan;
- /**
- * @var ?array $transport This is the transport of the call.
- */
- #[JsonProperty('transport'), ArrayType(['string' => 'mixed'])]
- public ?array $transport;
-
/**
* This is the assistant ID that will be used for the call. To use a transient assistant, use `assistant` instead.
*
@@ -185,10 +195,11 @@ class CreateCallDto extends JsonSerializableType
/**
* @param array{
+ * assistantVersion?: ?string,
+ * transport?: ?CreateCallDtoTransport,
* customers?: ?array,
* name?: ?string,
* schedulePlan?: ?SchedulePlan,
- * transport?: ?array,
* assistantId?: ?string,
* assistant?: ?CreateAssistantDto,
* assistantOverrides?: ?AssistantOverrides,
@@ -207,10 +218,11 @@ class CreateCallDto extends JsonSerializableType
public function __construct(
array $values = [],
) {
+ $this->assistantVersion = $values['assistantVersion'] ?? null;
+ $this->transport = $values['transport'] ?? null;
$this->customers = $values['customers'] ?? null;
$this->name = $values['name'] ?? null;
$this->schedulePlan = $values['schedulePlan'] ?? null;
- $this->transport = $values['transport'] ?? null;
$this->assistantId = $values['assistantId'] ?? null;
$this->assistant = $values['assistant'] ?? null;
$this->assistantOverrides = $values['assistantOverrides'] ?? null;
diff --git a/src/Calls/Types/CreateCallDtoTransport.php b/src/Calls/Types/CreateCallDtoTransport.php
new file mode 100644
index 0000000..0f0149f
--- /dev/null
+++ b/src/Calls/Types/CreateCallDtoTransport.php
@@ -0,0 +1,398 @@
+provider = $values['provider'];
+ $this->value = $values['value'];
+ }
+
+ /**
+ * @param VapiWebsocketTransport $vapiWebsocket
+ * @return CreateCallDtoTransport
+ */
+ public static function vapiWebsocket(VapiWebsocketTransport $vapiWebsocket): CreateCallDtoTransport
+ {
+ return new CreateCallDtoTransport([
+ 'provider' => 'vapi.websocket',
+ 'value' => $vapiWebsocket,
+ ]);
+ }
+
+ /**
+ * @param VonageTransport $vonage
+ * @return CreateCallDtoTransport
+ */
+ public static function vonage(VonageTransport $vonage): CreateCallDtoTransport
+ {
+ return new CreateCallDtoTransport([
+ 'provider' => 'vonage',
+ 'value' => $vonage,
+ ]);
+ }
+
+ /**
+ * @param TwilioTransport $twilio
+ * @return CreateCallDtoTransport
+ */
+ public static function twilio(TwilioTransport $twilio): CreateCallDtoTransport
+ {
+ return new CreateCallDtoTransport([
+ 'provider' => 'twilio',
+ 'value' => $twilio,
+ ]);
+ }
+
+ /**
+ * @param VapiSipTransport $vapiSip
+ * @return CreateCallDtoTransport
+ */
+ public static function vapiSip(VapiSipTransport $vapiSip): CreateCallDtoTransport
+ {
+ return new CreateCallDtoTransport([
+ 'provider' => 'vapi.sip',
+ 'value' => $vapiSip,
+ ]);
+ }
+
+ /**
+ * @param TelnyxTransport $telnyx
+ * @return CreateCallDtoTransport
+ */
+ public static function telnyx(TelnyxTransport $telnyx): CreateCallDtoTransport
+ {
+ return new CreateCallDtoTransport([
+ 'provider' => 'telnyx',
+ 'value' => $telnyx,
+ ]);
+ }
+
+ /**
+ * @param VapiWebCallTransport $daily
+ * @return CreateCallDtoTransport
+ */
+ public static function daily(VapiWebCallTransport $daily): CreateCallDtoTransport
+ {
+ return new CreateCallDtoTransport([
+ 'provider' => 'daily',
+ 'value' => $daily,
+ ]);
+ }
+
+ /**
+ * @return bool
+ */
+ public function isVapiWebsocket(): bool
+ {
+ return $this->value instanceof VapiWebsocketTransport && $this->provider === 'vapi.websocket';
+ }
+
+ /**
+ * @return VapiWebsocketTransport
+ */
+ public function asVapiWebsocket(): VapiWebsocketTransport
+ {
+ if (!($this->value instanceof VapiWebsocketTransport && $this->provider === 'vapi.websocket')) {
+ throw new Exception(
+ "Expected vapi.websocket; got " . $this->provider . " with value of type " . get_debug_type($this->value),
+ );
+ }
+
+ return $this->value;
+ }
+
+ /**
+ * @return bool
+ */
+ public function isVonage(): bool
+ {
+ return $this->value instanceof VonageTransport && $this->provider === 'vonage';
+ }
+
+ /**
+ * @return VonageTransport
+ */
+ public function asVonage(): VonageTransport
+ {
+ if (!($this->value instanceof VonageTransport && $this->provider === 'vonage')) {
+ throw new Exception(
+ "Expected vonage; got " . $this->provider . " with value of type " . get_debug_type($this->value),
+ );
+ }
+
+ return $this->value;
+ }
+
+ /**
+ * @return bool
+ */
+ public function isTwilio(): bool
+ {
+ return $this->value instanceof TwilioTransport && $this->provider === 'twilio';
+ }
+
+ /**
+ * @return TwilioTransport
+ */
+ public function asTwilio(): TwilioTransport
+ {
+ if (!($this->value instanceof TwilioTransport && $this->provider === 'twilio')) {
+ throw new Exception(
+ "Expected twilio; got " . $this->provider . " with value of type " . get_debug_type($this->value),
+ );
+ }
+
+ return $this->value;
+ }
+
+ /**
+ * @return bool
+ */
+ public function isVapiSip(): bool
+ {
+ return $this->value instanceof VapiSipTransport && $this->provider === 'vapi.sip';
+ }
+
+ /**
+ * @return VapiSipTransport
+ */
+ public function asVapiSip(): VapiSipTransport
+ {
+ if (!($this->value instanceof VapiSipTransport && $this->provider === 'vapi.sip')) {
+ throw new Exception(
+ "Expected vapi.sip; got " . $this->provider . " with value of type " . get_debug_type($this->value),
+ );
+ }
+
+ return $this->value;
+ }
+
+ /**
+ * @return bool
+ */
+ public function isTelnyx(): bool
+ {
+ return $this->value instanceof TelnyxTransport && $this->provider === 'telnyx';
+ }
+
+ /**
+ * @return TelnyxTransport
+ */
+ public function asTelnyx(): TelnyxTransport
+ {
+ if (!($this->value instanceof TelnyxTransport && $this->provider === 'telnyx')) {
+ throw new Exception(
+ "Expected telnyx; got " . $this->provider . " with value of type " . get_debug_type($this->value),
+ );
+ }
+
+ return $this->value;
+ }
+
+ /**
+ * @return bool
+ */
+ public function isDaily(): bool
+ {
+ return $this->value instanceof VapiWebCallTransport && $this->provider === 'daily';
+ }
+
+ /**
+ * @return VapiWebCallTransport
+ */
+ public function asDaily(): VapiWebCallTransport
+ {
+ if (!($this->value instanceof VapiWebCallTransport && $this->provider === 'daily')) {
+ throw new Exception(
+ "Expected daily; got " . $this->provider . " with value of type " . get_debug_type($this->value),
+ );
+ }
+
+ return $this->value;
+ }
+
+ /**
+ * @return string
+ */
+ public function __toString(): string
+ {
+ return $this->toJson();
+ }
+
+ /**
+ * @return array
+ */
+ public function jsonSerialize(): array
+ {
+ $result = [];
+ $result['provider'] = $this->provider;
+
+ $base = parent::jsonSerialize();
+ $result = array_merge($base, $result);
+
+ switch ($this->provider) {
+ case 'vapi.websocket':
+ $value = $this->asVapiWebsocket()->jsonSerialize();
+ $result = array_merge($value, $result);
+ break;
+ case 'vonage':
+ $value = $this->asVonage()->jsonSerialize();
+ $result = array_merge($value, $result);
+ break;
+ case 'twilio':
+ $value = $this->asTwilio()->jsonSerialize();
+ $result = array_merge($value, $result);
+ break;
+ case 'vapi.sip':
+ $value = $this->asVapiSip()->jsonSerialize();
+ $result = array_merge($value, $result);
+ break;
+ case 'telnyx':
+ $value = $this->asTelnyx()->jsonSerialize();
+ $result = array_merge($value, $result);
+ break;
+ case 'daily':
+ $value = $this->asDaily()->jsonSerialize();
+ $result = array_merge($value, $result);
+ break;
+ case '_unknown':
+ default:
+ if (is_null($this->value)) {
+ break;
+ }
+ if ($this->value instanceof JsonSerializableType) {
+ $value = $this->value->jsonSerialize();
+ $result = array_merge($value, $result);
+ } elseif (is_array($this->value)) {
+ $result = array_merge($this->value, $result);
+ }
+ }
+
+ return $result;
+ }
+
+ /**
+ * @param string $json
+ */
+ public static function fromJson(string $json): static
+ {
+ $decodedJson = JsonDecoder::decode($json);
+ if (!is_array($decodedJson)) {
+ throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson));
+ }
+ return self::jsonDeserialize($decodedJson);
+ }
+
+ /**
+ * @param array $data
+ */
+ public static function jsonDeserialize(array $data): static
+ {
+ $args = [];
+ if (!array_key_exists('provider', $data)) {
+ throw new Exception(
+ "JSON data is missing property 'provider'",
+ );
+ }
+ $provider = $data['provider'];
+ if (!(is_string($provider))) {
+ throw new Exception(
+ "Expected property 'provider' in JSON data to be string, instead received " . get_debug_type($data['provider']),
+ );
+ }
+
+ $args['provider'] = $provider;
+ switch ($provider) {
+ case 'vapi.websocket':
+ $args['value'] = VapiWebsocketTransport::jsonDeserialize($data);
+ break;
+ case 'vonage':
+ $args['value'] = VonageTransport::jsonDeserialize($data);
+ break;
+ case 'twilio':
+ $args['value'] = TwilioTransport::jsonDeserialize($data);
+ break;
+ case 'vapi.sip':
+ $args['value'] = VapiSipTransport::jsonDeserialize($data);
+ break;
+ case 'telnyx':
+ $args['value'] = TelnyxTransport::jsonDeserialize($data);
+ break;
+ case 'daily':
+ $args['value'] = VapiWebCallTransport::jsonDeserialize($data);
+ break;
+ case '_unknown':
+ default:
+ $args['provider'] = '_unknown';
+ $args['value'] = $data;
+ }
+
+ // @phpstan-ignore-next-line
+ return new static($args);
+ }
+}
diff --git a/src/Campaigns/CampaignsClient.php b/src/Campaigns/CampaignsClient.php
index c0230ab..5352137 100644
--- a/src/Campaigns/CampaignsClient.php
+++ b/src/Campaigns/CampaignsClient.php
@@ -14,9 +14,16 @@
use Vapi\Core\Client\HttpMethod;
use JsonException;
use Psr\Http\Client\ClientExceptionInterface;
-use Vapi\Campaigns\Requests\CreateCampaignDto;
+use Vapi\Types\CreateCampaignDto;
use Vapi\Types\Campaign;
-use Vapi\Campaigns\Requests\UpdateCampaignDto;
+use Vapi\Campaigns\Requests\CampaignControllerFindAllV2Request;
+use Vapi\Types\CampaignSummaryPaginatedResponse;
+use Vapi\Campaigns\Requests\CampaignControllerFindOneV2Request;
+use Vapi\Types\CampaignSummary;
+use Vapi\Campaigns\Requests\CampaignControllerUpdateV2Request;
+use Vapi\Campaigns\Requests\CampaignControllerUpdateRequest;
+use Vapi\Campaigns\Requests\CampaignControllerGetCampaignV2ContactsRequest;
+use Vapi\Types\CampaignContactPaginatedResponse;
class CampaignsClient
{
@@ -55,6 +62,8 @@ public function __construct(
}
/**
+ * Returns outbound calling campaigns for the authenticated organization. Filter results by campaign ID, status, or creation and update timestamps.
+ *
* @param CampaignControllerFindAllRequest $request
* @param ?array{
* baseUrl?: string,
@@ -84,6 +93,9 @@ public function campaignControllerFindAll(CampaignControllerFindAllRequest $requ
if ($request->sortOrder != null) {
$query['sortOrder'] = $request->sortOrder;
}
+ if ($request->sortBy != null) {
+ $query['sortBy'] = $request->sortBy;
+ }
if ($request->limit != null) {
$query['limit'] = $request->limit;
}
@@ -142,6 +154,8 @@ public function campaignControllerFindAll(CampaignControllerFindAllRequest $requ
}
/**
+ * Creates an outbound calling campaign that calls a set of customers.
+ *
* @param CreateCampaignDto $request
* @param ?array{
* baseUrl?: string,
@@ -189,7 +203,295 @@ public function campaignControllerCreate(CreateCampaignDto $request, ?array $opt
}
/**
- * @param string $id
+ * @param CampaignControllerFindAllV2Request $request
+ * @param ?array{
+ * baseUrl?: string,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * queryParameters?: array,
+ * bodyProperties?: array,
+ * } $options
+ * @return ?CampaignSummaryPaginatedResponse
+ * @throws VapiException
+ * @throws VapiApiException
+ */
+ public function campaignControllerFindAllV2(CampaignControllerFindAllV2Request $request = new CampaignControllerFindAllV2Request(), ?array $options = null): ?CampaignSummaryPaginatedResponse
+ {
+ $options = array_merge($this->options, $options ?? []);
+ $query = [];
+ if ($request->id != null) {
+ $query['id'] = $request->id;
+ }
+ if ($request->status != null) {
+ $query['status'] = $request->status;
+ }
+ if ($request->includeCounters != null) {
+ $query['includeCounters'] = $request->includeCounters;
+ }
+ if ($request->page != null) {
+ $query['page'] = $request->page;
+ }
+ if ($request->sortOrder != null) {
+ $query['sortOrder'] = $request->sortOrder;
+ }
+ if ($request->sortBy != null) {
+ $query['sortBy'] = $request->sortBy;
+ }
+ if ($request->limit != null) {
+ $query['limit'] = $request->limit;
+ }
+ if ($request->createdAtGt != null) {
+ $query['createdAtGt'] = JsonSerializer::serializeDateTime($request->createdAtGt);
+ }
+ if ($request->createdAtLt != null) {
+ $query['createdAtLt'] = JsonSerializer::serializeDateTime($request->createdAtLt);
+ }
+ if ($request->createdAtGe != null) {
+ $query['createdAtGe'] = JsonSerializer::serializeDateTime($request->createdAtGe);
+ }
+ if ($request->createdAtLe != null) {
+ $query['createdAtLe'] = JsonSerializer::serializeDateTime($request->createdAtLe);
+ }
+ if ($request->updatedAtGt != null) {
+ $query['updatedAtGt'] = JsonSerializer::serializeDateTime($request->updatedAtGt);
+ }
+ if ($request->updatedAtLt != null) {
+ $query['updatedAtLt'] = JsonSerializer::serializeDateTime($request->updatedAtLt);
+ }
+ if ($request->updatedAtGe != null) {
+ $query['updatedAtGe'] = JsonSerializer::serializeDateTime($request->updatedAtGe);
+ }
+ if ($request->updatedAtLe != null) {
+ $query['updatedAtLe'] = JsonSerializer::serializeDateTime($request->updatedAtLe);
+ }
+ try {
+ $response = $this->client->sendRequest(
+ new JsonApiRequest(
+ baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value,
+ path: "v2/campaign",
+ method: HttpMethod::GET,
+ query: $query,
+ ),
+ $options,
+ );
+ $statusCode = $response->getStatusCode();
+ if ($statusCode >= 200 && $statusCode < 400) {
+ $json = $response->getBody()->getContents();
+ if (empty($json)) {
+ return null;
+ }
+ return CampaignSummaryPaginatedResponse::fromJson($json);
+ }
+ } catch (JsonException $e) {
+ throw new VapiException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e);
+ } catch (ClientExceptionInterface $e) {
+ throw new VapiException(message: $e->getMessage(), previous: $e);
+ }
+ throw new VapiApiException(
+ message: 'API request failed',
+ statusCode: $statusCode,
+ body: $response->getBody()->getContents(),
+ );
+ }
+
+ /**
+ * @param CreateCampaignDto $request
+ * @param ?array{
+ * baseUrl?: string,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * queryParameters?: array,
+ * bodyProperties?: array,
+ * } $options
+ * @return ?Campaign
+ * @throws VapiException
+ * @throws VapiApiException
+ */
+ public function campaignControllerCreateV2(CreateCampaignDto $request, ?array $options = null): ?Campaign
+ {
+ $options = array_merge($this->options, $options ?? []);
+ try {
+ $response = $this->client->sendRequest(
+ new JsonApiRequest(
+ baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value,
+ path: "v2/campaign",
+ method: HttpMethod::POST,
+ body: $request,
+ ),
+ $options,
+ );
+ $statusCode = $response->getStatusCode();
+ if ($statusCode >= 200 && $statusCode < 400) {
+ $json = $response->getBody()->getContents();
+ if (empty($json)) {
+ return null;
+ }
+ return Campaign::fromJson($json);
+ }
+ } catch (JsonException $e) {
+ throw new VapiException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e);
+ } catch (ClientExceptionInterface $e) {
+ throw new VapiException(message: $e->getMessage(), previous: $e);
+ }
+ throw new VapiApiException(
+ message: 'API request failed',
+ statusCode: $statusCode,
+ body: $response->getBody()->getContents(),
+ );
+ }
+
+ /**
+ * @param string $id The unique identifier for the resource.
+ * @param CampaignControllerFindOneV2Request $request
+ * @param ?array{
+ * baseUrl?: string,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * queryParameters?: array,
+ * bodyProperties?: array,
+ * } $options
+ * @return ?CampaignSummary
+ * @throws VapiException
+ * @throws VapiApiException
+ */
+ public function campaignControllerFindOneV2(string $id, CampaignControllerFindOneV2Request $request = new CampaignControllerFindOneV2Request(), ?array $options = null): ?CampaignSummary
+ {
+ $options = array_merge($this->options, $options ?? []);
+ $query = [];
+ if ($request->includeCounters != null) {
+ $query['includeCounters'] = $request->includeCounters;
+ }
+ try {
+ $response = $this->client->sendRequest(
+ new JsonApiRequest(
+ baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value,
+ path: "v2/campaign/{$id}",
+ method: HttpMethod::GET,
+ query: $query,
+ ),
+ $options,
+ );
+ $statusCode = $response->getStatusCode();
+ if ($statusCode >= 200 && $statusCode < 400) {
+ $json = $response->getBody()->getContents();
+ if (empty($json)) {
+ return null;
+ }
+ return CampaignSummary::fromJson($json);
+ }
+ } catch (JsonException $e) {
+ throw new VapiException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e);
+ } catch (ClientExceptionInterface $e) {
+ throw new VapiException(message: $e->getMessage(), previous: $e);
+ }
+ throw new VapiApiException(
+ message: 'API request failed',
+ statusCode: $statusCode,
+ body: $response->getBody()->getContents(),
+ );
+ }
+
+ /**
+ * @param string $id The unique identifier for the resource.
+ * @param ?array{
+ * baseUrl?: string,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * queryParameters?: array,
+ * bodyProperties?: array,
+ * } $options
+ * @return ?Campaign
+ * @throws VapiException
+ * @throws VapiApiException
+ */
+ public function campaignControllerRemoveV2(string $id, ?array $options = null): ?Campaign
+ {
+ $options = array_merge($this->options, $options ?? []);
+ try {
+ $response = $this->client->sendRequest(
+ new JsonApiRequest(
+ baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value,
+ path: "v2/campaign/{$id}",
+ method: HttpMethod::DELETE,
+ ),
+ $options,
+ );
+ $statusCode = $response->getStatusCode();
+ if ($statusCode >= 200 && $statusCode < 400) {
+ $json = $response->getBody()->getContents();
+ if (empty($json)) {
+ return null;
+ }
+ return Campaign::fromJson($json);
+ }
+ } catch (JsonException $e) {
+ throw new VapiException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e);
+ } catch (ClientExceptionInterface $e) {
+ throw new VapiException(message: $e->getMessage(), previous: $e);
+ }
+ throw new VapiApiException(
+ message: 'API request failed',
+ statusCode: $statusCode,
+ body: $response->getBody()->getContents(),
+ );
+ }
+
+ /**
+ * @param string $id The unique identifier for the resource.
+ * @param CampaignControllerUpdateV2Request $request
+ * @param ?array{
+ * baseUrl?: string,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * queryParameters?: array,
+ * bodyProperties?: array,
+ * } $options
+ * @return ?Campaign
+ * @throws VapiException
+ * @throws VapiApiException
+ */
+ public function campaignControllerUpdateV2(string $id, CampaignControllerUpdateV2Request $request, ?array $options = null): ?Campaign
+ {
+ $options = array_merge($this->options, $options ?? []);
+ try {
+ $response = $this->client->sendRequest(
+ new JsonApiRequest(
+ baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value,
+ path: "v2/campaign/{$id}",
+ method: HttpMethod::PATCH,
+ body: $request->body,
+ ),
+ $options,
+ );
+ $statusCode = $response->getStatusCode();
+ if ($statusCode >= 200 && $statusCode < 400) {
+ $json = $response->getBody()->getContents();
+ if (empty($json)) {
+ return null;
+ }
+ return Campaign::fromJson($json);
+ }
+ } catch (JsonException $e) {
+ throw new VapiException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e);
+ } catch (ClientExceptionInterface $e) {
+ throw new VapiException(message: $e->getMessage(), previous: $e);
+ }
+ throw new VapiApiException(
+ message: 'API request failed',
+ statusCode: $statusCode,
+ body: $response->getBody()->getContents(),
+ );
+ }
+
+ /**
+ * Returns the outbound calling campaign identified by its ID.
+ *
+ * @param string $id The unique identifier of the campaign.
* @param ?array{
* baseUrl?: string,
* maxRetries?: int,
@@ -235,7 +537,9 @@ public function campaignControllerFindOne(string $id, ?array $options = null): ?
}
/**
- * @param string $id
+ * Deletes the outbound calling campaign identified by its ID.
+ *
+ * @param string $id The unique identifier of the campaign.
* @param ?array{
* baseUrl?: string,
* maxRetries?: int,
@@ -281,8 +585,10 @@ public function campaignControllerRemove(string $id, ?array $options = null): ?C
}
/**
- * @param string $id
- * @param UpdateCampaignDto $request
+ * Updates the outbound calling campaign identified by its ID. Campaigns can be ended by updating their status to `ended`.
+ *
+ * @param string $id The unique identifier of the campaign.
+ * @param CampaignControllerUpdateRequest $request
* @param ?array{
* baseUrl?: string,
* maxRetries?: int,
@@ -295,7 +601,7 @@ public function campaignControllerRemove(string $id, ?array $options = null): ?C
* @throws VapiException
* @throws VapiApiException
*/
- public function campaignControllerUpdate(string $id, UpdateCampaignDto $request = new UpdateCampaignDto(), ?array $options = null): ?Campaign
+ public function campaignControllerUpdate(string $id, CampaignControllerUpdateRequest $request, ?array $options = null): ?Campaign
{
$options = array_merge($this->options, $options ?? []);
try {
@@ -304,7 +610,7 @@ public function campaignControllerUpdate(string $id, UpdateCampaignDto $request
baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value,
path: "campaign/{$id}",
method: HttpMethod::PATCH,
- body: $request,
+ body: $request->body,
),
$options,
);
@@ -327,4 +633,65 @@ public function campaignControllerUpdate(string $id, UpdateCampaignDto $request
body: $response->getBody()->getContents(),
);
}
+
+ /**
+ * @param string $id The unique identifier for the resource.
+ * @param CampaignControllerGetCampaignV2ContactsRequest $request
+ * @param ?array{
+ * baseUrl?: string,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * queryParameters?: array,
+ * bodyProperties?: array,
+ * } $options
+ * @return ?CampaignContactPaginatedResponse
+ * @throws VapiException
+ * @throws VapiApiException
+ */
+ public function campaignControllerGetCampaignV2Contacts(string $id, CampaignControllerGetCampaignV2ContactsRequest $request = new CampaignControllerGetCampaignV2ContactsRequest(), ?array $options = null): ?CampaignContactPaginatedResponse
+ {
+ $options = array_merge($this->options, $options ?? []);
+ $query = [];
+ if ($request->status != null) {
+ $query['status'] = $request->status;
+ }
+ if ($request->limit != null) {
+ $query['limit'] = $request->limit;
+ }
+ if ($request->sortBy != null) {
+ $query['sortBy'] = $request->sortBy;
+ }
+ if ($request->page != null) {
+ $query['page'] = $request->page;
+ }
+ try {
+ $response = $this->client->sendRequest(
+ new JsonApiRequest(
+ baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value,
+ path: "v2/campaign/{$id}/contacts",
+ method: HttpMethod::GET,
+ query: $query,
+ ),
+ $options,
+ );
+ $statusCode = $response->getStatusCode();
+ if ($statusCode >= 200 && $statusCode < 400) {
+ $json = $response->getBody()->getContents();
+ if (empty($json)) {
+ return null;
+ }
+ return CampaignContactPaginatedResponse::fromJson($json);
+ }
+ } catch (JsonException $e) {
+ throw new VapiException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e);
+ } catch (ClientExceptionInterface $e) {
+ throw new VapiException(message: $e->getMessage(), previous: $e);
+ }
+ throw new VapiApiException(
+ message: 'API request failed',
+ statusCode: $statusCode,
+ body: $response->getBody()->getContents(),
+ );
+ }
}
diff --git a/src/Campaigns/Requests/CampaignControllerFindAllRequest.php b/src/Campaigns/Requests/CampaignControllerFindAllRequest.php
index d84d054..b0ea991 100644
--- a/src/Campaigns/Requests/CampaignControllerFindAllRequest.php
+++ b/src/Campaigns/Requests/CampaignControllerFindAllRequest.php
@@ -5,17 +5,18 @@
use Vapi\Core\Json\JsonSerializableType;
use Vapi\Campaigns\Types\CampaignControllerFindAllRequestStatus;
use Vapi\Campaigns\Types\CampaignControllerFindAllRequestSortOrder;
+use Vapi\Campaigns\Types\CampaignControllerFindAllRequestSortBy;
use DateTime;
class CampaignControllerFindAllRequest extends JsonSerializableType
{
/**
- * @var ?string $id
+ * @var ?string $id Filters campaigns by ID.
*/
public ?string $id;
/**
- * @var ?value-of $status
+ * @var ?value-of $status Filters campaigns by status.
*/
public ?string $status;
@@ -29,6 +30,11 @@ class CampaignControllerFindAllRequest extends JsonSerializableType
*/
public ?string $sortOrder;
+ /**
+ * @var ?value-of $sortBy This is the column to sort by. Defaults to 'createdAt'.
+ */
+ public ?string $sortBy;
+
/**
* @var ?float $limit This is the maximum number of items to return. Defaults to 100.
*/
@@ -80,6 +86,7 @@ class CampaignControllerFindAllRequest extends JsonSerializableType
* status?: ?value-of,
* page?: ?float,
* sortOrder?: ?value-of,
+ * sortBy?: ?value-of,
* limit?: ?float,
* createdAtGt?: ?DateTime,
* createdAtLt?: ?DateTime,
@@ -98,6 +105,7 @@ public function __construct(
$this->status = $values['status'] ?? null;
$this->page = $values['page'] ?? null;
$this->sortOrder = $values['sortOrder'] ?? null;
+ $this->sortBy = $values['sortBy'] ?? null;
$this->limit = $values['limit'] ?? null;
$this->createdAtGt = $values['createdAtGt'] ?? null;
$this->createdAtLt = $values['createdAtLt'] ?? null;
diff --git a/src/Campaigns/Requests/CampaignControllerFindAllV2Request.php b/src/Campaigns/Requests/CampaignControllerFindAllV2Request.php
new file mode 100644
index 0000000..60990eb
--- /dev/null
+++ b/src/Campaigns/Requests/CampaignControllerFindAllV2Request.php
@@ -0,0 +1,132 @@
+ $status
+ */
+ public ?string $status;
+
+ /**
+ * When true, every campaign in the response includes `contactCounters` and
+ * `callMetrics`. These are aggregate queries over contacts and events —
+ * batched across the page, so the cost is three queries per request rather
+ * than three per campaign, but still opt-in rather than paid for on every
+ * read. Defaults to false.
+ *
+ * @var ?bool $includeCounters
+ */
+ public ?bool $includeCounters;
+
+ /**
+ * @var ?float $page This is the page number to return. Defaults to 1.
+ */
+ public ?float $page;
+
+ /**
+ * @var ?value-of $sortOrder This is the sort order for pagination. Defaults to 'DESC'.
+ */
+ public ?string $sortOrder;
+
+ /**
+ * @var ?value-of $sortBy This is the column to sort by. Defaults to 'createdAt'.
+ */
+ public ?string $sortBy;
+
+ /**
+ * @var ?float $limit This is the maximum number of items to return. Defaults to 100.
+ */
+ public ?float $limit;
+
+ /**
+ * @var ?DateTime $createdAtGt This will return items where the createdAt is greater than the specified value.
+ */
+ public ?DateTime $createdAtGt;
+
+ /**
+ * @var ?DateTime $createdAtLt This will return items where the createdAt is less than the specified value.
+ */
+ public ?DateTime $createdAtLt;
+
+ /**
+ * @var ?DateTime $createdAtGe This will return items where the createdAt is greater than or equal to the specified value.
+ */
+ public ?DateTime $createdAtGe;
+
+ /**
+ * @var ?DateTime $createdAtLe This will return items where the createdAt is less than or equal to the specified value.
+ */
+ public ?DateTime $createdAtLe;
+
+ /**
+ * @var ?DateTime $updatedAtGt This will return items where the updatedAt is greater than the specified value.
+ */
+ public ?DateTime $updatedAtGt;
+
+ /**
+ * @var ?DateTime $updatedAtLt This will return items where the updatedAt is less than the specified value.
+ */
+ public ?DateTime $updatedAtLt;
+
+ /**
+ * @var ?DateTime $updatedAtGe This will return items where the updatedAt is greater than or equal to the specified value.
+ */
+ public ?DateTime $updatedAtGe;
+
+ /**
+ * @var ?DateTime $updatedAtLe This will return items where the updatedAt is less than or equal to the specified value.
+ */
+ public ?DateTime $updatedAtLe;
+
+ /**
+ * @param array{
+ * id?: ?string,
+ * status?: ?value-of,
+ * includeCounters?: ?bool,
+ * page?: ?float,
+ * sortOrder?: ?value-of,
+ * sortBy?: ?value-of,
+ * limit?: ?float,
+ * createdAtGt?: ?DateTime,
+ * createdAtLt?: ?DateTime,
+ * createdAtGe?: ?DateTime,
+ * createdAtLe?: ?DateTime,
+ * updatedAtGt?: ?DateTime,
+ * updatedAtLt?: ?DateTime,
+ * updatedAtGe?: ?DateTime,
+ * updatedAtLe?: ?DateTime,
+ * } $values
+ */
+ public function __construct(
+ array $values = [],
+ ) {
+ $this->id = $values['id'] ?? null;
+ $this->status = $values['status'] ?? null;
+ $this->includeCounters = $values['includeCounters'] ?? null;
+ $this->page = $values['page'] ?? null;
+ $this->sortOrder = $values['sortOrder'] ?? null;
+ $this->sortBy = $values['sortBy'] ?? null;
+ $this->limit = $values['limit'] ?? null;
+ $this->createdAtGt = $values['createdAtGt'] ?? null;
+ $this->createdAtLt = $values['createdAtLt'] ?? null;
+ $this->createdAtGe = $values['createdAtGe'] ?? null;
+ $this->createdAtLe = $values['createdAtLe'] ?? null;
+ $this->updatedAtGt = $values['updatedAtGt'] ?? null;
+ $this->updatedAtLt = $values['updatedAtLt'] ?? null;
+ $this->updatedAtGe = $values['updatedAtGe'] ?? null;
+ $this->updatedAtLe = $values['updatedAtLe'] ?? null;
+ }
+}
diff --git a/src/Campaigns/Requests/CampaignControllerFindOneV2Request.php b/src/Campaigns/Requests/CampaignControllerFindOneV2Request.php
new file mode 100644
index 0000000..b539878
--- /dev/null
+++ b/src/Campaigns/Requests/CampaignControllerFindOneV2Request.php
@@ -0,0 +1,28 @@
+includeCounters = $values['includeCounters'] ?? null;
+ }
+}
diff --git a/src/Campaigns/Requests/CampaignControllerGetCampaignV2ContactsRequest.php b/src/Campaigns/Requests/CampaignControllerGetCampaignV2ContactsRequest.php
new file mode 100644
index 0000000..2ee0823
--- /dev/null
+++ b/src/Campaigns/Requests/CampaignControllerGetCampaignV2ContactsRequest.php
@@ -0,0 +1,61 @@
+> $status
+ */
+ public ?array $status;
+
+ /**
+ * @var ?float $limit This is the maximum number of contacts to return. Defaults to 50.
+ */
+ public ?float $limit;
+
+ /**
+ * This is the column to sort by. Defaults to `position` — the order contacts
+ * were uploaded, which is also dial order.
+ *
+ * `status` sorts by the enum's declaration order rather than alphabetically,
+ * which means it reads as a lifecycle: pending, dispatched, completed,
+ * failed, skipped, predial-failed.
+ *
+ * Only columns on `campaign_contact` are sortable. Call-level values such as
+ * cost or duration live on the call and are attached after this query, so
+ * sorting by them here would only reorder the current page.
+ *
+ * @var ?value-of $sortBy
+ */
+ public ?string $sortBy;
+
+ /**
+ * @var ?float $page This is the page number to return. Defaults to 1.
+ */
+ public ?float $page;
+
+ /**
+ * @param array{
+ * status?: ?array>,
+ * limit?: ?float,
+ * sortBy?: ?value-of,
+ * page?: ?float,
+ * } $values
+ */
+ public function __construct(
+ array $values = [],
+ ) {
+ $this->status = $values['status'] ?? null;
+ $this->limit = $values['limit'] ?? null;
+ $this->sortBy = $values['sortBy'] ?? null;
+ $this->page = $values['page'] ?? null;
+ }
+}
diff --git a/src/Campaigns/Requests/CampaignControllerUpdateRequest.php b/src/Campaigns/Requests/CampaignControllerUpdateRequest.php
new file mode 100644
index 0000000..5ee80ae
--- /dev/null
+++ b/src/Campaigns/Requests/CampaignControllerUpdateRequest.php
@@ -0,0 +1,25 @@
+body = $values['body'];
+ }
+}
diff --git a/src/Campaigns/Requests/CampaignControllerUpdateV2Request.php b/src/Campaigns/Requests/CampaignControllerUpdateV2Request.php
new file mode 100644
index 0000000..7d7fdfd
--- /dev/null
+++ b/src/Campaigns/Requests/CampaignControllerUpdateV2Request.php
@@ -0,0 +1,25 @@
+body = $values['body'];
+ }
+}
diff --git a/src/Campaigns/Types/CampaignControllerFindAllRequestSortBy.php b/src/Campaigns/Types/CampaignControllerFindAllRequestSortBy.php
new file mode 100644
index 0000000..6d7e6dd
--- /dev/null
+++ b/src/Campaigns/Types/CampaignControllerFindAllRequestSortBy.php
@@ -0,0 +1,10 @@
+previousChatId != null) {
$query['previousChatId'] = $request->previousChatId;
}
+ if ($request->idAny != null) {
+ $query['idAny'] = $request->idAny;
+ }
if ($request->page != null) {
$query['page'] = $request->page;
}
if ($request->sortOrder != null) {
$query['sortOrder'] = $request->sortOrder;
}
+ if ($request->sortBy != null) {
+ $query['sortBy'] = $request->sortBy;
+ }
if ($request->limit != null) {
$query['limit'] = $request->limit;
}
diff --git a/src/Chats/Requests/ListChatsRequest.php b/src/Chats/Requests/ListChatsRequest.php
index b74aa7d..922ccdf 100644
--- a/src/Chats/Requests/ListChatsRequest.php
+++ b/src/Chats/Requests/ListChatsRequest.php
@@ -4,6 +4,7 @@
use Vapi\Core\Json\JsonSerializableType;
use Vapi\Chats\Types\ListChatsRequestSortOrder;
+use Vapi\Chats\Types\ListChatsRequestSortBy;
use DateTime;
class ListChatsRequest extends JsonSerializableType
@@ -38,6 +39,11 @@ class ListChatsRequest extends JsonSerializableType
*/
public ?string $previousChatId;
+ /**
+ * @var ?string $idAny Filter by multiple chat IDs. Provide as comma-separated values.
+ */
+ public ?string $idAny;
+
/**
* @var ?float $page This is the page number to return. Defaults to 1.
*/
@@ -48,6 +54,11 @@ class ListChatsRequest extends JsonSerializableType
*/
public ?string $sortOrder;
+ /**
+ * @var ?value-of $sortBy This is the column to sort by. Defaults to 'createdAt'.
+ */
+ public ?string $sortBy;
+
/**
* @var ?float $limit This is the maximum number of items to return. Defaults to 100.
*/
@@ -101,8 +112,10 @@ class ListChatsRequest extends JsonSerializableType
* squadId?: ?string,
* sessionId?: ?string,
* previousChatId?: ?string,
+ * idAny?: ?string,
* page?: ?float,
* sortOrder?: ?value-of,
+ * sortBy?: ?value-of,
* limit?: ?float,
* createdAtGt?: ?DateTime,
* createdAtLt?: ?DateTime,
@@ -123,8 +136,10 @@ public function __construct(
$this->squadId = $values['squadId'] ?? null;
$this->sessionId = $values['sessionId'] ?? null;
$this->previousChatId = $values['previousChatId'] ?? null;
+ $this->idAny = $values['idAny'] ?? null;
$this->page = $values['page'] ?? null;
$this->sortOrder = $values['sortOrder'] ?? null;
+ $this->sortBy = $values['sortBy'] ?? null;
$this->limit = $values['limit'] ?? null;
$this->createdAtGt = $values['createdAtGt'] ?? null;
$this->createdAtLt = $values['createdAtLt'] ?? null;
diff --git a/src/Chats/Types/ListChatsRequestSortBy.php b/src/Chats/Types/ListChatsRequestSortBy.php
new file mode 100644
index 0000000..d7bc4aa
--- /dev/null
+++ b/src/Chats/Types/ListChatsRequestSortBy.php
@@ -0,0 +1,10 @@
+sortOrder != null) {
$query['sortOrder'] = $request->sortOrder;
}
+ if ($request->sortBy != null) {
+ $query['sortBy'] = $request->sortBy;
+ }
if ($request->limit != null) {
$query['limit'] = $request->limit;
}
@@ -144,6 +149,8 @@ public function evalControllerGetPaginated(EvalControllerGetPaginatedRequest $re
}
/**
+ * Creates a reusable eval that defines a mock conversation and checkpoints for evaluating assistant responses and tool calls.
+ *
* @param CreateEvalDto $request
* @param ?array{
* baseUrl?: string,
@@ -191,7 +198,9 @@ public function evalControllerCreate(CreateEvalDto $request, ?array $options = n
}
/**
- * @param string $id
+ * Returns the eval definition identified by its ID.
+ *
+ * @param string $id The unique identifier of the eval definition.
* @param ?array{
* baseUrl?: string,
* maxRetries?: int,
@@ -237,7 +246,9 @@ public function evalControllerGet(string $id, ?array $options = null): ?Eval_
}
/**
- * @param string $id
+ * Deletes the eval definition identified by its ID.
+ *
+ * @param string $id The unique identifier of the eval definition.
* @param ?array{
* baseUrl?: string,
* maxRetries?: int,
@@ -283,7 +294,9 @@ public function evalControllerRemove(string $id, ?array $options = null): ?Eval_
}
/**
- * @param string $id
+ * Updates the eval definition identified by its ID.
+ *
+ * @param string $id The unique identifier of the eval definition.
* @param UpdateEvalDto $request
* @param ?array{
* baseUrl?: string,
@@ -331,7 +344,9 @@ public function evalControllerUpdate(string $id, UpdateEvalDto $request = new Up
}
/**
- * @param string $id
+ * Returns the eval run identified by its ID.
+ *
+ * @param string $id The unique identifier of the eval run.
* @param ?array{
* baseUrl?: string,
* maxRetries?: int,
@@ -377,7 +392,9 @@ public function evalControllerGetRun(string $id, ?array $options = null): ?EvalR
}
/**
- * @param string $id
+ * Deletes the eval run identified by its ID.
+ *
+ * @param string $id The unique identifier of the eval run.
* @param ?array{
* baseUrl?: string,
* maxRetries?: int,
@@ -423,6 +440,8 @@ public function evalControllerRemoveRun(string $id, ?array $options = null): ?Ev
}
/**
+ * Returns eval runs for the authenticated organization. Filter results by ID or creation and update timestamps.
+ *
* @param EvalControllerGetRunsPaginatedRequest $request
* @param ?array{
* baseUrl?: string,
@@ -449,6 +468,9 @@ public function evalControllerGetRunsPaginated(EvalControllerGetRunsPaginatedReq
if ($request->sortOrder != null) {
$query['sortOrder'] = $request->sortOrder;
}
+ if ($request->sortBy != null) {
+ $query['sortBy'] = $request->sortBy;
+ }
if ($request->limit != null) {
$query['limit'] = $request->limit;
}
@@ -507,6 +529,8 @@ public function evalControllerGetRunsPaginated(EvalControllerGetRunsPaginatedReq
}
/**
+ * Runs a saved or transient eval against an assistant or squad and creates an eval-run record containing the results.
+ *
* @param CreateEvalRunDto $request
* @param ?array{
* baseUrl?: string,
diff --git a/src/Eval/Requests/EvalControllerGetPaginatedRequest.php b/src/Eval/Requests/EvalControllerGetPaginatedRequest.php
index 48d2e37..8d8054f 100644
--- a/src/Eval/Requests/EvalControllerGetPaginatedRequest.php
+++ b/src/Eval/Requests/EvalControllerGetPaginatedRequest.php
@@ -4,12 +4,13 @@
use Vapi\Core\Json\JsonSerializableType;
use Vapi\Eval\Types\EvalControllerGetPaginatedRequestSortOrder;
+use Vapi\Eval\Types\EvalControllerGetPaginatedRequestSortBy;
use DateTime;
class EvalControllerGetPaginatedRequest extends JsonSerializableType
{
/**
- * @var ?string $id
+ * @var ?string $id Filters eval definitions by ID.
*/
public ?string $id;
@@ -23,6 +24,11 @@ class EvalControllerGetPaginatedRequest extends JsonSerializableType
*/
public ?string $sortOrder;
+ /**
+ * @var ?value-of $sortBy This is the column to sort by. Defaults to 'createdAt'.
+ */
+ public ?string $sortBy;
+
/**
* @var ?float $limit This is the maximum number of items to return. Defaults to 100.
*/
@@ -73,6 +79,7 @@ class EvalControllerGetPaginatedRequest extends JsonSerializableType
* id?: ?string,
* page?: ?float,
* sortOrder?: ?value-of,
+ * sortBy?: ?value-of,
* limit?: ?float,
* createdAtGt?: ?DateTime,
* createdAtLt?: ?DateTime,
@@ -90,6 +97,7 @@ public function __construct(
$this->id = $values['id'] ?? null;
$this->page = $values['page'] ?? null;
$this->sortOrder = $values['sortOrder'] ?? null;
+ $this->sortBy = $values['sortBy'] ?? null;
$this->limit = $values['limit'] ?? null;
$this->createdAtGt = $values['createdAtGt'] ?? null;
$this->createdAtLt = $values['createdAtLt'] ?? null;
diff --git a/src/Eval/Requests/EvalControllerGetRunsPaginatedRequest.php b/src/Eval/Requests/EvalControllerGetRunsPaginatedRequest.php
index e7c0fab..325f58c 100644
--- a/src/Eval/Requests/EvalControllerGetRunsPaginatedRequest.php
+++ b/src/Eval/Requests/EvalControllerGetRunsPaginatedRequest.php
@@ -4,12 +4,13 @@
use Vapi\Core\Json\JsonSerializableType;
use Vapi\Eval\Types\EvalControllerGetRunsPaginatedRequestSortOrder;
+use Vapi\Eval\Types\EvalControllerGetRunsPaginatedRequestSortBy;
use DateTime;
class EvalControllerGetRunsPaginatedRequest extends JsonSerializableType
{
/**
- * @var ?string $id
+ * @var ?string $id Filters eval runs by ID.
*/
public ?string $id;
@@ -23,6 +24,11 @@ class EvalControllerGetRunsPaginatedRequest extends JsonSerializableType
*/
public ?string $sortOrder;
+ /**
+ * @var ?value-of $sortBy This is the column to sort by. Defaults to 'createdAt'.
+ */
+ public ?string $sortBy;
+
/**
* @var ?float $limit This is the maximum number of items to return. Defaults to 100.
*/
@@ -73,6 +79,7 @@ class EvalControllerGetRunsPaginatedRequest extends JsonSerializableType
* id?: ?string,
* page?: ?float,
* sortOrder?: ?value-of,
+ * sortBy?: ?value-of,
* limit?: ?float,
* createdAtGt?: ?DateTime,
* createdAtLt?: ?DateTime,
@@ -90,6 +97,7 @@ public function __construct(
$this->id = $values['id'] ?? null;
$this->page = $values['page'] ?? null;
$this->sortOrder = $values['sortOrder'] ?? null;
+ $this->sortBy = $values['sortBy'] ?? null;
$this->limit = $values['limit'] ?? null;
$this->createdAtGt = $values['createdAtGt'] ?? null;
$this->createdAtLt = $values['createdAtLt'] ?? null;
diff --git a/src/Eval/Types/EvalControllerGetPaginatedRequestSortBy.php b/src/Eval/Types/EvalControllerGetPaginatedRequestSortBy.php
new file mode 100644
index 0000000..13dec80
--- /dev/null
+++ b/src/Eval/Types/EvalControllerGetPaginatedRequestSortBy.php
@@ -0,0 +1,10 @@
+options, $options ?? []);
+ $query = [];
+ $query['purpose'] = $request->purpose;
try {
$response = $this->client->sendRequest(
new JsonApiRequest(
baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value,
path: "file",
method: HttpMethod::GET,
+ query: $query,
),
$options,
);
@@ -100,6 +107,8 @@ public function list(?array $options = null): ?array
}
/**
+ * Uploads a file for use with a Vapi knowledge base.
+ *
* @param CreateFileDto $request
* @param ?array{
* baseUrl?: string,
@@ -117,6 +126,12 @@ public function create(CreateFileDto $request, ?array $options = null): ?File
$options = array_merge($this->options, $options ?? []);
$body = new MultipartFormData();
$body->addPart($request->file->toMultipartFormDataPart('file'));
+ if ($request->purpose != null) {
+ $body->add(name: 'purpose', value: $request->purpose);
+ }
+ if ($request->metadata != null) {
+ $body->add(name: 'metadata', value: $request->metadata);
+ }
try {
$response = $this->client->sendRequest(
new MultipartApiRequest(
@@ -148,7 +163,9 @@ public function create(CreateFileDto $request, ?array $options = null): ?File
}
/**
- * @param string $id
+ * Returns the uploaded file identified by its ID.
+ *
+ * @param string $id The unique identifier of the file.
* @param ?array{
* baseUrl?: string,
* maxRetries?: int,
@@ -194,7 +211,9 @@ public function get(string $id, ?array $options = null): ?File
}
/**
- * @param string $id
+ * Deletes the uploaded file identified by its ID.
+ *
+ * @param string $id The unique identifier of the file.
* @param ?array{
* baseUrl?: string,
* maxRetries?: int,
@@ -240,7 +259,9 @@ public function delete(string $id, ?array $options = null): ?File
}
/**
- * @param string $id
+ * Updates the name of the uploaded file identified by its ID.
+ *
+ * @param string $id The unique identifier of the file.
* @param UpdateFileDto $request
* @param ?array{
* baseUrl?: string,
diff --git a/src/Files/Requests/CreateFileDto.php b/src/Files/Requests/CreateFileDto.php
index d48c70e..d9484c0 100644
--- a/src/Files/Requests/CreateFileDto.php
+++ b/src/Files/Requests/CreateFileDto.php
@@ -4,6 +4,8 @@
use Vapi\Core\Json\JsonSerializableType;
use Vapi\Utils\File;
+use Vapi\Files\Types\CreateFilesRequestPurpose;
+use Vapi\Core\Json\JsonProperty;
class CreateFileDto extends JsonSerializableType
{
@@ -12,14 +14,30 @@ class CreateFileDto extends JsonSerializableType
*/
public File $file;
+ /**
+ * @var ?value-of $purpose Optional product flow that owns the uploaded file.
+ */
+ #[JsonProperty('purpose')]
+ public ?string $purpose;
+
+ /**
+ * @var ?string $metadata Optional JSON-encoded metadata for multipart uploads.
+ */
+ #[JsonProperty('metadata')]
+ public ?string $metadata;
+
/**
* @param array{
* file: File,
+ * purpose?: ?value-of,
+ * metadata?: ?string,
* } $values
*/
public function __construct(
array $values,
) {
$this->file = $values['file'];
+ $this->purpose = $values['purpose'] ?? null;
+ $this->metadata = $values['metadata'] ?? null;
}
}
diff --git a/src/Files/Requests/ListFilesRequest.php b/src/Files/Requests/ListFilesRequest.php
new file mode 100644
index 0000000..9038155
--- /dev/null
+++ b/src/Files/Requests/ListFilesRequest.php
@@ -0,0 +1,24 @@
+purpose = $values['purpose'];
+ }
+}
diff --git a/src/Files/Types/CreateFilesRequestPurpose.php b/src/Files/Types/CreateFilesRequestPurpose.php
new file mode 100644
index 0000000..a3abd80
--- /dev/null
+++ b/src/Files/Types/CreateFilesRequestPurpose.php
@@ -0,0 +1,10 @@
+sortOrder != null) {
$query['sortOrder'] = $request->sortOrder;
}
+ if ($request->sortBy != null) {
+ $query['sortBy'] = $request->sortBy;
+ }
if ($request->limit != null) {
$query['limit'] = $request->limit;
}
@@ -145,6 +150,8 @@ public function insightControllerFindAll(InsightControllerFindAllRequest $reques
}
/**
+ * Creates a saved reporting insight that queries call data and presents the results as a bar chart, pie chart, line chart, or text value.
+ *
* @param InsightControllerCreateRequest $request
* @param ?array{
* baseUrl?: string,
@@ -192,7 +199,9 @@ public function insightControllerCreate(InsightControllerCreateRequest $request,
}
/**
- * @param string $id
+ * Returns the reporting insight identified by its ID.
+ *
+ * @param string $id The unique identifier of the reporting insight.
* @param ?array{
* baseUrl?: string,
* maxRetries?: int,
@@ -238,7 +247,9 @@ public function insightControllerFindOne(string $id, ?array $options = null): ?I
}
/**
- * @param string $id
+ * Deletes the reporting insight identified by its ID.
+ *
+ * @param string $id The unique identifier of the reporting insight.
* @param ?array{
* baseUrl?: string,
* maxRetries?: int,
@@ -284,7 +295,9 @@ public function insightControllerRemove(string $id, ?array $options = null): ?In
}
/**
- * @param string $id
+ * Updates the reporting insight identified by its ID.
+ *
+ * @param string $id The unique identifier of the reporting insight.
* @param InsightControllerUpdateRequest $request
* @param ?array{
* baseUrl?: string,
@@ -332,7 +345,9 @@ public function insightControllerUpdate(string $id, InsightControllerUpdateReque
}
/**
- * @param string $id
+ * Runs a saved reporting insight, optionally overriding its time range and response format.
+ *
+ * @param string $id The unique identifier of the reporting insight.
* @param InsightRunDto $request
* @param ?array{
* baseUrl?: string,
@@ -380,6 +395,8 @@ public function insightControllerRun(string $id, InsightRunDto $request = new In
}
/**
+ * Runs an insight definition without first saving it, returning a preview of the resulting chart or text value.
+ *
* @param InsightControllerPreviewRequest $request
* @param ?array{
* baseUrl?: string,
diff --git a/src/Insight/Requests/InsightControllerFindAllRequest.php b/src/Insight/Requests/InsightControllerFindAllRequest.php
index 1955a5a..d12925c 100644
--- a/src/Insight/Requests/InsightControllerFindAllRequest.php
+++ b/src/Insight/Requests/InsightControllerFindAllRequest.php
@@ -4,12 +4,13 @@
use Vapi\Core\Json\JsonSerializableType;
use Vapi\Insight\Types\InsightControllerFindAllRequestSortOrder;
+use Vapi\Insight\Types\InsightControllerFindAllRequestSortBy;
use DateTime;
class InsightControllerFindAllRequest extends JsonSerializableType
{
/**
- * @var ?string $id
+ * @var ?string $id Filters reporting insights by ID.
*/
public ?string $id;
@@ -23,6 +24,11 @@ class InsightControllerFindAllRequest extends JsonSerializableType
*/
public ?string $sortOrder;
+ /**
+ * @var ?value-of $sortBy This is the column to sort by. Defaults to 'createdAt'.
+ */
+ public ?string $sortBy;
+
/**
* @var ?float $limit This is the maximum number of items to return. Defaults to 100.
*/
@@ -73,6 +79,7 @@ class InsightControllerFindAllRequest extends JsonSerializableType
* id?: ?string,
* page?: ?float,
* sortOrder?: ?value-of,
+ * sortBy?: ?value-of,
* limit?: ?float,
* createdAtGt?: ?DateTime,
* createdAtLt?: ?DateTime,
@@ -90,6 +97,7 @@ public function __construct(
$this->id = $values['id'] ?? null;
$this->page = $values['page'] ?? null;
$this->sortOrder = $values['sortOrder'] ?? null;
+ $this->sortBy = $values['sortBy'] ?? null;
$this->limit = $values['limit'] ?? null;
$this->createdAtGt = $values['createdAtGt'] ?? null;
$this->createdAtLt = $values['createdAtLt'] ?? null;
diff --git a/src/Insight/Requests/InsightRunDto.php b/src/Insight/Requests/InsightRunDto.php
index fa2cddc..91499db 100644
--- a/src/Insight/Requests/InsightRunDto.php
+++ b/src/Insight/Requests/InsightRunDto.php
@@ -10,7 +10,7 @@
class InsightRunDto extends JsonSerializableType
{
/**
- * @var ?InsightRunFormatPlan $formatPlan
+ * @var ?InsightRunFormatPlan $formatPlan Output-formatting instructions applied to the insight run.
*/
#[JsonProperty('formatPlan')]
public ?InsightRunFormatPlan $formatPlan;
@@ -29,10 +29,20 @@ class InsightRunDto extends JsonSerializableType
#[JsonProperty('timeRangeOverride')]
public ?InsightTimeRangeWithStep $timeRangeOverride;
+ /**
+ * Optional runtime assistant scope for dashboards.
+ * This is applied to call-table queries without mutating the saved insight.
+ *
+ * @var ?string $assistantId
+ */
+ #[JsonProperty('assistantId')]
+ public ?string $assistantId;
+
/**
* @param array{
* formatPlan?: ?InsightRunFormatPlan,
* timeRangeOverride?: ?InsightTimeRangeWithStep,
+ * assistantId?: ?string,
* } $values
*/
public function __construct(
@@ -40,5 +50,6 @@ public function __construct(
) {
$this->formatPlan = $values['formatPlan'] ?? null;
$this->timeRangeOverride = $values['timeRangeOverride'] ?? null;
+ $this->assistantId = $values['assistantId'] ?? null;
}
}
diff --git a/src/Insight/Types/InsightControllerFindAllRequestSortBy.php b/src/Insight/Types/InsightControllerFindAllRequestSortBy.php
new file mode 100644
index 0000000..a40d07a
--- /dev/null
+++ b/src/Insight/Types/InsightControllerFindAllRequestSortBy.php
@@ -0,0 +1,10 @@
+,
+ * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator
+ */
+ private array $options;
+
+ /**
+ * @var RawClient $client
+ */
+ private RawClient $client;
+
+ /**
+ * @param RawClient $client
+ * @param ?array{
+ * baseUrl?: string,
+ * client?: ClientInterface,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * } $options
+ */
+ public function __construct(
+ RawClient $client,
+ ?array $options = null,
+ ) {
+ $this->client = $client;
+ $this->options = $options ?? [];
+ }
+
+ /**
+ * @param KnowledgeBaseV2ControllerFindAllRequest $request
+ * @param ?array{
+ * baseUrl?: string,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * queryParameters?: array,
+ * bodyProperties?: array,
+ * } $options
+ * @return ?array
+ * @throws VapiException
+ * @throws VapiApiException
+ */
+ public function knowledgeBaseV2ControllerFindAll(KnowledgeBaseV2ControllerFindAllRequest $request = new KnowledgeBaseV2ControllerFindAllRequest(), ?array $options = null): ?array
+ {
+ $options = array_merge($this->options, $options ?? []);
+ $query = [];
+ if ($request->limit != null) {
+ $query['limit'] = $request->limit;
+ }
+ try {
+ $response = $this->client->sendRequest(
+ new JsonApiRequest(
+ baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value,
+ path: "v2/knowledge-base",
+ method: HttpMethod::GET,
+ query: $query,
+ ),
+ $options,
+ );
+ $statusCode = $response->getStatusCode();
+ if ($statusCode >= 200 && $statusCode < 400) {
+ $json = $response->getBody()->getContents();
+ if (empty($json)) {
+ return null;
+ }
+ return JsonDecoder::decodeArray($json, [KnowledgeBaseV2::class]); // @phpstan-ignore-line
+ }
+ } catch (JsonException $e) {
+ throw new VapiException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e);
+ } catch (ClientExceptionInterface $e) {
+ throw new VapiException(message: $e->getMessage(), previous: $e);
+ }
+ throw new VapiApiException(
+ message: 'API request failed',
+ statusCode: $statusCode,
+ body: $response->getBody()->getContents(),
+ );
+ }
+
+ /**
+ * @param CreateKnowledgeBaseV2Dto $request
+ * @param ?array{
+ * baseUrl?: string,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * queryParameters?: array,
+ * bodyProperties?: array,
+ * } $options
+ * @return ?KnowledgeBaseV2
+ * @throws VapiException
+ * @throws VapiApiException
+ */
+ public function knowledgeBaseV2ControllerCreate(CreateKnowledgeBaseV2Dto $request, ?array $options = null): ?KnowledgeBaseV2
+ {
+ $options = array_merge($this->options, $options ?? []);
+ try {
+ $response = $this->client->sendRequest(
+ new JsonApiRequest(
+ baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value,
+ path: "v2/knowledge-base",
+ method: HttpMethod::POST,
+ body: $request,
+ ),
+ $options,
+ );
+ $statusCode = $response->getStatusCode();
+ if ($statusCode >= 200 && $statusCode < 400) {
+ $json = $response->getBody()->getContents();
+ if (empty($json)) {
+ return null;
+ }
+ return KnowledgeBaseV2::fromJson($json);
+ }
+ } catch (JsonException $e) {
+ throw new VapiException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e);
+ } catch (ClientExceptionInterface $e) {
+ throw new VapiException(message: $e->getMessage(), previous: $e);
+ }
+ throw new VapiApiException(
+ message: 'API request failed',
+ statusCode: $statusCode,
+ body: $response->getBody()->getContents(),
+ );
+ }
+
+ /**
+ * @param string $id The unique identifier for the resource.
+ * @param ?array{
+ * baseUrl?: string,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * queryParameters?: array,
+ * bodyProperties?: array,
+ * } $options
+ * @return ?array
+ * @throws VapiException
+ * @throws VapiApiException
+ */
+ public function knowledgeBaseV2ControllerFilesGet(string $id, ?array $options = null): ?array
+ {
+ $options = array_merge($this->options, $options ?? []);
+ try {
+ $response = $this->client->sendRequest(
+ new JsonApiRequest(
+ baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value,
+ path: "v2/knowledge-base/{$id}/file",
+ method: HttpMethod::GET,
+ ),
+ $options,
+ );
+ $statusCode = $response->getStatusCode();
+ if ($statusCode >= 200 && $statusCode < 400) {
+ $json = $response->getBody()->getContents();
+ if (empty($json)) {
+ return null;
+ }
+ return JsonDecoder::decodeArray($json, [KnowledgeBaseV2File::class]); // @phpstan-ignore-line
+ }
+ } catch (JsonException $e) {
+ throw new VapiException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e);
+ } catch (ClientExceptionInterface $e) {
+ throw new VapiException(message: $e->getMessage(), previous: $e);
+ }
+ throw new VapiApiException(
+ message: 'API request failed',
+ statusCode: $statusCode,
+ body: $response->getBody()->getContents(),
+ );
+ }
+
+ /**
+ * @param string $id The unique identifier for the resource.
+ * @param AttachKnowledgeBaseV2FileDto $request
+ * @param ?array{
+ * baseUrl?: string,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * queryParameters?: array,
+ * bodyProperties?: array,
+ * } $options
+ * @return ?KnowledgeBaseV2File
+ * @throws VapiException
+ * @throws VapiApiException
+ */
+ public function knowledgeBaseV2ControllerFileAttach(string $id, AttachKnowledgeBaseV2FileDto $request, ?array $options = null): ?KnowledgeBaseV2File
+ {
+ $options = array_merge($this->options, $options ?? []);
+ try {
+ $response = $this->client->sendRequest(
+ new JsonApiRequest(
+ baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value,
+ path: "v2/knowledge-base/{$id}/file",
+ method: HttpMethod::POST,
+ body: $request,
+ ),
+ $options,
+ );
+ $statusCode = $response->getStatusCode();
+ if ($statusCode >= 200 && $statusCode < 400) {
+ $json = $response->getBody()->getContents();
+ if (empty($json)) {
+ return null;
+ }
+ return KnowledgeBaseV2File::fromJson($json);
+ }
+ } catch (JsonException $e) {
+ throw new VapiException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e);
+ } catch (ClientExceptionInterface $e) {
+ throw new VapiException(message: $e->getMessage(), previous: $e);
+ }
+ throw new VapiApiException(
+ message: 'API request failed',
+ statusCode: $statusCode,
+ body: $response->getBody()->getContents(),
+ );
+ }
+
+ /**
+ * @param string $id The unique identifier for the resource.
+ * @param string $fileId
+ * @param ?array{
+ * baseUrl?: string,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * queryParameters?: array,
+ * bodyProperties?: array,
+ * } $options
+ * @return ?KnowledgeBaseV2File
+ * @throws VapiException
+ * @throws VapiApiException
+ */
+ public function knowledgeBaseV2ControllerFileDetach(string $id, string $fileId, ?array $options = null): ?KnowledgeBaseV2File
+ {
+ $options = array_merge($this->options, $options ?? []);
+ try {
+ $response = $this->client->sendRequest(
+ new JsonApiRequest(
+ baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value,
+ path: "v2/knowledge-base/{$id}/file/{$fileId}",
+ method: HttpMethod::DELETE,
+ ),
+ $options,
+ );
+ $statusCode = $response->getStatusCode();
+ if ($statusCode >= 200 && $statusCode < 400) {
+ $json = $response->getBody()->getContents();
+ if (empty($json)) {
+ return null;
+ }
+ return KnowledgeBaseV2File::fromJson($json);
+ }
+ } catch (JsonException $e) {
+ throw new VapiException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e);
+ } catch (ClientExceptionInterface $e) {
+ throw new VapiException(message: $e->getMessage(), previous: $e);
+ }
+ throw new VapiApiException(
+ message: 'API request failed',
+ statusCode: $statusCode,
+ body: $response->getBody()->getContents(),
+ );
+ }
+
+ /**
+ * @param string $id The unique identifier for the resource.
+ * @param string $fileId
+ * @param ?array{
+ * baseUrl?: string,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * queryParameters?: array,
+ * bodyProperties?: array,
+ * } $options
+ * @return ?KnowledgeBaseV2File
+ * @throws VapiException
+ * @throws VapiApiException
+ */
+ public function knowledgeBaseV2ControllerFileRetry(string $id, string $fileId, ?array $options = null): ?KnowledgeBaseV2File
+ {
+ $options = array_merge($this->options, $options ?? []);
+ try {
+ $response = $this->client->sendRequest(
+ new JsonApiRequest(
+ baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value,
+ path: "v2/knowledge-base/{$id}/file/{$fileId}/retry",
+ method: HttpMethod::POST,
+ ),
+ $options,
+ );
+ $statusCode = $response->getStatusCode();
+ if ($statusCode >= 200 && $statusCode < 400) {
+ $json = $response->getBody()->getContents();
+ if (empty($json)) {
+ return null;
+ }
+ return KnowledgeBaseV2File::fromJson($json);
+ }
+ } catch (JsonException $e) {
+ throw new VapiException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e);
+ } catch (ClientExceptionInterface $e) {
+ throw new VapiException(message: $e->getMessage(), previous: $e);
+ }
+ throw new VapiApiException(
+ message: 'API request failed',
+ statusCode: $statusCode,
+ body: $response->getBody()->getContents(),
+ );
+ }
+
+ /**
+ * @param string $id The unique identifier for the resource.
+ * @param ?array{
+ * baseUrl?: string,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * queryParameters?: array,
+ * bodyProperties?: array,
+ * } $options
+ * @return ?KnowledgeBaseV2WithFiles
+ * @throws VapiException
+ * @throws VapiApiException
+ */
+ public function knowledgeBaseV2ControllerFindOne(string $id, ?array $options = null): ?KnowledgeBaseV2WithFiles
+ {
+ $options = array_merge($this->options, $options ?? []);
+ try {
+ $response = $this->client->sendRequest(
+ new JsonApiRequest(
+ baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value,
+ path: "v2/knowledge-base/{$id}",
+ method: HttpMethod::GET,
+ ),
+ $options,
+ );
+ $statusCode = $response->getStatusCode();
+ if ($statusCode >= 200 && $statusCode < 400) {
+ $json = $response->getBody()->getContents();
+ if (empty($json)) {
+ return null;
+ }
+ return KnowledgeBaseV2WithFiles::fromJson($json);
+ }
+ } catch (JsonException $e) {
+ throw new VapiException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e);
+ } catch (ClientExceptionInterface $e) {
+ throw new VapiException(message: $e->getMessage(), previous: $e);
+ }
+ throw new VapiApiException(
+ message: 'API request failed',
+ statusCode: $statusCode,
+ body: $response->getBody()->getContents(),
+ );
+ }
+
+ /**
+ * @param string $id The unique identifier for the resource.
+ * @param ?array{
+ * baseUrl?: string,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * queryParameters?: array,
+ * bodyProperties?: array,
+ * } $options
+ * @return ?KnowledgeBaseV2
+ * @throws VapiException
+ * @throws VapiApiException
+ */
+ public function knowledgeBaseV2ControllerRemove(string $id, ?array $options = null): ?KnowledgeBaseV2
+ {
+ $options = array_merge($this->options, $options ?? []);
+ try {
+ $response = $this->client->sendRequest(
+ new JsonApiRequest(
+ baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value,
+ path: "v2/knowledge-base/{$id}",
+ method: HttpMethod::DELETE,
+ ),
+ $options,
+ );
+ $statusCode = $response->getStatusCode();
+ if ($statusCode >= 200 && $statusCode < 400) {
+ $json = $response->getBody()->getContents();
+ if (empty($json)) {
+ return null;
+ }
+ return KnowledgeBaseV2::fromJson($json);
+ }
+ } catch (JsonException $e) {
+ throw new VapiException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e);
+ } catch (ClientExceptionInterface $e) {
+ throw new VapiException(message: $e->getMessage(), previous: $e);
+ }
+ throw new VapiApiException(
+ message: 'API request failed',
+ statusCode: $statusCode,
+ body: $response->getBody()->getContents(),
+ );
+ }
+
+ /**
+ * @param string $id The unique identifier for the resource.
+ * @param UpdateKnowledgeBaseV2Dto $request
+ * @param ?array{
+ * baseUrl?: string,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * queryParameters?: array,
+ * bodyProperties?: array,
+ * } $options
+ * @return ?KnowledgeBaseV2
+ * @throws VapiException
+ * @throws VapiApiException
+ */
+ public function knowledgeBaseV2ControllerUpdate(string $id, UpdateKnowledgeBaseV2Dto $request = new UpdateKnowledgeBaseV2Dto(), ?array $options = null): ?KnowledgeBaseV2
+ {
+ $options = array_merge($this->options, $options ?? []);
+ try {
+ $response = $this->client->sendRequest(
+ new JsonApiRequest(
+ baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value,
+ path: "v2/knowledge-base/{$id}",
+ method: HttpMethod::PATCH,
+ body: $request,
+ ),
+ $options,
+ );
+ $statusCode = $response->getStatusCode();
+ if ($statusCode >= 200 && $statusCode < 400) {
+ $json = $response->getBody()->getContents();
+ if (empty($json)) {
+ return null;
+ }
+ return KnowledgeBaseV2::fromJson($json);
+ }
+ } catch (JsonException $e) {
+ throw new VapiException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e);
+ } catch (ClientExceptionInterface $e) {
+ throw new VapiException(message: $e->getMessage(), previous: $e);
+ }
+ throw new VapiApiException(
+ message: 'API request failed',
+ statusCode: $statusCode,
+ body: $response->getBody()->getContents(),
+ );
+ }
+}
diff --git a/src/KnowledgeBasesV2/Requests/AttachKnowledgeBaseV2FileDto.php b/src/KnowledgeBasesV2/Requests/AttachKnowledgeBaseV2FileDto.php
new file mode 100644
index 0000000..9dd03c2
--- /dev/null
+++ b/src/KnowledgeBasesV2/Requests/AttachKnowledgeBaseV2FileDto.php
@@ -0,0 +1,26 @@
+fileId = $values['fileId'];
+ }
+}
diff --git a/src/KnowledgeBasesV2/Requests/CreateKnowledgeBaseV2Dto.php b/src/KnowledgeBasesV2/Requests/CreateKnowledgeBaseV2Dto.php
new file mode 100644
index 0000000..e026789
--- /dev/null
+++ b/src/KnowledgeBasesV2/Requests/CreateKnowledgeBaseV2Dto.php
@@ -0,0 +1,34 @@
+name = $values['name'];
+ $this->description = $values['description'] ?? null;
+ }
+}
diff --git a/src/KnowledgeBasesV2/Requests/KnowledgeBaseV2ControllerFindAllRequest.php b/src/KnowledgeBasesV2/Requests/KnowledgeBaseV2ControllerFindAllRequest.php
new file mode 100644
index 0000000..351a4cf
--- /dev/null
+++ b/src/KnowledgeBasesV2/Requests/KnowledgeBaseV2ControllerFindAllRequest.php
@@ -0,0 +1,24 @@
+limit = $values['limit'] ?? null;
+ }
+}
diff --git a/src/KnowledgeBasesV2/Requests/UpdateKnowledgeBaseV2Dto.php b/src/KnowledgeBasesV2/Requests/UpdateKnowledgeBaseV2Dto.php
new file mode 100644
index 0000000..2a41105
--- /dev/null
+++ b/src/KnowledgeBasesV2/Requests/UpdateKnowledgeBaseV2Dto.php
@@ -0,0 +1,34 @@
+name = $values['name'] ?? null;
+ $this->description = $values['description'] ?? null;
+ }
+}
diff --git a/src/ObservabilityScorecard/ObservabilityScorecardClient.php b/src/ObservabilityScorecard/ObservabilityScorecardClient.php
index 46db0b3..74189d8 100644
--- a/src/ObservabilityScorecard/ObservabilityScorecardClient.php
+++ b/src/ObservabilityScorecard/ObservabilityScorecardClient.php
@@ -55,7 +55,9 @@ public function __construct(
}
/**
- * @param string $id
+ * Returns the scorecard identified by its ID.
+ *
+ * @param string $id The unique identifier of the scorecard.
* @param ?array{
* baseUrl?: string,
* maxRetries?: int,
@@ -101,7 +103,9 @@ public function scorecardControllerGet(string $id, ?array $options = null): ?Sco
}
/**
- * @param string $id
+ * Deletes the scorecard identified by its ID.
+ *
+ * @param string $id The unique identifier of the scorecard.
* @param ?array{
* baseUrl?: string,
* maxRetries?: int,
@@ -147,7 +151,9 @@ public function scorecardControllerRemove(string $id, ?array $options = null): ?
}
/**
- * @param string $id
+ * Updates the scorecard identified by its ID.
+ *
+ * @param string $id The unique identifier of the scorecard.
* @param UpdateScorecardDto $request
* @param ?array{
* baseUrl?: string,
@@ -195,6 +201,8 @@ public function scorecardControllerUpdate(string $id, UpdateScorecardDto $reques
}
/**
+ * Returns scorecards for the authenticated organization. Filter results by ID or creation and update timestamps.
+ *
* @param ScorecardControllerGetPaginatedRequest $request
* @param ?array{
* baseUrl?: string,
@@ -221,6 +229,9 @@ public function scorecardControllerGetPaginated(ScorecardControllerGetPaginatedR
if ($request->sortOrder != null) {
$query['sortOrder'] = $request->sortOrder;
}
+ if ($request->sortBy != null) {
+ $query['sortBy'] = $request->sortBy;
+ }
if ($request->limit != null) {
$query['limit'] = $request->limit;
}
@@ -279,6 +290,8 @@ public function scorecardControllerGetPaginated(ScorecardControllerGetPaginatedR
}
/**
+ * Creates a scorecard containing metrics, scoring conditions, and optional links to assistants whose calls should be evaluated.
+ *
* @param CreateScorecardDto $request
* @param ?array{
* baseUrl?: string,
diff --git a/src/ObservabilityScorecard/Requests/ScorecardControllerGetPaginatedRequest.php b/src/ObservabilityScorecard/Requests/ScorecardControllerGetPaginatedRequest.php
index 0d254a1..8db8020 100644
--- a/src/ObservabilityScorecard/Requests/ScorecardControllerGetPaginatedRequest.php
+++ b/src/ObservabilityScorecard/Requests/ScorecardControllerGetPaginatedRequest.php
@@ -4,12 +4,13 @@
use Vapi\Core\Json\JsonSerializableType;
use Vapi\ObservabilityScorecard\Types\ScorecardControllerGetPaginatedRequestSortOrder;
+use Vapi\ObservabilityScorecard\Types\ScorecardControllerGetPaginatedRequestSortBy;
use DateTime;
class ScorecardControllerGetPaginatedRequest extends JsonSerializableType
{
/**
- * @var ?string $id
+ * @var ?string $id Filters scorecards by ID.
*/
public ?string $id;
@@ -23,6 +24,11 @@ class ScorecardControllerGetPaginatedRequest extends JsonSerializableType
*/
public ?string $sortOrder;
+ /**
+ * @var ?value-of $sortBy This is the column to sort by. Defaults to 'createdAt'.
+ */
+ public ?string $sortBy;
+
/**
* @var ?float $limit This is the maximum number of items to return. Defaults to 100.
*/
@@ -73,6 +79,7 @@ class ScorecardControllerGetPaginatedRequest extends JsonSerializableType
* id?: ?string,
* page?: ?float,
* sortOrder?: ?value-of,
+ * sortBy?: ?value-of,
* limit?: ?float,
* createdAtGt?: ?DateTime,
* createdAtLt?: ?DateTime,
@@ -90,6 +97,7 @@ public function __construct(
$this->id = $values['id'] ?? null;
$this->page = $values['page'] ?? null;
$this->sortOrder = $values['sortOrder'] ?? null;
+ $this->sortBy = $values['sortBy'] ?? null;
$this->limit = $values['limit'] ?? null;
$this->createdAtGt = $values['createdAtGt'] ?? null;
$this->createdAtLt = $values['createdAtLt'] ?? null;
diff --git a/src/ObservabilityScorecard/Types/ScorecardControllerGetPaginatedRequestSortBy.php b/src/ObservabilityScorecard/Types/ScorecardControllerGetPaginatedRequestSortBy.php
new file mode 100644
index 0000000..00754e9
--- /dev/null
+++ b/src/ObservabilityScorecard/Types/ScorecardControllerGetPaginatedRequestSortBy.php
@@ -0,0 +1,10 @@
+sortOrder != null) {
$query['sortOrder'] = $request->sortOrder;
}
+ if ($request->sortBy != null) {
+ $query['sortBy'] = $request->sortBy;
+ }
if ($request->limit != null) {
$query['limit'] = $request->limit;
}
@@ -267,7 +276,9 @@ public function phoneNumberControllerFindAllPaginated(PhoneNumberControllerFindA
}
/**
- * @param string $id
+ * Returns the phone number resource identified by its ID.
+ *
+ * @param string $id The unique identifier of the phone number.
* @param ?array{
* baseUrl?: string,
* maxRetries?: int,
@@ -313,7 +324,9 @@ public function get(string $id, ?array $options = null): ?GetPhoneNumbersRespons
}
/**
- * @param string $id
+ * Deletes the phone number resource identified by its ID.
+ *
+ * @param string $id The unique identifier of the phone number.
* @param ?array{
* baseUrl?: string,
* maxRetries?: int,
@@ -359,7 +372,9 @@ public function delete(string $id, ?array $options = null): ?DeletePhoneNumbersR
}
/**
- * @param string $id
+ * Updates the specified fields of the phone number resource identified by its ID.
+ *
+ * @param string $id The unique identifier of the phone number.
* @param UpdatePhoneNumbersRequest $request
* @param ?array{
* baseUrl?: string,
diff --git a/src/PhoneNumbers/Requests/PhoneNumberControllerFindAllPaginatedRequest.php b/src/PhoneNumbers/Requests/PhoneNumberControllerFindAllPaginatedRequest.php
index afc6ea5..19f21d5 100644
--- a/src/PhoneNumbers/Requests/PhoneNumberControllerFindAllPaginatedRequest.php
+++ b/src/PhoneNumbers/Requests/PhoneNumberControllerFindAllPaginatedRequest.php
@@ -4,6 +4,7 @@
use Vapi\Core\Json\JsonSerializableType;
use Vapi\PhoneNumbers\Types\PhoneNumberControllerFindAllPaginatedRequestSortOrder;
+use Vapi\PhoneNumbers\Types\PhoneNumberControllerFindAllPaginatedRequestSortBy;
use DateTime;
class PhoneNumberControllerFindAllPaginatedRequest extends JsonSerializableType
@@ -23,6 +24,11 @@ class PhoneNumberControllerFindAllPaginatedRequest extends JsonSerializableType
*/
public ?string $sortOrder;
+ /**
+ * @var ?value-of $sortBy This is the column to sort by. Defaults to 'createdAt'.
+ */
+ public ?string $sortBy;
+
/**
* @var ?float $limit This is the maximum number of items to return. Defaults to 100.
*/
@@ -73,6 +79,7 @@ class PhoneNumberControllerFindAllPaginatedRequest extends JsonSerializableType
* search?: ?string,
* page?: ?float,
* sortOrder?: ?value-of,
+ * sortBy?: ?value-of,
* limit?: ?float,
* createdAtGt?: ?DateTime,
* createdAtLt?: ?DateTime,
@@ -90,6 +97,7 @@ public function __construct(
$this->search = $values['search'] ?? null;
$this->page = $values['page'] ?? null;
$this->sortOrder = $values['sortOrder'] ?? null;
+ $this->sortBy = $values['sortBy'] ?? null;
$this->limit = $values['limit'] ?? null;
$this->createdAtGt = $values['createdAtGt'] ?? null;
$this->createdAtLt = $values['createdAtLt'] ?? null;
diff --git a/src/PhoneNumbers/Types/PhoneNumberControllerFindAllPaginatedRequestSortBy.php b/src/PhoneNumbers/Types/PhoneNumberControllerFindAllPaginatedRequestSortBy.php
new file mode 100644
index 0000000..03ae0ae
--- /dev/null
+++ b/src/PhoneNumbers/Types/PhoneNumberControllerFindAllPaginatedRequestSortBy.php
@@ -0,0 +1,10 @@
+ $provider The provider (e.g., 11labs)
* @param value-of $resourceName The resource name (e.g., pronunciation-dictionary)
* @param ProviderResourceControllerGetProviderResourcesPaginatedRequest $request
@@ -94,6 +96,9 @@ public function providerResourceControllerGetProviderResourcesPaginated(string $
if ($request->sortOrder != null) {
$query['sortOrder'] = $request->sortOrder;
}
+ if ($request->sortBy != null) {
+ $query['sortBy'] = $request->sortBy;
+ }
if ($request->limit != null) {
$query['limit'] = $request->limit;
}
@@ -152,6 +157,8 @@ public function providerResourceControllerGetProviderResourcesPaginated(string $
}
/**
+ * Creates a pronunciation-dictionary resource for a supported provider, currently Cartesia or ElevenLabs.
+ *
* @param value-of $provider The provider (e.g., 11labs)
* @param value-of $resourceName The resource name (e.g., pronunciation-dictionary)
* @param ?array{
@@ -199,9 +206,11 @@ public function providerResourceControllerCreateProviderResource(string $provide
}
/**
+ * Returns the provider resource identified by its Vapi resource ID.
+ *
* @param value-of $provider The provider (e.g., 11labs)
* @param value-of $resourceName The resource name (e.g., pronunciation-dictionary)
- * @param string $id
+ * @param string $id The unique identifier of the provider resource.
* @param ?array{
* baseUrl?: string,
* maxRetries?: int,
@@ -247,9 +256,11 @@ public function providerResourceControllerGetProviderResource(string $provider,
}
/**
+ * Deletes the provider resource identified by its Vapi resource ID.
+ *
* @param value-of $provider The provider (e.g., 11labs)
* @param value-of $resourceName The resource name (e.g., pronunciation-dictionary)
- * @param string $id
+ * @param string $id The unique identifier of the provider resource.
* @param ?array{
* baseUrl?: string,
* maxRetries?: int,
@@ -295,9 +306,11 @@ public function providerResourceControllerDeleteProviderResource(string $provide
}
/**
+ * Updates the provider resource identified by its Vapi resource ID.
+ *
* @param value-of $provider The provider (e.g., 11labs)
* @param value-of $resourceName The resource name (e.g., pronunciation-dictionary)
- * @param string $id
+ * @param string $id The unique identifier of the provider resource.
* @param ?array{
* baseUrl?: string,
* maxRetries?: int,
diff --git a/src/ProviderResources/Requests/ProviderResourceControllerGetProviderResourcesPaginatedRequest.php b/src/ProviderResources/Requests/ProviderResourceControllerGetProviderResourcesPaginatedRequest.php
index 685c98c..848e7b1 100644
--- a/src/ProviderResources/Requests/ProviderResourceControllerGetProviderResourcesPaginatedRequest.php
+++ b/src/ProviderResources/Requests/ProviderResourceControllerGetProviderResourcesPaginatedRequest.php
@@ -4,17 +4,18 @@
use Vapi\Core\Json\JsonSerializableType;
use Vapi\ProviderResources\Types\ProviderResourceControllerGetProviderResourcesPaginatedRequestSortOrder;
+use Vapi\ProviderResources\Types\ProviderResourceControllerGetProviderResourcesPaginatedRequestSortBy;
use DateTime;
class ProviderResourceControllerGetProviderResourcesPaginatedRequest extends JsonSerializableType
{
/**
- * @var ?string $id
+ * @var ?string $id Filters provider resources by their resource ID.
*/
public ?string $id;
/**
- * @var ?string $resourceId
+ * @var ?string $resourceId Filters provider resources by their provider-specific resource ID.
*/
public ?string $resourceId;
@@ -28,6 +29,11 @@ class ProviderResourceControllerGetProviderResourcesPaginatedRequest extends Jso
*/
public ?string $sortOrder;
+ /**
+ * @var ?value-of $sortBy This is the column to sort by. Defaults to 'createdAt'.
+ */
+ public ?string $sortBy;
+
/**
* @var ?float $limit This is the maximum number of items to return. Defaults to 100.
*/
@@ -79,6 +85,7 @@ class ProviderResourceControllerGetProviderResourcesPaginatedRequest extends Jso
* resourceId?: ?string,
* page?: ?float,
* sortOrder?: ?value-of,
+ * sortBy?: ?value-of,
* limit?: ?float,
* createdAtGt?: ?DateTime,
* createdAtLt?: ?DateTime,
@@ -97,6 +104,7 @@ public function __construct(
$this->resourceId = $values['resourceId'] ?? null;
$this->page = $values['page'] ?? null;
$this->sortOrder = $values['sortOrder'] ?? null;
+ $this->sortBy = $values['sortBy'] ?? null;
$this->limit = $values['limit'] ?? null;
$this->createdAtGt = $values['createdAtGt'] ?? null;
$this->createdAtLt = $values['createdAtLt'] ?? null;
diff --git a/src/ProviderResources/Types/ProviderResourceControllerGetProviderResourcesPaginatedRequestSortBy.php b/src/ProviderResources/Types/ProviderResourceControllerGetProviderResourcesPaginatedRequestSortBy.php
new file mode 100644
index 0000000..83780f8
--- /dev/null
+++ b/src/ProviderResources/Types/ProviderResourceControllerGetProviderResourcesPaginatedRequestSortBy.php
@@ -0,0 +1,10 @@
+ $sortBy This is the column to sort by. Defaults to 'createdAt'.
+ */
+ public ?string $sortBy;
+
/**
* @var ?float $limit This is the maximum number of items to return. Defaults to 100.
*/
@@ -171,15 +191,18 @@ class ListSessionsRequest extends JsonSerializableType
* numberE164CheckEnabled?: ?bool,
* extension?: ?string,
* assistantOverrides?: ?string,
+ * squadOverrides?: ?string,
* number?: ?string,
* sipUri?: ?string,
* email?: ?string,
* externalId?: ?string,
* customerNumberAny?: ?string,
+ * idAny?: ?string,
* phoneNumberId?: ?string,
* phoneNumberIdAny?: ?array,
* page?: ?float,
* sortOrder?: ?value-of,
+ * sortBy?: ?value-of,
* limit?: ?float,
* createdAtGt?: ?DateTime,
* createdAtLt?: ?DateTime,
@@ -203,15 +226,18 @@ public function __construct(
$this->numberE164CheckEnabled = $values['numberE164CheckEnabled'] ?? null;
$this->extension = $values['extension'] ?? null;
$this->assistantOverrides = $values['assistantOverrides'] ?? null;
+ $this->squadOverrides = $values['squadOverrides'] ?? null;
$this->number = $values['number'] ?? null;
$this->sipUri = $values['sipUri'] ?? null;
$this->email = $values['email'] ?? null;
$this->externalId = $values['externalId'] ?? null;
$this->customerNumberAny = $values['customerNumberAny'] ?? null;
+ $this->idAny = $values['idAny'] ?? null;
$this->phoneNumberId = $values['phoneNumberId'] ?? null;
$this->phoneNumberIdAny = $values['phoneNumberIdAny'] ?? null;
$this->page = $values['page'] ?? null;
$this->sortOrder = $values['sortOrder'] ?? null;
+ $this->sortBy = $values['sortBy'] ?? null;
$this->limit = $values['limit'] ?? null;
$this->createdAtGt = $values['createdAtGt'] ?? null;
$this->createdAtLt = $values['createdAtLt'] ?? null;
diff --git a/src/Sessions/SessionsClient.php b/src/Sessions/SessionsClient.php
index 5630ab6..cf55935 100644
--- a/src/Sessions/SessionsClient.php
+++ b/src/Sessions/SessionsClient.php
@@ -99,6 +99,9 @@ public function list(ListSessionsRequest $request = new ListSessionsRequest(), ?
if ($request->assistantOverrides != null) {
$query['assistantOverrides'] = $request->assistantOverrides;
}
+ if ($request->squadOverrides != null) {
+ $query['squadOverrides'] = $request->squadOverrides;
+ }
if ($request->number != null) {
$query['number'] = $request->number;
}
@@ -114,6 +117,9 @@ public function list(ListSessionsRequest $request = new ListSessionsRequest(), ?
if ($request->customerNumberAny != null) {
$query['customerNumberAny'] = $request->customerNumberAny;
}
+ if ($request->idAny != null) {
+ $query['idAny'] = $request->idAny;
+ }
if ($request->phoneNumberId != null) {
$query['phoneNumberId'] = $request->phoneNumberId;
}
@@ -126,6 +132,9 @@ public function list(ListSessionsRequest $request = new ListSessionsRequest(), ?
if ($request->sortOrder != null) {
$query['sortOrder'] = $request->sortOrder;
}
+ if ($request->sortBy != null) {
+ $query['sortBy'] = $request->sortBy;
+ }
if ($request->limit != null) {
$query['limit'] = $request->limit;
}
@@ -231,7 +240,7 @@ public function create(CreateSessionDto $request = new CreateSessionDto(), ?arra
}
/**
- * @param string $id
+ * @param string $id The unique identifier for the resource.
* @param ?array{
* baseUrl?: string,
* maxRetries?: int,
@@ -277,7 +286,7 @@ public function get(string $id, ?array $options = null): ?Session
}
/**
- * @param string $id
+ * @param string $id The unique identifier for the resource.
* @param ?array{
* baseUrl?: string,
* maxRetries?: int,
@@ -323,7 +332,7 @@ public function delete(string $id, ?array $options = null): ?Session
}
/**
- * @param string $id
+ * @param string $id The unique identifier for the resource.
* @param UpdateSessionDto $request
* @param ?array{
* baseUrl?: string,
diff --git a/src/Sessions/Types/ListSessionsRequestSortBy.php b/src/Sessions/Types/ListSessionsRequestSortBy.php
new file mode 100644
index 0000000..51d37ed
--- /dev/null
+++ b/src/Sessions/Types/ListSessionsRequestSortBy.php
@@ -0,0 +1,10 @@
+ $sortOrder This is the sort order for pagination. Defaults to 'DESC'.
+ */
+ public ?string $sortOrder;
+
+ /**
+ * @var ?value-of $sortBy This is the column to sort by. Defaults to 'createdAt'.
+ */
+ public ?string $sortBy;
+
+ /**
+ * @var ?float $limit This is the maximum number of items to return. Defaults to 100.
+ */
+ public ?float $limit;
+
+ /**
+ * @var ?DateTime $createdAtGt This will return items where the createdAt is greater than the specified value.
+ */
+ public ?DateTime $createdAtGt;
+
+ /**
+ * @var ?DateTime $createdAtLt This will return items where the createdAt is less than the specified value.
+ */
+ public ?DateTime $createdAtLt;
+
+ /**
+ * @var ?DateTime $createdAtGe This will return items where the createdAt is greater than or equal to the specified value.
+ */
+ public ?DateTime $createdAtGe;
+
+ /**
+ * @var ?DateTime $createdAtLe This will return items where the createdAt is less than or equal to the specified value.
+ */
+ public ?DateTime $createdAtLe;
+
+ /**
+ * @var ?DateTime $updatedAtGt This will return items where the updatedAt is greater than the specified value.
+ */
+ public ?DateTime $updatedAtGt;
+
+ /**
+ * @var ?DateTime $updatedAtLt This will return items where the updatedAt is less than the specified value.
+ */
+ public ?DateTime $updatedAtLt;
+
+ /**
+ * @var ?DateTime $updatedAtGe This will return items where the updatedAt is greater than or equal to the specified value.
+ */
+ public ?DateTime $updatedAtGe;
+
+ /**
+ * @var ?DateTime $updatedAtLe This will return items where the updatedAt is less than or equal to the specified value.
+ */
+ public ?DateTime $updatedAtLe;
+
+ /**
+ * @param array{
+ * page?: ?float,
+ * sortOrder?: ?value-of,
+ * sortBy?: ?value-of,
+ * limit?: ?float,
+ * createdAtGt?: ?DateTime,
+ * createdAtLt?: ?DateTime,
+ * createdAtGe?: ?DateTime,
+ * createdAtLe?: ?DateTime,
+ * updatedAtGt?: ?DateTime,
+ * updatedAtLt?: ?DateTime,
+ * updatedAtGe?: ?DateTime,
+ * updatedAtLe?: ?DateTime,
+ * } $values
+ */
+ public function __construct(
+ array $values = [],
+ ) {
+ $this->page = $values['page'] ?? null;
+ $this->sortOrder = $values['sortOrder'] ?? null;
+ $this->sortBy = $values['sortBy'] ?? null;
+ $this->limit = $values['limit'] ?? null;
+ $this->createdAtGt = $values['createdAtGt'] ?? null;
+ $this->createdAtLt = $values['createdAtLt'] ?? null;
+ $this->createdAtGe = $values['createdAtGe'] ?? null;
+ $this->createdAtLe = $values['createdAtLe'] ?? null;
+ $this->updatedAtGt = $values['updatedAtGt'] ?? null;
+ $this->updatedAtLt = $values['updatedAtLt'] ?? null;
+ $this->updatedAtGe = $values['updatedAtGe'] ?? null;
+ $this->updatedAtLe = $values['updatedAtLe'] ?? null;
+ }
+}
diff --git a/src/Types/UpdatePersonalityDto.php b/src/SimulationPersonalities/Requests/UpdatePersonalityDto.php
similarity index 88%
rename from src/Types/UpdatePersonalityDto.php
rename to src/SimulationPersonalities/Requests/UpdatePersonalityDto.php
index 001cf78..3159d82 100644
--- a/src/Types/UpdatePersonalityDto.php
+++ b/src/SimulationPersonalities/Requests/UpdatePersonalityDto.php
@@ -1,9 +1,10 @@
assistant = $values['assistant'] ?? null;
$this->path = $values['path'] ?? null;
}
-
- /**
- * @return string
- */
- public function __toString(): string
- {
- return $this->toJson();
- }
}
diff --git a/src/SimulationPersonalities/SimulationPersonalitiesClient.php b/src/SimulationPersonalities/SimulationPersonalitiesClient.php
new file mode 100644
index 0000000..365545a
--- /dev/null
+++ b/src/SimulationPersonalities/SimulationPersonalitiesClient.php
@@ -0,0 +1,337 @@
+,
+ * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator
+ */
+ private array $options;
+
+ /**
+ * @var RawClient $client
+ */
+ private RawClient $client;
+
+ /**
+ * @param RawClient $client
+ * @param ?array{
+ * baseUrl?: string,
+ * client?: ClientInterface,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * } $options
+ */
+ public function __construct(
+ RawClient $client,
+ ?array $options = null,
+ ) {
+ $this->client = $client;
+ $this->options = $options ?? [];
+ }
+
+ /**
+ * Returns the personalities for the authenticated organization.
+ *
+ * @param PersonalityControllerFindAllRequest $request
+ * @param ?array{
+ * baseUrl?: string,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * queryParameters?: array,
+ * bodyProperties?: array,
+ * } $options
+ * @return ?array
+ * @throws VapiException
+ * @throws VapiApiException
+ */
+ public function personalityControllerFindAll(PersonalityControllerFindAllRequest $request = new PersonalityControllerFindAllRequest(), ?array $options = null): ?array
+ {
+ $options = array_merge($this->options, $options ?? []);
+ $query = [];
+ if ($request->page != null) {
+ $query['page'] = $request->page;
+ }
+ if ($request->sortOrder != null) {
+ $query['sortOrder'] = $request->sortOrder;
+ }
+ if ($request->sortBy != null) {
+ $query['sortBy'] = $request->sortBy;
+ }
+ if ($request->limit != null) {
+ $query['limit'] = $request->limit;
+ }
+ if ($request->createdAtGt != null) {
+ $query['createdAtGt'] = JsonSerializer::serializeDateTime($request->createdAtGt);
+ }
+ if ($request->createdAtLt != null) {
+ $query['createdAtLt'] = JsonSerializer::serializeDateTime($request->createdAtLt);
+ }
+ if ($request->createdAtGe != null) {
+ $query['createdAtGe'] = JsonSerializer::serializeDateTime($request->createdAtGe);
+ }
+ if ($request->createdAtLe != null) {
+ $query['createdAtLe'] = JsonSerializer::serializeDateTime($request->createdAtLe);
+ }
+ if ($request->updatedAtGt != null) {
+ $query['updatedAtGt'] = JsonSerializer::serializeDateTime($request->updatedAtGt);
+ }
+ if ($request->updatedAtLt != null) {
+ $query['updatedAtLt'] = JsonSerializer::serializeDateTime($request->updatedAtLt);
+ }
+ if ($request->updatedAtGe != null) {
+ $query['updatedAtGe'] = JsonSerializer::serializeDateTime($request->updatedAtGe);
+ }
+ if ($request->updatedAtLe != null) {
+ $query['updatedAtLe'] = JsonSerializer::serializeDateTime($request->updatedAtLe);
+ }
+ try {
+ $response = $this->client->sendRequest(
+ new JsonApiRequest(
+ baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value,
+ path: "eval/simulation/personality",
+ method: HttpMethod::GET,
+ query: $query,
+ ),
+ $options,
+ );
+ $statusCode = $response->getStatusCode();
+ if ($statusCode >= 200 && $statusCode < 400) {
+ $json = $response->getBody()->getContents();
+ if (empty($json)) {
+ return null;
+ }
+ return JsonDecoder::decodeArray($json, [Personality::class]); // @phpstan-ignore-line
+ }
+ } catch (JsonException $e) {
+ throw new VapiException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e);
+ } catch (ClientExceptionInterface $e) {
+ throw new VapiException(message: $e->getMessage(), previous: $e);
+ }
+ throw new VapiApiException(
+ message: 'API request failed',
+ statusCode: $statusCode,
+ body: $response->getBody()->getContents(),
+ );
+ }
+
+ /**
+ * Creates a personality, the AI tester's configuration used in simulations.
+ *
+ * @param CreatePersonalityDto $request
+ * @param ?array{
+ * baseUrl?: string,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * queryParameters?: array,
+ * bodyProperties?: array,
+ * } $options
+ * @return ?Personality
+ * @throws VapiException
+ * @throws VapiApiException
+ */
+ public function personalityControllerCreate(CreatePersonalityDto $request, ?array $options = null): ?Personality
+ {
+ $options = array_merge($this->options, $options ?? []);
+ try {
+ $response = $this->client->sendRequest(
+ new JsonApiRequest(
+ baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value,
+ path: "eval/simulation/personality",
+ method: HttpMethod::POST,
+ body: $request,
+ ),
+ $options,
+ );
+ $statusCode = $response->getStatusCode();
+ if ($statusCode >= 200 && $statusCode < 400) {
+ $json = $response->getBody()->getContents();
+ if (empty($json)) {
+ return null;
+ }
+ return Personality::fromJson($json);
+ }
+ } catch (JsonException $e) {
+ throw new VapiException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e);
+ } catch (ClientExceptionInterface $e) {
+ throw new VapiException(message: $e->getMessage(), previous: $e);
+ }
+ throw new VapiApiException(
+ message: 'API request failed',
+ statusCode: $statusCode,
+ body: $response->getBody()->getContents(),
+ );
+ }
+
+ /**
+ * Returns the specified personality.
+ *
+ * @param string $id The unique identifier of the personality.
+ * @param ?array{
+ * baseUrl?: string,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * queryParameters?: array,
+ * bodyProperties?: array,
+ * } $options
+ * @return ?Personality
+ * @throws VapiException
+ * @throws VapiApiException
+ */
+ public function personalityControllerFindOne(string $id, ?array $options = null): ?Personality
+ {
+ $options = array_merge($this->options, $options ?? []);
+ try {
+ $response = $this->client->sendRequest(
+ new JsonApiRequest(
+ baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value,
+ path: "eval/simulation/personality/{$id}",
+ method: HttpMethod::GET,
+ ),
+ $options,
+ );
+ $statusCode = $response->getStatusCode();
+ if ($statusCode >= 200 && $statusCode < 400) {
+ $json = $response->getBody()->getContents();
+ if (empty($json)) {
+ return null;
+ }
+ return Personality::fromJson($json);
+ }
+ } catch (JsonException $e) {
+ throw new VapiException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e);
+ } catch (ClientExceptionInterface $e) {
+ throw new VapiException(message: $e->getMessage(), previous: $e);
+ }
+ throw new VapiApiException(
+ message: 'API request failed',
+ statusCode: $statusCode,
+ body: $response->getBody()->getContents(),
+ );
+ }
+
+ /**
+ * Deletes the specified personality.
+ *
+ * @param string $id The unique identifier of the personality.
+ * @param ?array{
+ * baseUrl?: string,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * queryParameters?: array,
+ * bodyProperties?: array,
+ * } $options
+ * @return ?Personality
+ * @throws VapiException
+ * @throws VapiApiException
+ */
+ public function personalityControllerRemove(string $id, ?array $options = null): ?Personality
+ {
+ $options = array_merge($this->options, $options ?? []);
+ try {
+ $response = $this->client->sendRequest(
+ new JsonApiRequest(
+ baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value,
+ path: "eval/simulation/personality/{$id}",
+ method: HttpMethod::DELETE,
+ ),
+ $options,
+ );
+ $statusCode = $response->getStatusCode();
+ if ($statusCode >= 200 && $statusCode < 400) {
+ $json = $response->getBody()->getContents();
+ if (empty($json)) {
+ return null;
+ }
+ return Personality::fromJson($json);
+ }
+ } catch (JsonException $e) {
+ throw new VapiException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e);
+ } catch (ClientExceptionInterface $e) {
+ throw new VapiException(message: $e->getMessage(), previous: $e);
+ }
+ throw new VapiApiException(
+ message: 'API request failed',
+ statusCode: $statusCode,
+ body: $response->getBody()->getContents(),
+ );
+ }
+
+ /**
+ * Updates the specified personality. Changes apply to future runs.
+ *
+ * @param string $id The unique identifier of the personality.
+ * @param UpdatePersonalityDto $request
+ * @param ?array{
+ * baseUrl?: string,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * queryParameters?: array,
+ * bodyProperties?: array,
+ * } $options
+ * @return ?Personality
+ * @throws VapiException
+ * @throws VapiApiException
+ */
+ public function personalityControllerUpdate(string $id, UpdatePersonalityDto $request = new UpdatePersonalityDto(), ?array $options = null): ?Personality
+ {
+ $options = array_merge($this->options, $options ?? []);
+ try {
+ $response = $this->client->sendRequest(
+ new JsonApiRequest(
+ baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value,
+ path: "eval/simulation/personality/{$id}",
+ method: HttpMethod::PATCH,
+ body: $request,
+ ),
+ $options,
+ );
+ $statusCode = $response->getStatusCode();
+ if ($statusCode >= 200 && $statusCode < 400) {
+ $json = $response->getBody()->getContents();
+ if (empty($json)) {
+ return null;
+ }
+ return Personality::fromJson($json);
+ }
+ } catch (JsonException $e) {
+ throw new VapiException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e);
+ } catch (ClientExceptionInterface $e) {
+ throw new VapiException(message: $e->getMessage(), previous: $e);
+ }
+ throw new VapiApiException(
+ message: 'API request failed',
+ statusCode: $statusCode,
+ body: $response->getBody()->getContents(),
+ );
+ }
+}
diff --git a/src/SimulationPersonalities/Types/PersonalityControllerFindAllRequestSortBy.php b/src/SimulationPersonalities/Types/PersonalityControllerFindAllRequestSortBy.php
new file mode 100644
index 0000000..0a11f95
--- /dev/null
+++ b/src/SimulationPersonalities/Types/PersonalityControllerFindAllRequestSortBy.php
@@ -0,0 +1,10 @@
+iterations = $values['iterations'] ?? null;
$this->transport = $values['transport'] ?? null;
}
-
- /**
- * @return string
- */
- public function __toString(): string
- {
- return $this->toJson();
- }
}
diff --git a/src/SimulationRuns/Requests/SimulationRunControllerFindAllRequest.php b/src/SimulationRuns/Requests/SimulationRunControllerFindAllRequest.php
new file mode 100644
index 0000000..3581076
--- /dev/null
+++ b/src/SimulationRuns/Requests/SimulationRunControllerFindAllRequest.php
@@ -0,0 +1,135 @@
+ $status Filter by status
+ */
+ public ?string $status;
+
+ /**
+ * @var ?value-of $filterStatus Filter by aggregate run result status
+ */
+ public ?string $filterStatus;
+
+ /**
+ * @var ?value-of $targetType Filter by target type
+ */
+ public ?string $targetType;
+
+ /**
+ * @var ?string $targetId Filter by target id
+ */
+ public ?string $targetId;
+
+ /**
+ * @var ?float $page This is the page number to return. Defaults to 1.
+ */
+ public ?float $page;
+
+ /**
+ * @var ?value-of $sortOrder This is the sort order for pagination. Defaults to 'DESC'.
+ */
+ public ?string $sortOrder;
+
+ /**
+ * @var ?value-of $sortBy This is the column to sort by. Defaults to 'createdAt'.
+ */
+ public ?string $sortBy;
+
+ /**
+ * @var ?float $limit This is the maximum number of items to return. Defaults to 100.
+ */
+ public ?float $limit;
+
+ /**
+ * @var ?DateTime $createdAtGt This will return items where the createdAt is greater than the specified value.
+ */
+ public ?DateTime $createdAtGt;
+
+ /**
+ * @var ?DateTime $createdAtLt This will return items where the createdAt is less than the specified value.
+ */
+ public ?DateTime $createdAtLt;
+
+ /**
+ * @var ?DateTime $createdAtGe This will return items where the createdAt is greater than or equal to the specified value.
+ */
+ public ?DateTime $createdAtGe;
+
+ /**
+ * @var ?DateTime $createdAtLe This will return items where the createdAt is less than or equal to the specified value.
+ */
+ public ?DateTime $createdAtLe;
+
+ /**
+ * @var ?DateTime $updatedAtGt This will return items where the updatedAt is greater than the specified value.
+ */
+ public ?DateTime $updatedAtGt;
+
+ /**
+ * @var ?DateTime $updatedAtLt This will return items where the updatedAt is less than the specified value.
+ */
+ public ?DateTime $updatedAtLt;
+
+ /**
+ * @var ?DateTime $updatedAtGe This will return items where the updatedAt is greater than or equal to the specified value.
+ */
+ public ?DateTime $updatedAtGe;
+
+ /**
+ * @var ?DateTime $updatedAtLe This will return items where the updatedAt is less than or equal to the specified value.
+ */
+ public ?DateTime $updatedAtLe;
+
+ /**
+ * @param array{
+ * status?: ?value-of,
+ * filterStatus?: ?value-of,
+ * targetType?: ?value-of,
+ * targetId?: ?string,
+ * page?: ?float,
+ * sortOrder?: ?value-of,
+ * sortBy?: ?value-of,
+ * limit?: ?float,
+ * createdAtGt?: ?DateTime,
+ * createdAtLt?: ?DateTime,
+ * createdAtGe?: ?DateTime,
+ * createdAtLe?: ?DateTime,
+ * updatedAtGt?: ?DateTime,
+ * updatedAtLt?: ?DateTime,
+ * updatedAtGe?: ?DateTime,
+ * updatedAtLe?: ?DateTime,
+ * } $values
+ */
+ public function __construct(
+ array $values = [],
+ ) {
+ $this->status = $values['status'] ?? null;
+ $this->filterStatus = $values['filterStatus'] ?? null;
+ $this->targetType = $values['targetType'] ?? null;
+ $this->targetId = $values['targetId'] ?? null;
+ $this->page = $values['page'] ?? null;
+ $this->sortOrder = $values['sortOrder'] ?? null;
+ $this->sortBy = $values['sortBy'] ?? null;
+ $this->limit = $values['limit'] ?? null;
+ $this->createdAtGt = $values['createdAtGt'] ?? null;
+ $this->createdAtLt = $values['createdAtLt'] ?? null;
+ $this->createdAtGe = $values['createdAtGe'] ?? null;
+ $this->createdAtLe = $values['createdAtLe'] ?? null;
+ $this->updatedAtGt = $values['updatedAtGt'] ?? null;
+ $this->updatedAtLt = $values['updatedAtLt'] ?? null;
+ $this->updatedAtGe = $values['updatedAtGe'] ?? null;
+ $this->updatedAtLe = $values['updatedAtLe'] ?? null;
+ }
+}
diff --git a/src/SimulationRuns/Requests/SimulationRunControllerFindItemsRequest.php b/src/SimulationRuns/Requests/SimulationRunControllerFindItemsRequest.php
new file mode 100644
index 0000000..1c32862
--- /dev/null
+++ b/src/SimulationRuns/Requests/SimulationRunControllerFindItemsRequest.php
@@ -0,0 +1,126 @@
+ $status Filters run items by status.
+ */
+ public ?string $status;
+
+ /**
+ * @var ?float $page This is the page number to return. Defaults to 1.
+ */
+ public ?float $page;
+
+ /**
+ * @var ?value-of $sortOrder This is the sort order for pagination. Defaults to 'DESC'.
+ */
+ public ?string $sortOrder;
+
+ /**
+ * @var ?value-of $sortBy This is the column to sort by. Defaults to 'createdAt'.
+ */
+ public ?string $sortBy;
+
+ /**
+ * @var ?float $limit This is the maximum number of items to return. Defaults to 100.
+ */
+ public ?float $limit;
+
+ /**
+ * @var ?DateTime $createdAtGt This will return items where the createdAt is greater than the specified value.
+ */
+ public ?DateTime $createdAtGt;
+
+ /**
+ * @var ?DateTime $createdAtLt This will return items where the createdAt is less than the specified value.
+ */
+ public ?DateTime $createdAtLt;
+
+ /**
+ * @var ?DateTime $createdAtGe This will return items where the createdAt is greater than or equal to the specified value.
+ */
+ public ?DateTime $createdAtGe;
+
+ /**
+ * @var ?DateTime $createdAtLe This will return items where the createdAt is less than or equal to the specified value.
+ */
+ public ?DateTime $createdAtLe;
+
+ /**
+ * @var ?DateTime $updatedAtGt This will return items where the updatedAt is greater than the specified value.
+ */
+ public ?DateTime $updatedAtGt;
+
+ /**
+ * @var ?DateTime $updatedAtLt This will return items where the updatedAt is less than the specified value.
+ */
+ public ?DateTime $updatedAtLt;
+
+ /**
+ * @var ?DateTime $updatedAtGe This will return items where the updatedAt is greater than or equal to the specified value.
+ */
+ public ?DateTime $updatedAtGe;
+
+ /**
+ * @var ?DateTime $updatedAtLe This will return items where the updatedAt is less than or equal to the specified value.
+ */
+ public ?DateTime $updatedAtLe;
+
+ /**
+ * @param array{
+ * simulationId?: ?string,
+ * runId?: ?string,
+ * status?: ?value-of,
+ * page?: ?float,
+ * sortOrder?: ?value-of,
+ * sortBy?: ?value-of,
+ * limit?: ?float,
+ * createdAtGt?: ?DateTime,
+ * createdAtLt?: ?DateTime,
+ * createdAtGe?: ?DateTime,
+ * createdAtLe?: ?DateTime,
+ * updatedAtGt?: ?DateTime,
+ * updatedAtLt?: ?DateTime,
+ * updatedAtGe?: ?DateTime,
+ * updatedAtLe?: ?DateTime,
+ * } $values
+ */
+ public function __construct(
+ array $values = [],
+ ) {
+ $this->simulationId = $values['simulationId'] ?? null;
+ $this->runId = $values['runId'] ?? null;
+ $this->status = $values['status'] ?? null;
+ $this->page = $values['page'] ?? null;
+ $this->sortOrder = $values['sortOrder'] ?? null;
+ $this->sortBy = $values['sortBy'] ?? null;
+ $this->limit = $values['limit'] ?? null;
+ $this->createdAtGt = $values['createdAtGt'] ?? null;
+ $this->createdAtLt = $values['createdAtLt'] ?? null;
+ $this->createdAtGe = $values['createdAtGe'] ?? null;
+ $this->createdAtLe = $values['createdAtLe'] ?? null;
+ $this->updatedAtGt = $values['updatedAtGt'] ?? null;
+ $this->updatedAtLt = $values['updatedAtLt'] ?? null;
+ $this->updatedAtGe = $values['updatedAtGe'] ?? null;
+ $this->updatedAtLe = $values['updatedAtLe'] ?? null;
+ }
+}
diff --git a/src/SimulationRuns/Requests/SimulationRunControllerGenerateSuggestionsRequest.php b/src/SimulationRuns/Requests/SimulationRunControllerGenerateSuggestionsRequest.php
new file mode 100644
index 0000000..1ebc8f7
--- /dev/null
+++ b/src/SimulationRuns/Requests/SimulationRunControllerGenerateSuggestionsRequest.php
@@ -0,0 +1,31 @@
+force = $values['force'];
+ $this->persist = $values['persist'] ?? null;
+ }
+}
diff --git a/src/SimulationRuns/SimulationRunsClient.php b/src/SimulationRuns/SimulationRunsClient.php
new file mode 100644
index 0000000..6c0a926
--- /dev/null
+++ b/src/SimulationRuns/SimulationRunsClient.php
@@ -0,0 +1,550 @@
+,
+ * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator
+ */
+ private array $options;
+
+ /**
+ * @var RawClient $client
+ */
+ private RawClient $client;
+
+ /**
+ * @param RawClient $client
+ * @param ?array{
+ * baseUrl?: string,
+ * client?: ClientInterface,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * } $options
+ */
+ public function __construct(
+ RawClient $client,
+ ?array $options = null,
+ ) {
+ $this->client = $client;
+ $this->options = $options ?? [];
+ }
+
+ /**
+ * Returns the simulation runs for the authenticated organization.
+ *
+ * @param SimulationRunControllerFindAllRequest $request
+ * @param ?array{
+ * baseUrl?: string,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * queryParameters?: array,
+ * bodyProperties?: array,
+ * } $options
+ * @return (
+ * array
+ * |SimulationRunsPaginatedResponse
+ * )|null
+ * @throws VapiException
+ * @throws VapiApiException
+ */
+ public function simulationRunControllerFindAll(SimulationRunControllerFindAllRequest $request = new SimulationRunControllerFindAllRequest(), ?array $options = null): array|SimulationRunsPaginatedResponse|null
+ {
+ $options = array_merge($this->options, $options ?? []);
+ $query = [];
+ if ($request->status != null) {
+ $query['status'] = $request->status;
+ }
+ if ($request->filterStatus != null) {
+ $query['filterStatus'] = $request->filterStatus;
+ }
+ if ($request->targetType != null) {
+ $query['targetType'] = $request->targetType;
+ }
+ if ($request->targetId != null) {
+ $query['targetId'] = $request->targetId;
+ }
+ if ($request->page != null) {
+ $query['page'] = $request->page;
+ }
+ if ($request->sortOrder != null) {
+ $query['sortOrder'] = $request->sortOrder;
+ }
+ if ($request->sortBy != null) {
+ $query['sortBy'] = $request->sortBy;
+ }
+ if ($request->limit != null) {
+ $query['limit'] = $request->limit;
+ }
+ if ($request->createdAtGt != null) {
+ $query['createdAtGt'] = JsonSerializer::serializeDateTime($request->createdAtGt);
+ }
+ if ($request->createdAtLt != null) {
+ $query['createdAtLt'] = JsonSerializer::serializeDateTime($request->createdAtLt);
+ }
+ if ($request->createdAtGe != null) {
+ $query['createdAtGe'] = JsonSerializer::serializeDateTime($request->createdAtGe);
+ }
+ if ($request->createdAtLe != null) {
+ $query['createdAtLe'] = JsonSerializer::serializeDateTime($request->createdAtLe);
+ }
+ if ($request->updatedAtGt != null) {
+ $query['updatedAtGt'] = JsonSerializer::serializeDateTime($request->updatedAtGt);
+ }
+ if ($request->updatedAtLt != null) {
+ $query['updatedAtLt'] = JsonSerializer::serializeDateTime($request->updatedAtLt);
+ }
+ if ($request->updatedAtGe != null) {
+ $query['updatedAtGe'] = JsonSerializer::serializeDateTime($request->updatedAtGe);
+ }
+ if ($request->updatedAtLe != null) {
+ $query['updatedAtLe'] = JsonSerializer::serializeDateTime($request->updatedAtLe);
+ }
+ try {
+ $response = $this->client->sendRequest(
+ new JsonApiRequest(
+ baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value,
+ path: "eval/simulation/run",
+ method: HttpMethod::GET,
+ query: $query,
+ ),
+ $options,
+ );
+ $statusCode = $response->getStatusCode();
+ if ($statusCode >= 200 && $statusCode < 400) {
+ $json = $response->getBody()->getContents();
+ if (empty($json)) {
+ return null;
+ }
+ return JsonDecoder::decodeUnion($json, new Union([SimulationRun::class], SimulationRunsPaginatedResponse::class)); // @phpstan-ignore-line
+ }
+ } catch (JsonException $e) {
+ throw new VapiException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e);
+ } catch (ClientExceptionInterface $e) {
+ throw new VapiException(message: $e->getMessage(), previous: $e);
+ }
+ throw new VapiApiException(
+ message: 'API request failed',
+ statusCode: $statusCode,
+ body: $response->getBody()->getContents(),
+ );
+ }
+
+ /**
+ * Starts a simulation run against a target assistant or squad.
+ *
+ * @param CreateSimulationRunDto $request
+ * @param ?array{
+ * baseUrl?: string,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * queryParameters?: array,
+ * bodyProperties?: array,
+ * } $options
+ * @return ?CreateSimulationRunResponse
+ * @throws VapiException
+ * @throws VapiApiException
+ */
+ public function simulationRunControllerCreate(CreateSimulationRunDto $request, ?array $options = null): ?CreateSimulationRunResponse
+ {
+ $options = array_merge($this->options, $options ?? []);
+ try {
+ $response = $this->client->sendRequest(
+ new JsonApiRequest(
+ baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value,
+ path: "eval/simulation/run",
+ method: HttpMethod::POST,
+ body: $request,
+ ),
+ $options,
+ );
+ $statusCode = $response->getStatusCode();
+ if ($statusCode >= 200 && $statusCode < 400) {
+ $json = $response->getBody()->getContents();
+ if (empty($json)) {
+ return null;
+ }
+ return CreateSimulationRunResponse::fromJson($json);
+ }
+ } catch (JsonException $e) {
+ throw new VapiException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e);
+ } catch (ClientExceptionInterface $e) {
+ throw new VapiException(message: $e->getMessage(), previous: $e);
+ }
+ throw new VapiApiException(
+ message: 'API request failed',
+ statusCode: $statusCode,
+ body: $response->getBody()->getContents(),
+ );
+ }
+
+ /**
+ * Returns the specified simulation run, including its status and item counts.
+ *
+ * @param string $id The unique identifier of the simulation run.
+ * @param ?array{
+ * baseUrl?: string,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * queryParameters?: array,
+ * bodyProperties?: array,
+ * } $options
+ * @return ?SimulationRun
+ * @throws VapiException
+ * @throws VapiApiException
+ */
+ public function simulationRunControllerFindOne(string $id, ?array $options = null): ?SimulationRun
+ {
+ $options = array_merge($this->options, $options ?? []);
+ try {
+ $response = $this->client->sendRequest(
+ new JsonApiRequest(
+ baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value,
+ path: "eval/simulation/run/{$id}",
+ method: HttpMethod::GET,
+ ),
+ $options,
+ );
+ $statusCode = $response->getStatusCode();
+ if ($statusCode >= 200 && $statusCode < 400) {
+ $json = $response->getBody()->getContents();
+ if (empty($json)) {
+ return null;
+ }
+ return SimulationRun::fromJson($json);
+ }
+ } catch (JsonException $e) {
+ throw new VapiException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e);
+ } catch (ClientExceptionInterface $e) {
+ throw new VapiException(message: $e->getMessage(), previous: $e);
+ }
+ throw new VapiApiException(
+ message: 'API request failed',
+ statusCode: $statusCode,
+ body: $response->getBody()->getContents(),
+ );
+ }
+
+ /**
+ * Cancels the specified simulation run.
+ *
+ * @param string $id The unique identifier of the simulation run.
+ * @param ?array{
+ * baseUrl?: string,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * queryParameters?: array,
+ * bodyProperties?: array,
+ * } $options
+ * @return ?SimulationRun
+ * @throws VapiException
+ * @throws VapiApiException
+ */
+ public function simulationRunControllerCancelGroup(string $id, ?array $options = null): ?SimulationRun
+ {
+ $options = array_merge($this->options, $options ?? []);
+ try {
+ $response = $this->client->sendRequest(
+ new JsonApiRequest(
+ baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value,
+ path: "eval/simulation/run/{$id}",
+ method: HttpMethod::PATCH,
+ ),
+ $options,
+ );
+ $statusCode = $response->getStatusCode();
+ if ($statusCode >= 200 && $statusCode < 400) {
+ $json = $response->getBody()->getContents();
+ if (empty($json)) {
+ return null;
+ }
+ return SimulationRun::fromJson($json);
+ }
+ } catch (JsonException $e) {
+ throw new VapiException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e);
+ } catch (ClientExceptionInterface $e) {
+ throw new VapiException(message: $e->getMessage(), previous: $e);
+ }
+ throw new VapiApiException(
+ message: 'API request failed',
+ statusCode: $statusCode,
+ body: $response->getBody()->getContents(),
+ );
+ }
+
+ /**
+ * Returns the run items for the specified simulation run.
+ *
+ * @param string $id The unique identifier of the simulation run.
+ * @param SimulationRunControllerFindItemsRequest $request
+ * @param ?array{
+ * baseUrl?: string,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * queryParameters?: array,
+ * bodyProperties?: array,
+ * } $options
+ * @return ?array
+ * @throws VapiException
+ * @throws VapiApiException
+ */
+ public function simulationRunControllerFindItems(string $id, SimulationRunControllerFindItemsRequest $request = new SimulationRunControllerFindItemsRequest(), ?array $options = null): ?array
+ {
+ $options = array_merge($this->options, $options ?? []);
+ $query = [];
+ if ($request->simulationId != null) {
+ $query['simulationId'] = $request->simulationId;
+ }
+ if ($request->runId != null) {
+ $query['runId'] = $request->runId;
+ }
+ if ($request->status != null) {
+ $query['status'] = $request->status;
+ }
+ if ($request->page != null) {
+ $query['page'] = $request->page;
+ }
+ if ($request->sortOrder != null) {
+ $query['sortOrder'] = $request->sortOrder;
+ }
+ if ($request->sortBy != null) {
+ $query['sortBy'] = $request->sortBy;
+ }
+ if ($request->limit != null) {
+ $query['limit'] = $request->limit;
+ }
+ if ($request->createdAtGt != null) {
+ $query['createdAtGt'] = JsonSerializer::serializeDateTime($request->createdAtGt);
+ }
+ if ($request->createdAtLt != null) {
+ $query['createdAtLt'] = JsonSerializer::serializeDateTime($request->createdAtLt);
+ }
+ if ($request->createdAtGe != null) {
+ $query['createdAtGe'] = JsonSerializer::serializeDateTime($request->createdAtGe);
+ }
+ if ($request->createdAtLe != null) {
+ $query['createdAtLe'] = JsonSerializer::serializeDateTime($request->createdAtLe);
+ }
+ if ($request->updatedAtGt != null) {
+ $query['updatedAtGt'] = JsonSerializer::serializeDateTime($request->updatedAtGt);
+ }
+ if ($request->updatedAtLt != null) {
+ $query['updatedAtLt'] = JsonSerializer::serializeDateTime($request->updatedAtLt);
+ }
+ if ($request->updatedAtGe != null) {
+ $query['updatedAtGe'] = JsonSerializer::serializeDateTime($request->updatedAtGe);
+ }
+ if ($request->updatedAtLe != null) {
+ $query['updatedAtLe'] = JsonSerializer::serializeDateTime($request->updatedAtLe);
+ }
+ try {
+ $response = $this->client->sendRequest(
+ new JsonApiRequest(
+ baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value,
+ path: "eval/simulation/run/{$id}/item",
+ method: HttpMethod::GET,
+ query: $query,
+ ),
+ $options,
+ );
+ $statusCode = $response->getStatusCode();
+ if ($statusCode >= 200 && $statusCode < 400) {
+ $json = $response->getBody()->getContents();
+ if (empty($json)) {
+ return null;
+ }
+ return JsonDecoder::decodeArray($json, [SimulationRunItem::class]); // @phpstan-ignore-line
+ }
+ } catch (JsonException $e) {
+ throw new VapiException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e);
+ } catch (ClientExceptionInterface $e) {
+ throw new VapiException(message: $e->getMessage(), previous: $e);
+ }
+ throw new VapiApiException(
+ message: 'API request failed',
+ statusCode: $statusCode,
+ body: $response->getBody()->getContents(),
+ );
+ }
+
+ /**
+ * Returns the specified run item, including its evaluation results and the ID of the call that ran it.
+ *
+ * @param string $id The unique identifier of the simulation run.
+ * @param string $itemId The unique identifier of the run item.
+ * @param ?array{
+ * baseUrl?: string,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * queryParameters?: array,
+ * bodyProperties?: array