> ## Documentation Index
> Fetch the complete documentation index at: https://doc.rapida.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get All Phone Deployments

> Get assistant phone deployments from the Rapida SDK.

Gets paginated phone deployments for an assistant. Use user-scoped authentication because the operation requires organization and project context.

<Info>
  For setup and authentication options, see the [Installation guide](/api-reference/installation) and [Authentication](/api-reference/authentication).
</Info>

## Parameters

<ParamField body="connectionConfig" type="ConnectionConfig" required>
  Configuration for the client connection.
</ParamField>

<ParamField body="request" type="GetAllAssistantDeploymentRequest" required>
  Deployment list request.

  <Expandable>
    <ParamField body="assistantId" type="uint64" required>
      Assistant ID for the deployments.
    </ParamField>

    <ParamField body="paginate" type="Paginate" required>
      Pagination configuration for the request.

      <Expandable>
        <ParamField body="page" type="uint32" required>
          Page number to retrieve.
        </ParamField>

        <ParamField body="pageSize" type="uint32" required>
          Number of deployments to return per page.
        </ParamField>
      </Expandable>
    </ParamField>

    <ParamField body="criterias" type="Criteria[]" optional>
      Optional filtering criteria to apply to the deployment search.

      <Expandable>
        <ParamField body="key" type="string" required>
          Field name to filter by.
        </ParamField>

        <ParamField body="value" type="string" required>
          Value to match against the field.
        </ParamField>

        <ParamField body="logic" type="string" required>
          Criteria logic. Accepted values: `should` or `must`.
        </ParamField>
      </Expandable>
    </ParamField>
  </Expandable>
</ParamField>

## Usage

<CodeGroup>
  ```ts React theme={null}
  import {
    ConnectionConfig,
    GetAllAssistantDeploymentRequest,
    GetAllAssistantPhoneDeployment,
    Paginate,
  } from "@rapidaai/react";

  const auth = ConnectionConfig.WithDebugger({
    authorization: "AUTHORIZATION_TOKEN_PLACEHOLDER",
    userId: "AUTH_ID_PLACEHOLDER",
    projectId: "PROJECT_ID_PLACEHOLDER",
  });
  const connectionCfg = ConnectionConfig.DefaultConnectionConfig(auth);

  const pagination = new Paginate();
  pagination.setPage(1);
  pagination.setPagesize(20);

  const request = new GetAllAssistantDeploymentRequest();
  request.setAssistantid("ASSISTANT_ID_PLACEHOLDER");
  request.setPaginate(pagination);

  const response = await GetAllAssistantPhoneDeployment(connectionCfg, request);
  console.dir(response.toObject());
  ```

  ```python Python theme={null}
  import os
  from pprint import pprint

  from rapida import ConnectionConfig, Paginate
  from rapida.clients.protos.assistant_deployment_pb2 import (
      GetAllAssistantDeploymentRequest,
  )

  auth = ConnectionConfig.with_debugger(
      authorization=os.getenv("RAPIDA_AUTHORIZATION"),
      user_id=os.getenv("RAPIDA_AUTH_ID"),
      project_id=os.getenv("RAPIDA_PROJECT_ID"),
  )
  connection_config = ConnectionConfig.default_connection_config(auth)

  response = connection_config.assistant_deployment_client.GetAllAssistantPhoneDeployment(
      GetAllAssistantDeploymentRequest(
          assistantId=int(os.getenv("RAPIDA_ASSISTANT_ID")),
          paginate=Paginate(page=1, pageSize=20),
      ),
      metadata=connection_config.auth,
  )
  pprint(response)
  ```

  ```go Go theme={null}
  package main

  import (
  	"context"
  	"fmt"
  	"os"

  	clients "github.com/rapidaai/rapida-go/rapida/clients"
  	connections "github.com/rapidaai/rapida-go/rapida/connections"
  	protos "github.com/rapidaai/rapida-go/protos"
  )

  func main() {
  	connectionConfig := connections.DefaultconnectionConfig(
  		connections.WithPersonalToken(
  			os.Getenv("RAPIDA_AUTHORIZATION"),
  			os.Getenv("RAPIDA_AUTH_ID"),
  			os.Getenv("RAPIDA_PROJECT_ID"),
  		),
  	)

  	response, err := clients.GetAllAssistantPhoneDeployment(
  		context.Background(),
  		connectionConfig,
  		&protos.GetAllAssistantDeploymentRequest{
  			AssistantId: 2227823180112723968,
  			Paginate: &protos.Paginate{
  				Page:     1,
  				PageSize: 20,
  			},
  		},
  	)
  	if err != nil {
  		fmt.Printf("error while getting phone deployments: %+v\n", err)
  		return
  	}
  	fmt.Printf("get phone deployments response: %+v\n", response)
  }
  ```
</CodeGroup>

## Response

<ParamField body="code" type="int32">
  Numeric status code for the operation.
</ParamField>

<ParamField body="success" type="boolean">
  Indicates whether the operation was successful.
</ParamField>

<ParamField body="data" type="AssistantPhoneDeployment[]">
  Phone deployments returned by the request.

  <Expandable>
    <ParamField body="id" type="uint64">
      Unique identifier for the phone deployment.
    </ParamField>

    <ParamField body="assistantId" type="uint64">
      Assistant ID for the deployment.
    </ParamField>

    <ParamField body="greeting" type="string">
      First message the assistant sends when the session starts.
    </ParamField>

    <ParamField body="greetingInterruptible" type="boolean">
      Controls whether users can interrupt the opening greeting in audio sessions.
    </ParamField>

    <ParamField body="mistake" type="string">
      Message used when the assistant cannot understand or handle input.
    </ParamField>

    <ParamField body="inputAudio" type="DeploymentAudioProvider">
      Speech-to-text provider configuration.
    </ParamField>

    <ParamField body="outputAudio" type="DeploymentAudioProvider">
      Text-to-speech provider configuration.
    </ParamField>

    <ParamField body="phoneProviderName" type="string">
      Provider name.
    </ParamField>

    <ParamField body="phoneOptions" type="Metadata[]">
      Provider-specific options.
    </ParamField>

    <ParamField body="status" type="string">
      Current deployment status.
    </ParamField>

    <ParamField body="idealTimeout" type="uint64">
      Idle timeout in seconds.
    </ParamField>

    <ParamField body="idealTimeoutBackoff" type="uint64">
      Number of idle-timeout retries.
    </ParamField>

    <ParamField body="idealTimeoutMessage" type="string">
      Message sent on idle timeout.
    </ParamField>

    <ParamField body="maxSessionDuration" type="uint64">
      Maximum session duration in seconds.
    </ParamField>

    <ParamField body="createdDate" type="timestamp">
      Timestamp when the deployment was created.
    </ParamField>

    <ParamField body="updatedDate" type="timestamp">
      Timestamp when the deployment was last updated.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="paginated" type="Paginated">
  Pagination metadata.

  <Expandable>
    <ParamField body="currentPage" type="uint32">
      Current page returned by the API.
    </ParamField>

    <ParamField body="totalItem" type="uint32">
      Total number of matching deployments.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="error" type="Error">
  Error details when the operation fails.

  <Expandable>
    <ResponseField name="errorCode" type="string">
      Stable, machine-readable numeric code.
    </ResponseField>

    <ResponseField name="errorMessage" type="string">
      Developer-oriented message with diagnostic details.
    </ResponseField>

    <ResponseField name="humanMessage" type="string">
      Human-friendly description safe for display to end users.
    </ResponseField>
  </Expandable>
</ParamField>

## Errors

| Code      | Meaning                                    |
| --------- | ------------------------------------------ |
| `1015001` | Unauthenticated request.                   |
| `1015002` | Missing authentication scope.              |
| `1015003` | Invalid `assistantId`.                     |
| `1015004` | Invalid request.                           |
| `1015005` | Unable to get assistant phone deployments. |
