# `Twilio.Proxy.V1.Service.SessionService`
[🔗](https://github.com/jeffhuen/twilio_elixir/blob/main/lib/twilio/proxy/v1/service/session_service.ex#L2)

Service for Session API operations.

Operations: `list`, `create`, `fetch`, `update`, `delete`

# `create`

```elixir
@spec create(Twilio.Client.t(), String.t(), map(), keyword()) ::
  {:ok, Twilio.Resources.Proxy.V1.Service.Session.t()}
  | {:ok, map(), map()}
  | :ok
  | {:error, Twilio.Error.t()}
```

Create a new Session

Operation: `CreateSession` | Tags: ProxyV1Session

## Optional Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `DateExpiry` | string (date-time) | The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date when the Session should expire. If this is value is present, it overrides the `ttl` value. |
| `Mode` | string |  Values: `message-only`, `voice-only`, `voice-and-message` |
| `Participants` | array | The Participant objects to include in the new session. |
| `Status` | string |  Values: `open`, `in-progress`, `closed`, `failed`, `unknown` |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `Ttl` | integer | The time, in seconds, when the session will expire. The time is measured from the last Session create or the Session's last Interaction. |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `UniqueName` | string | An application-defined string that uniquely identifies the resource. This value must be 191 characters or fewer in length and be unique. **This value should not have PII.** |

# `delete`

```elixir
@spec delete(Twilio.Client.t(), String.t(), String.t(), keyword()) ::
  {:ok, map()} | {:ok, map(), map()} | :ok | {:error, Twilio.Error.t()}
```

Delete a specific Session.

Operation: `DeleteSession` | Tags: ProxyV1Session

# `fetch`

```elixir
@spec fetch(Twilio.Client.t(), String.t(), String.t(), keyword()) ::
  {:ok, Twilio.Resources.Proxy.V1.Service.Session.t()}
  | {:ok, map(), map()}
  | :ok
  | {:error, Twilio.Error.t()}
```

Fetch a specific Session.

Operation: `FetchSession` | Tags: ProxyV1Session

# `list`

```elixir
@spec list(Twilio.Client.t(), String.t(), map(), keyword()) ::
  {:ok, Twilio.Page.t()}
  | {:ok, map(), map()}
  | :ok
  | {:error, Twilio.Error.t()}
```

Retrieve a list of all Sessions for the Service. A maximum of 100 records will be returned per page.

Operation: `ListSession` | Tags: ProxyV1Session

# `stream`

```elixir
@spec stream(Twilio.Client.t(), String.t(), map(), keyword()) :: Enumerable.t()
```

Stream: Retrieve a list of all Sessions for the Service. A maximum of 100 records will be returned per page. (lazy auto-pagination).

# `update`

```elixir
@spec update(Twilio.Client.t(), String.t(), String.t(), map(), keyword()) ::
  {:ok, Twilio.Resources.Proxy.V1.Service.Session.t()}
  | {:ok, map(), map()}
  | :ok
  | {:error, Twilio.Error.t()}
```

Update a specific Session.

Operation: `UpdateSession` | Tags: ProxyV1Session

## Optional Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `DateExpiry` | string (date-time) | The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date when the Session should expire. If this is value is present, it overrides the `ttl` value. |
| `Status` | string |  Values: `open`, `in-progress`, `closed`, `failed`, `unknown` |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `Ttl` | integer | The time, in seconds, when the session will expire. The time is measured from the last Session create or the Session's last Interaction. |

---

*Consult [api-reference.md](api-reference.md) for complete listing*
