Skip to content

Vonage Conversations

github-actions edited this page Jul 5, 2024 · 31 revisions

Vonage ConversationsDocs


Documentation / Vonage Conversations

Vonage Conversations

Enumerations

ChannelType

Enum representing the type of communication channel.

Enumeration Members

Enumeration Member Value Description Defined in
APP "app" Represents an app channel. conversations/lib/enums/channelType.ts:18
PHONE "phone" Represents a phone channel. conversations/lib/enums/channelType.ts:8
SIP "sip" Represents a SIP channel. conversations/lib/enums/channelType.ts:13
VBC "vbc" Represents a VBC (Voice Business Cloud) channel. conversations/lib/enums/channelType.ts:28
WEBSOCKET "websocket" Represents a WebSocket channel. conversations/lib/enums/channelType.ts:23

ConversationState

Conversation state

Enumeration Members

Enumeration Member Value Description Defined in
ACTIVE "ACTIVE" Conversation is still active conversations/lib/enums/conversationState.ts:8
DELETED "DELETED" Conversation is deleted conversations/lib/enums/conversationState.ts:18
INACTIVE "INACTIVE" Conversation is inactive conversations/lib/enums/conversationState.ts:13

EventMessageType

Enumeration Members

Enumeration Member Value Defined in
AUDIO "audio" conversations/lib/enums/eventMessageType.ts:4
CUSTOM "custom" conversations/lib/enums/eventMessageType.ts:8
FILE "file" conversations/lib/enums/eventMessageType.ts:6
IMAGE "image" conversations/lib/enums/eventMessageType.ts:3
LOCATION "location" conversations/lib/enums/eventMessageType.ts:10
RANDOM "random" conversations/lib/enums/eventMessageType.ts:11
TEMPLATE "template" conversations/lib/enums/eventMessageType.ts:7
TEXT "text" conversations/lib/enums/eventMessageType.ts:2
VCARD "vcard" conversations/lib/enums/eventMessageType.ts:9
VIDEO "video" conversations/lib/enums/eventMessageType.ts:5

EventType

Enum representing various types of events and their descriptions.

Enumeration Members

Enumeration Member Value Description Defined in
AUDIO_DTMF "audio:dtmf" Audio: Play DTMF audio conversations/lib/enums/eventsTypes.ts:28
AUDIO_EAR_MUFF_OFF "audio:earmuff:off" Audio: Earmuff audio conversations/lib/enums/eventsTypes.ts:58
AUDIO_EAR_MUFF_ON "audio:earmuff:on" Audio: Earmuff audio conversations/lib/enums/eventsTypes.ts:53
AUDIO_MUTE_OFF "audio:mute:off" Audio: Unmute audio conversations/lib/enums/eventsTypes.ts:48
AUDIO_MUTE_ON "audio:mute:on" Audio: Mute audio conversations/lib/enums/eventsTypes.ts:43
AUDIO_PLAY "audio:play" Audio: Play audio conversations/lib/enums/eventsTypes.ts:8
AUDIO_PLAY_STOP "audio:play:stop" Audio: Stop currently playing audio conversations/lib/enums/eventsTypes.ts:13
AUDIO_RECORD "audio:record" Audio: Record the audio in the conversation conversations/lib/enums/eventsTypes.ts:33
AUDIO_RECORD_STOP "audio:record:stop" Audio: Stop current recording of audio conversations/lib/enums/eventsTypes.ts:38
AUDIO_SAY "audio:say" Audio: Use TTS to speak the given text conversations/lib/enums/eventsTypes.ts:18
AUDIO_SAY_STOP "audio:say:stop" Audio: Stop currently playing TTS conversations/lib/enums/eventsTypes.ts:23
AUDIO_SPEAKING_OFF "audio:speaking:off" Audio: Speaking on conversations/lib/enums/eventsTypes.ts:68
AUDIO_SPEAKING_ON "audio:speaking:on" Audio: Speaking on conversations/lib/enums/eventsTypes.ts:63
CUSTOM "custom" Custom: Custom event conversations/lib/enums/eventsTypes.ts:73
EPHEMERAL "ephemeral" Ephemeral: Ephemeral conversations/lib/enums/eventsTypes.ts:78
MESSAGE "message" Message: Message (Text, Image, Audio, Video, File, Template, Custom, VCard, Location, Random) conversations/lib/enums/eventsTypes.ts:83
MESSAGE_DELIVERED "message:delivered" Message: Message delivered conversations/lib/enums/eventsTypes.ts:108
MESSAGE_REJECTED "message:rejected" Message: Message rejected conversations/lib/enums/eventsTypes.ts:93
MESSAGE_SEEN "message:seen" Message: Message seen conversations/lib/enums/eventsTypes.ts:103
MESSAGE_SUBMITTED "message:submitted" Message: Message submitted conversations/lib/enums/eventsTypes.ts:88
MESSAGE_UNDELIVERABLE "message:undeliverable" Message: Message undeliverable conversations/lib/enums/eventsTypes.ts:98

LegStatus

The status of a leg

Enumeration Members

Enumeration Member Value Description Defined in
ANSWERED "answered" The leg is answered conversations/lib/enums/legStatus.ts:18
RINGING "ringing" The leg is ringing conversations/lib/enums/legStatus.ts:13
STARTED "started" The leg is started conversations/lib/enums/legStatus.ts:8

MemberState

Enum representing the state of a member.

Enumeration Members

Enumeration Member Value Description Defined in
INVITED "INVITED" The member has been invited to join the conversation. conversations/lib/enums/memberState.ts:8
JOINED "JOINED" The member has joined the conversation. conversations/lib/enums/memberState.ts:13
LEFT "LEFT" The member has left the conversation. conversations/lib/enums/memberState.ts:18
UNKNOWN "UNKNOWN" The state of the member is unknown or undefined. conversations/lib/enums/memberState.ts:23

ReasonCode

Enum representing various reasons

Enumeration Members

Enumeration Member Value Description Defined in
ADDRESS_INCOMPLETE "address_incomplete" Address incomplete. conversations/lib/enums/reasonMessages.ts:83
BAD_EXTENSION "bad_extension" Bad extension. conversations/lib/enums/reasonMessages.ts:48
BAD_GATEWAY "bad_gateway" Bad gateway. conversations/lib/enums/reasonMessages.ts:78
BANNED_CALL_ENDED "banned_call_ended" Call ended due to being banned. conversations/lib/enums/reasonMessages.ts:118
BUSY "busy" The recipient is currently busy. conversations/lib/enums/reasonMessages.ts:13
BUSY_HERE "busy_here" Recipient is busy here. conversations/lib/enums/reasonMessages.ts:53
CANCELLED "cancelled" The request was cancelled. conversations/lib/enums/reasonMessages.ts:23
FAILED "failed" General failure. conversations/lib/enums/reasonMessages.ts:8
FLOW_FAILED "flow_failed" Flow execution failed. conversations/lib/enums/reasonMessages.ts:123
FORBIDDEN "forbidden" Forbidden access. conversations/lib/enums/reasonMessages.ts:68
GONE "gone" Resource has gone away. conversations/lib/enums/reasonMessages.ts:73
NOT_FOUND "not_found" Resource not found. conversations/lib/enums/reasonMessages.ts:38
NOT_IMPLEMENTED "not_implemented" Not implemented. conversations/lib/enums/reasonMessages.ts:93
OK "ok" Operation was successful. conversations/lib/enums/reasonMessages.ts:33
PAYMENT_REQUIRED "payment_required" Payment is required. conversations/lib/enums/reasonMessages.ts:113
REJECTED "rejected" The request was rejected. conversations/lib/enums/reasonMessages.ts:28
REQUEST_TERMINATED "request_terminated" Request terminated. conversations/lib/enums/reasonMessages.ts:43
REQUEST_TIMEOUT "request_timeout" Request timeout. conversations/lib/enums/reasonMessages.ts:58
SERVER_INTERNAL_ERROR "server_internal_error" Internal server error. conversations/lib/enums/reasonMessages.ts:88
SERVER_TIMEOUT "server_timeout" Server timeout. conversations/lib/enums/reasonMessages.ts:98
SERVICE_UNAVAILABLE "service_unavailable" Service is unavailable. conversations/lib/enums/reasonMessages.ts:108
TEMPORARILY_UNAVAILABLE "temporarily_unavailable" Temporarily unavailable. conversations/lib/enums/reasonMessages.ts:63
TIMEOUT "timeout" Operation timed out. conversations/lib/enums/reasonMessages.ts:18
VERSION_NOT_SUPPORTED "version_not_supported" Version not supported. conversations/lib/enums/reasonMessages.ts:103

Classes

Conversations

A client for talking to the Vonage Conversation API.

Examples

Create a standalone Conversation client

import { Conversations } from '@vonage/conversation';

const conversationClient = new Conversations({
  applicationId: VONAGE_APPLICATION_ID,
  privateKey: VONAGE_APPLICATION_PRIVATE_KEY_PATH,
});

Create an Conversation client from the Vonage client

import { Vonage } from '@vonage/server-client';

const vonage = new Vonage({
  applicationId: VONAGE_APPLICATION_ID,
  privateKey: VONAGE_APPLICATION_PRIVATE_KEY_PATH,
});

const conversationClient = vonage.conversations

Extends

Constructors

new Conversations()
new Conversations(credentials, options?): Conversations

Creates a new instance of the Client.

Parameters

credentials: AuthInterface | AuthParams

The authentication credentials or an authentication instance.

options?: ConfigParams

Optional configuration settings for the client.

Returns

Conversations

Inherited from

Client.constructor

Defined in

server-client/dist/client.d.ts:30

Properties

auth
protected auth: AuthInterface;

The authentication instance responsible for generating authentication headers and query parameters.

Inherited from

Client.auth

Defined in

server-client/dist/client.d.ts:19

authType
authType: AuthenticationType = AuthenticationType.JWT;

The type of authentication used for the client's requests.

Overrides

Client.authType

Defined in

conversations/lib/conversations.ts:171

config
protected config: ConfigParams;

Configuration settings for the client, including default hosts for various services and other request settings.

Inherited from

Client.config

Defined in

server-client/dist/client.d.ts:23

transformers
static transformers: __module;

Static property containing utility transformers.

Inherited from

Client.transformers

Defined in

server-client/dist/client.d.ts:11

Methods

addAuthenticationToRequest()
addAuthenticationToRequest(request): Promise<VetchOptions>

Adds the appropriate authentication headers or parameters to the request based on the authentication type.

Parameters

request: VetchOptions

The request options to which authentication needs to be added.

Returns

Promise<VetchOptions>

  • The request options with the added authentication.
Inherited from

Client.addAuthenticationToRequest

Defined in

server-client/dist/client.d.ts:37

createConversation()
createConversation(conversation): Promise<Conversation>

Creates a new conversation with the provided details.

Parameters

conversation: Conversation

The conversation details to be created.

Returns

Promise<Conversation>

  • A promise resolving to the created conversation.
See

API Specification https://developer.vonage.com/en/api/conversation#createConversation

Example

Create a new conversation

const conversation = await conversationClient.createConversation({
  name: 'My Conversation',
});

console.log(conversation.id);
Defined in

conversations/lib/conversations.ts:270

createEvent()
createEvent(conversationId, event): Promise<Event>

Creates a new event with the provided details.

Parameters

conversationId: string

The conversation id to create the event in.

event: Event

The event details to be created.

Returns

Promise<Event>

  • A promise resolving to the created event.
See

API Specification https://developer.vonage.com/en/api/event#createEvent

Example

Create a new event

const event = await eventClient.createEvent({
  name: 'My Event',
});

console.log(event.id);
Defined in

conversations/lib/conversations.ts:803

createMember()
createMember(conversationId, member): Promise<Member>

Creates a new member with the provided details.

Parameters

conversationId: string

The conversation id to create the member in.

member: Member

The member details to be created.

Returns

Promise<Member>

  • A promise resolving to the created member.
See

API Specification https://developer.vonage.com/en/api/conversation#createMember

Example

Create a new member

const member = await memberClient.createMember(
  CONVERSATION_ID,
  {
    name: 'My Member',
  },
);

console.log(member.id);
Defined in

conversations/lib/conversations.ts:574

deleteConversation()
deleteConversation(conversationId): Promise<void>

Deletes an conversation by its unique identifier.

Parameters

conversationId: string

The unique identifier of the conversation to delete.

Returns

Promise<void>

  • A promise indicating the successful deletion of the conversation.
See

API Specification https://developer.vonage.com/en/api/conversation#deleteConversation

Example

Delete an conversation

await conversationClient.deleteConversation(conversation_ID);
Defined in

conversations/lib/conversations.ts:351

deleteEvent()
deleteEvent(conversationId, eventId): Promise<void>

Deletes an event by its unique identifier.

Parameters

conversationId: string

The conversation id to delete the event from.

eventId: string

The unique identifier of the conversation to delete.

Returns

Promise<void>

  • A promise indicating the successful deletion of the event.
See

API Specification https://developer.vonage.com/en/api/event#deleteEvent

Example

Delete an event

await eventClient.deleteEvent(conversation_ID);
Defined in

conversations/lib/conversations.ts:836

getConversation()
getConversation(conversationId): Promise<Conversation>

Retrieves an conversation by its unique identifier.

Parameters

conversationId: string

The unique identifier of the conversation to retrieve.

Returns

Promise<Conversation>

  • A promise resolving to the retrieved conversation.
See

API Specification https://developer.vonage.com/en/api/conversation#getConversation

Example

Retrieve an conversation

const conversation = await conversationClient.getConversation(conversation_ID);
console.log(conversation.name);
Defined in

conversations/lib/conversations.ts:297

getConversationPage()
getConversationPage(filter): Promise<ConversationPage>

Retrieves a page of conversations based on filter parameters.

Parameters

filter: ListConversationsParameters

The filter parameters for pagination.

Returns

Promise<ConversationPage>

  • A promise resolving to a page of conversations.
See

API Specification https://developer.vonage.com/en/api/conversation#listConversation

Example

Get a single page of conversations

const conversations = await conversationClient.getConversationPage({
  page: 1,
  size: 10
});

conversations.conversations.forEach(conversation => {
  console.log(conversation.name);
});
Defined in

conversations/lib/conversations.ts:227

getEvent()
getEvent(conversationId, eventId): Promise<Event>

Retrieves an event by its unique identifier.

Parameters

conversationId: string

The conversation id to retrieve the event from.

eventId: string

The unique identifier of the event to retrieve.

Returns

Promise<Event>

  • A promise resolving to the retrieved event.
See

API Specification https://developer.vonage.com/en/api/conversation#getEvent

Example

Retrieve an event

const event = await eventClient.getEvent(CONVERSATION_ID, event_ID);
console.log(event.name);
Defined in

conversations/lib/conversations.ts:772

getEventPage()
getEventPage(conversationId, filter): Promise<EventPage>

Retrieves a page of events based on filter parameters.

Parameters

conversationId: string

The conversation id to retrieve events from.

filter: ListEventParameters

The filter parameters for pagination.

Returns

Promise<EventPage>

  • A promise resolving to a page of events.
See

API Specification https://developer.vonage.com/en/api/event#listEvent

Example

Get a single page of events

const events = await eventClient.getEventPage({
  page: 1,
  size: 10
});

events.events.forEach(event => {
  console.log(event.name);
});
Defined in

conversations/lib/conversations.ts:734

getMe()
getMe(conversationId): Promise<Member>

This retrieves the member associated with the sub claim on the JWT

Parameters

conversationId: string

The conversation id to retrieve the member from.

Returns

Promise<Member>

  • A promise resolving to the retrieved member.
See

API Specification https://developer.vonage.com/en/api/conversation#getMe

Example

Retrieve an member

const member = await memberClient.getMe(CONVERSATION_ID);
console.log(member.name);
Defined in

conversations/lib/conversations.ts:630

getMember()
getMember(conversationId, memberId): Promise<Member>

Retrieves an member by its unique identifier.

Parameters

conversationId: string

The conversation id to retrieve the member from.

memberId: string

The unique identifier of the member to retrieve.

Returns

Promise<Member>

  • A promise resolving to the retrieved member.
See

API Specification https://developer.vonage.com/en/api/conversation#getMember

Example

Retrieve an member

const member = await memberClient.getMember(CONVERSATION_ID, MEMBER_ID);
console.log(member.name);
Defined in

conversations/lib/conversations.ts:603

getMemberPage()
getMemberPage(conversationId, filter): Promise<MemberPage>

Retrieves a page of members in a conversation based on filter parameters.

Parameters

conversationId: string

The conversation id to retrieve members from.

filter: ListMemberParameters = {}

The filter parameters for pagination.

Returns

Promise<MemberPage>

  • A promise resolving to a page of members.
See

API Specification https://developer.vonage.com/en/api/conversation#listMember

Example

Get a single page of members

const members = await memberClient.getMemberPage(
  CONVERSATION_ID,
  {
    page: 1,
    size: 10
  }
);

members.members.forEach(member => {
  console.log(member.name);
});
Defined in

conversations/lib/conversations.ts:533

getUserSessionsPage()
getUserSessionsPage(userId, filter): Promise<SessionPage>

Retrieves a page of sessions based on filter parameters.

Parameters

userId: string

The user id to retrieve sessions from.

filter: ListSessionParameters

The filter parameters for pagination.

Returns

Promise<SessionPage>

  • A promise resolving to a page of sessions.
See

API Specification https://developer.vonage.com/en/api/session#listSession

Example

Get a single page of sessions

const sessions = await conversationClient.getUserSessionPage(
  USER_ID,
  {
    page: 1,
    size: 10
  }
);

sessions.sessions.forEach(session => {
  console.log(session.id);
});
Defined in

conversations/lib/conversations.ts:454

listAllConversations()
listAllConversations(params?): AsyncGenerator<Conversation, void & Conversation, undefined>

Retrieves all conversations, iterating over paginated results.

Parameters

params?: ListConversationsParameters = {}

Optional filter parameters.

Returns

AsyncGenerator<Conversation, undefined>

  • An asynchronous generator.
Yields
  • Yields conversation items.
Example

List conversations with pagination using an iterator

for await (const conversation of conversationClient.listAllConversations()) {
  console.log(conversation.name);
}
Defined in

conversations/lib/conversations.ts:189

listAllEvents()
listAllEvents(conversationId, params?): AsyncGenerator<Event, void & Event, undefined>

Retrieves all events, iterating over paginated results.

Parameters

conversationId: string

The conversation id to retrieve events from.

params?: ListEventParameters = {}

Optional filter parameters.

Returns

AsyncGenerator<Event, undefined>

  • An asynchronous generator.
Yields
  • Yields event items.
Example

List events with pagination using an iterator

for await (const event of eventClient.listAllEvents()) {
  console.log(event.name);
}
Defined in

conversations/lib/conversations.ts:694

listAllMembers()
listAllMembers(conversationId, params?): AsyncGenerator<Member, void & Member, undefined>

Retrieves all members, iterating over paginated results.

Parameters

conversationId: string

The conversation id to retrieve members from.

params?: ListMemberParameters = {}

Optional filter parameters.

Returns

AsyncGenerator<Member, undefined>

  • An asynchronous generator.
Yields
  • Yields member items.
Example

List members with pagination using an iterator

for await (const member of memberClient.listAllMembers(CONVERSATION_ID)) {
  console.log(member.name);
}
Defined in

conversations/lib/conversations.ts:490

listAllUserConversations()
listAllUserConversations(userId, params?): AsyncGenerator<Conversation, void & Conversation, undefined>

Retrieves all conversations, for a user

Parameters

userId: string

The user id to retrieve conversations from.

params?: ListConversationsParameters = {}

Optional filter parameters.

Returns

AsyncGenerator<Conversation, undefined>

  • An asynchronous generator.
Yields
  • Yields conversation items.
Example

List conversations with pagination using an iterator

for await (const conversation of conversationClient.listAllUserConversations(USER_ID)) {
  console.log(conversation.name);
}
Defined in

conversations/lib/conversations.ts:374

listAllUserSessions()
listAllUserSessions(userId, params?): AsyncGenerator<Session, void & Session, undefined>

Retrieves all session, for a user

Parameters

userId: string

The user id to retrieve sessions from.

params?: ListSessionParameters = {}

Optional filter parameters.

Returns

AsyncGenerator<Session, undefined>

  • An asynchronous generator.
Yields
  • Yields session items.
Example

List sessions with pagination using an iterator

for await (const session of conversationClient.listAllUserSessions(USER_ID)) {
  console.log(session.id);
}
Defined in

conversations/lib/conversations.ts:411

parseResponse()
protected parseResponse<T>(request, response): Promise<VetchResponse<T>>

Parses the response based on its content type.

Type Parameters

T

The expected type of the parsed response data.

Parameters

request: VetchOptions

The request options.

response: Response

The raw response from the request.

Returns

Promise<VetchResponse<T>>

  • The parsed response.
Inherited from

Client.parseResponse

Defined in

server-client/dist/client.d.ts:134

prepareBody()
protected prepareBody(request): undefined | string

Prepares the body for the request based on the content type.

Parameters

request: VetchOptions

The request options.

Returns

undefined | string

  • The prepared request body as a string or undefined.
Inherited from

Client.prepareBody

Defined in

server-client/dist/client.d.ts:124

prepareRequest()
protected prepareRequest(request): Promise<VetchOptions>

Prepares the request with necessary headers, authentication, and query parameters.

Parameters

request: VetchOptions

The initial request options.

Returns

Promise<VetchOptions>

  • The modified request options.
Inherited from

Client.prepareRequest

Defined in

server-client/dist/client.d.ts:117

sendDeleteRequest()
sendDeleteRequest<T>(url): Promise<VetchResponse<T>>

Sends a DELETE request to the specified URL.

Type Parameters

T

Parameters

url: string

The URL endpoint for the DELETE request.

Returns

Promise<VetchResponse<T>>

  • The response from the DELETE request.
Inherited from

Client.sendDeleteRequest

Defined in

server-client/dist/client.d.ts:44

sendFormSubmitRequest()
sendFormSubmitRequest<T>(url, payload?): Promise<VetchResponse<T>>

Sends a POST request with form data to the specified URL.

Type Parameters

T

Parameters

url: string

The URL endpoint for the POST request.

payload?: Record<string, string>

Optional payload containing form data to send with the POST request.

Returns

Promise<VetchResponse<T>>

  • The response from the POST request.
Inherited from

Client.sendFormSubmitRequest

Defined in

server-client/dist/client.d.ts:52

sendGetRequest()
sendGetRequest<T>(url, queryParams?): Promise<VetchResponse<T>>

Sends a GET request to the specified URL with optional query parameters.

Type Parameters

T

Parameters

url: string

The URL endpoint for the GET request.

queryParams?

Optional query parameters to append to the URL. These should be compatible with Node's URLSearchParams.

Returns

Promise<VetchResponse<T>>

  • The response from the GET request.
Inherited from

Client.sendGetRequest

Defined in

server-client/dist/client.d.ts:60

sendPatchRequest()
sendPatchRequest<T>(url, payload?): Promise<VetchResponse<T>>

Sends a PATCH request to the specified URL with an optional payload.

Type Parameters

T

Parameters

url: string

The URL endpoint for the PATCH request.

payload?

Optional payload to be sent as the body of the PATCH request.

Returns

Promise<VetchResponse<T>>

  • The response from the PATCH request.
Inherited from

Client.sendPatchRequest

Defined in

server-client/dist/client.d.ts:70

sendPostRequest()
sendPostRequest<T>(url, payload?): Promise<VetchResponse<T>>

Sends a POST request to the specified URL with an optional payload.

Type Parameters

T

Parameters

url: string

The URL endpoint for the POST request.

payload?

Optional payload to be sent as the body of the POST request.

Returns

Promise<VetchResponse<T>>

  • The response from the POST request.
Inherited from

Client.sendPostRequest

Defined in

server-client/dist/client.d.ts:80

sendPutRequest()
sendPutRequest<T>(url, payload?): Promise<VetchResponse<T>>

Sends a PUT request to the specified URL with an optional payload.

Type Parameters

T

Parameters

url: string

The URL endpoint for the PUT request.

payload?

Optional payload to be sent as the body of the PUT request.

Returns

Promise<VetchResponse<T>>

  • The response from the PUT request.
Inherited from

Client.sendPutRequest

Defined in

server-client/dist/client.d.ts:90

sendRequest()
sendRequest<T>(request): Promise<VetchResponse<T>>

Sends a request adding necessary headers, handling authentication, and parsing the response.

Type Parameters

T

Parameters

request: VetchOptions

The options defining the request, including URL, method, headers, and data.

Returns

Promise<VetchResponse<T>>

  • The parsed response from the request.
Inherited from

Client.sendRequest

Defined in

server-client/dist/client.d.ts:110

sendRequestWithData()
sendRequestWithData<T>(
   method, 
   url, 
payload?): Promise<VetchResponse<T>>

Sends a request with JSON-encoded data to the specified URL using the provided HTTP method.

Type Parameters

T

Parameters

method: POST | PUT | PATCH

The HTTP method to be used for the request (only POST, PATCH, or PUT are acceptable).

url: string

The URL endpoint for the request.

payload?

Optional payload to be sent as the body of the request, JSON-encoded.

Returns

Promise<VetchResponse<T>>

  • The response from the request.
Inherited from

Client.sendRequestWithData

Defined in

server-client/dist/client.d.ts:101

updateConversation()
updateConversation(conversation): Promise<Conversation>

Updates an existing conversation with the provided details.

Parameters

conversation: Conversation

The conversation details to be updated.

Returns

Promise<Conversation>

  • A promise resolving to the updated conversation.
See

API Specification https://developer.vonage.com/en/api/conversation#updateConversation

Example

Update an conversation

const conversation = await conversationClient.updateConversation({
  id: conversation_ID,
  name: 'My Conversation',
});
console.log(conversation.name);
Defined in

conversations/lib/conversations.ts:326

updateMember()
updateMember(
   conversationId, 
   memberId, 
params): Promise<Member>

Updates an existing member with the provided details.

Setting the state to left will result in the member leaving the conversation.

Parameters

conversationId: string

The conversation id to update the member in.

memberId: string

The member details to be updated.

params: UpdateMemberParameters

The update parameters.

Returns

Promise<Member>

  • A promise resolving to the updated member.
See

API Specification https://developer.vonage.com/en/api/conversation#updateMember

Example
import { MemberState } from '@vonage/conversation';

const member = await memberClient.updateMember(
  CONVERSATION_ID,
  MEMBER_ID,
  {
    state: MemberState.LEFT,
    from: USER_ID,
  },
);

console.log(member.name);
Defined in

conversations/lib/conversations.ts:664

Type Aliases

ASRResult

type ASRResult: object;

Type declaration

confidence
confidence: number;

Confidence of the word

word
word: string;

Word recognized

Defined in

conversations/lib/types/messageASRBody.ts:3


AnyChannel

type AnyChannel: 
  | PhoneNumberChannel
  | SipChannel
  | AppChannel
  | WebSocketChannel
  | VbcChannel;

Defined in

conversations/lib/types/anyChannel.ts:7


AnyMessageBody

type AnyMessageBody: 
  | MessageASRBody
  | MessageChannelBody
  | MessageConversationBody
  | MessageCustomBody
  | MessageEventBody
  | MessageFileBody
  | MessageImageBody
  | MessageLegBody
  | MessageLocationBody
  | MessageMemberBody
  | MessageRTCAnswerBody
  | MessageRTCIdBody
  | MessageRecordBody
  | MessageRecordIdBody
  | MessageSIPDirectionBody
  | MessageSIPHangupBody
  | MessageSIPMachineBody
  | MessageSIPStatusBody
  | MessageSayBody
  | MessageSayIdBody
  | MessageStatusBody
  | MessageTemplateBody
  | MessageTextBody
  | MessageVCardBody
  | MessageVideoBody
  | MessageAudioBody;

Defined in

conversations/lib/types/anyMessageBody.ts:29


AnyMessageBodyResponse

type AnyMessageBodyResponse: { [P in keyof AnyMessageBody as SnakeToCamelCase<P>]: AnyMessageBody[P] };

Defined in

conversations/lib/types/responses/eventResponse.ts:14


AppChannel

type AppChannel: object;

Type representing an app channel.

Type declaration

type
type: ChannelType.APP;

The type of channel (app).

user
user: string;

The app user.

Defined in

conversations/lib/types/appChannel.ts:6


AudioSettings

type AudioSettings: object;

Type representing audio settings.

Type declaration

earmuffed
earmuffed: boolean;

Indicates whether audio is earmuffed.

enabled
enabled: boolean;

Indicates whether audio is enabled.

muted
muted: boolean;

Indicates whether audio is muted.

Defined in

conversations/lib/types/audioSettings.ts:4


AudioSettingsRequest

type AudioSettingsRequest: object;

Type declaration

audio
audio: boolean;

Indicates whether audio is active.

earmuffed
earmuffed: boolean;

Indicates whether audio is earmuffed.

enabled
enabled: boolean;

Indicates whether audio is enabled.

muted
muted: boolean;

Indicates whether audio is muted.

Defined in

conversations/lib/types/requests/createMemberRequest.ts:4


AudioSettingsResponse

type AudioSettingsResponse: object;

Type declaration

audio
audio: boolean;

Indicates whether audio is active.

earmuffed
earmuffed: boolean;

Indicates whether audio is earmuffed.

enabled
enabled: boolean;

Indicates whether audio is enabled.

muted
muted: boolean;

Indicates whether audio is muted.

Defined in

conversations/lib/types/responses/memberResponse.ts:6


Conversation

type Conversation: object;

Represents a conversation

Type declaration

callback?
optional callback: ConversationCallback;

Callback information (optional).

Remarks

This is not set when fetching a converstion from the API.

displayName?
optional displayName: string;

The public-facing name of the conversation.

id?
readonly optional id: string;

The unique identifier for this conversation.

imageUrl?
optional imageUrl: string;

An image URL associated with the conversation.

name?
optional name: string;

Your internal conversation name. Must be unique.

numbers?
optional numbers: AnyChannel[];

Communication channels (optional).

Remarks

This is not set when fetching a converstion from the API.

properties?
optional properties: object;

The conversation's properties

properties.customData
properties.customData: Record<string, unknown>;

Custom key-value pairs to be included with the conversation.

properties.customSortKey
properties.customSortKey: string;

The conversation's custom sort key.

properties.ttl?
optional properties.ttl: number;

The conversation's time to leave.

After how many seconds the conversation is deleted.

properties.type
properties.type: string;

The conversation's type.

sequenceNumber?
readonly optional sequenceNumber: number;

The last Event ID in this conversation.

This ID can be used to retrieve a specific event.

state?
optional state: ConversationState;

The conversation's state.

status?
readonly optional status: ConversationState;

The conversation's status.

timestamp?
readonly optional timestamp: object;

Timestamps for when the conversation was created, updated, and destroyed.

timestamp.created?
readonly optional timestamp.created: string;

The time the conversation was created.

timestamp.destroyed?
readonly optional timestamp.destroyed: string;

The time the conversation was destroyed (if applicable).

timestamp.updated?
readonly optional timestamp.updated: string;

The time the conversation was last updated.

Defined in

conversations/lib/types/conversation.ts:8


ConversationCallback

type ConversationCallback: object;

Type representing a callback object in a conversation request.

Type declaration

eventMask?
optional eventMask: string;

The event mask for the callback.

method?
optional method: "POST" | "GET";

The callback method.

params?
optional params: object;

Callback parameters.

params.applicationId?
optional params.applicationId: string;

The application ID for the callback.

params.nccoUrl?
optional params.nccoUrl: string;

The NCCO URL for the callback.

url?
optional url: string;

The callback URL.

Defined in

conversations/lib/types/conversationCallback.ts:5


ConversationCallbackRequest

type ConversationCallbackRequest: object;

Type representing a callback object in a conversation request.

Type declaration

event_mask?
optional event_mask: string;

The event mask for the callback.

method
method: "POST" | "GET";

The callback method.

params?
optional params: object;

Callback parameters.

params.application_id
params.application_id: string;

The application ID for the callback.

params.ncco_url
params.ncco_url: string;

The NCCO URL for the callback.

url?
optional url: string;

The callback URL.

Defined in

conversations/lib/types/requests/conversationCallbackRequest.ts:4


ConversationPage

type ConversationPage: object;

A page of conversations.

Type declaration

conversations
conversations: Conversation[];

Conversations for the page.

links?
optional links: Record<string, APILink>;

HAL links for the page.

pageSize
pageSize: number;

How many items are in the page.

Defined in

conversations/lib/types/conversationPage.ts:7


ConversationPageResponse

type ConversationPageResponse: object & APILinks;

Represents the response for listing conversations retrieved from the API.

Type declaration

_embedded
_embedded: object;

Embedded data containing a list of conversations.

_embedded.conversations
_embedded.conversations: ConversationResponse[];
page_size
page_size: number;

The number of records returned in this response.

Defined in

conversations/lib/types/responses/conversationPageResponse.ts:7


ConversationResponse

type ConversationResponse: object & Omit<Conversation, "sequenceNumber" | "displayName" | "imageUrl" | "properties"> & APILinks;

Represents a conversation as it is returned from the API.

Type declaration

display_name?
optional display_name: string;

The public-facing name of the conversation.

image_url?
optional image_url: string;

An image URL associated with the conversation.

properties?
optional properties: object;

The conversation's properties

properties.custom_data
properties.custom_data: Record<string, unknown>;

Custom key-value pairs to be included with the conversation.

properties.custom_sort_key
properties.custom_sort_key: string;

The conversation's custom sort key.

properties.ttl?
optional properties.ttl: number;

The conversation's time to leave.

After how many seconds the conversation is deleted.

properties.type
properties.type: string;

The conversation's type.

sequence_number
sequence_number: number;

The last Event ID in this conversation. This ID can be used to retrieve a specific event.

Defined in

conversations/lib/types/responses/conversationResponse.ts:7


CreateConversationRequest

type CreateConversationRequest: object;

Type representing a request to create a conversation.

Type declaration

callback?
optional callback: ConversationCallbackRequest;

Callback information (optional).

display_name
display_name: string;

The public-facing name of the conversation.

image_url
image_url: string;

An image URL associated with the conversation.

name
name: string;

Your internal conversation name.

numbers?
optional numbers: (
  | PhoneNumberChannel
  | SipChannel
  | AppChannel
  | WebSocketChannel
  | VbcChannel)[];

Communication channels (optional).

properties?
optional properties: object;

Conversation properties (optional).

properties.custom_data?
optional properties.custom_data: Record<string, unknown>;

Custom data as key-value pairs (optional).

properties.custom_sort_key?
optional properties.custom_sort_key: string;

Custom sort key (optional).

properties.ttl?
optional properties.ttl: number;

Time to leave in seconds for an empty conversation (optional).

properties.type?
optional properties.type: string;

Custom conversation type (optional).

Defined in

conversations/lib/types/requests/createConversationRequest.ts:11


CreateEventRequest

type CreateEventRequest: object & Pick<Event, "type" | "from">;

Type declaration

body
body: AnyMessageBodyResponse;

Defined in

conversations/lib/types/requests/createEventRequest.ts:4


CreateMemberRequest

type CreateMemberRequest: object;

A Member as its sent to the API

Type declaration

channel
channel: AnyChannel;

The channel associated with the member.

from
from: string;

The user who invited the member.

knocking_id
knocking_id: string;

The knocking ID for the member.

media
media: object;

Media-related information for the member.

media.audio
media.audio: boolean;

Indicates whether the member has audio.

media.audio_settings
media.audio_settings: AudioSettingsRequest;

Audio settings for the member.

member_id_inviting
member_id_inviting: string;

The member who invited the member.

state
state: MemberState;

The member's state

user
user: object;

The matching user for this member.

user.id
user.id: string;

The user's ID.

user.name
user.name: string;

The user's name.

Defined in

conversations/lib/types/requests/createMemberRequest.ts:29


Event

type Event: object;

Type declaration

body
body: AnyMessageBody;

Data of the event.

from
from: string;

Member ID of the event.

fromMember?
optional fromMember: object;

Sender Memeber

fromMember.id
fromMember.id: string;

Member ID

fromUser?
optional fromUser: EventUser;

Sender User

id
id: number;

The ID of the message.

timestamp?
optional timestamp: string;

Timestamp of the event.

type
type: EventType;

Message type

Defined in

conversations/lib/types/event.ts:5


EventPage

type EventPage: object;

Type declaration

events
events: Event[];

Embedded events.

links?
optional links: Record<string, APILink>;

Links to other resources.

pageSize
pageSize: number;

The number of items returned on this page.

Defined in

conversations/lib/types/eventPage.ts:4


EventPageResponse

type EventPageResponse: object & APILinks;

Type declaration

_embedded
_embedded: EventResponse[];

Embedded events.

page_size
page_size: number;

The number of items returned on this page.

Defined in

conversations/lib/types/responses/eventPageResponse.ts:4


EventResponse

type EventResponse: object & Omit<Event, "fromUser" | "body" | "fromMember"> & APILinks;

Type declaration

_embedded
_embedded: object;
_embedded.from_member
_embedded.from_member: object;
_embedded.from_member.id
_embedded.from_member.id: string;
_embedded.from_user
_embedded.from_user: EventUserResponse;
body
body: AnyMessageBodyResponse;

Defined in

conversations/lib/types/responses/eventResponse.ts:18


EventUser

type EventUser: object;

Type declaration

customData?
optional customData: Record<string, unknown>;

The user's custom data.

displayName
displayName: string;

The user's display name.

id
id: string;

The user's ID.

imageUrl?
optional imageUrl: string;

The user's avatar URL.

name
name: string;

The user's name.

Defined in

conversations/lib/types/eventUser.ts:1


EventUserResponse

type EventUserResponse: object & Omit<EventUser, "displayName">;

Type declaration

display_name
display_name: string;

Defined in

conversations/lib/types/responses/eventResponse.ts:10


InitiatorInvited

type InitiatorInvited: object;

Type declaration

invited
invited: object;

Details about the initiator when the member invited.

invited.isSystem
invited.isSystem: boolean;

true if the user was invited by an admin JWT

Defined in

conversations/lib/types/member.ts:31


InitiatorInvitedResponse

type InitiatorInvitedResponse: object;

Type representing the invited initiator as its returned from the API.

Type declaration

invited
invited: object;

Details about the initiator when the member invited.

invited.is_system
invited.is_system: boolean;

true if the user was invited by an admin JWT

Defined in

conversations/lib/types/responses/memberResponse.ts:56


InitiatorJoined

type InitiatorJoined: object;

Type representing the joined initiator.

Type declaration

joined
joined: object;

Details about the initiator when the member joined.

joined.isSystem
joined.isSystem: boolean;

true if the user was invited by an admin JWT

joined.memberId
joined.memberId: string;

The member ID of the initiator.

joined.userId
joined.userId: string;

The user ID of the initiator.

Defined in

conversations/lib/types/member.ts:9


InitiatorJoinedResponse

type InitiatorJoinedResponse: object;

Type representing the joined initiator as its returned from the API.

Type declaration

joined
joined: object;

Details about the initiator when the member joined.

joined.is_system
joined.is_system: boolean;

true if the user was invited by an admin JWT

joined.member_id
joined.member_id: string;

The member ID of the initiator.

joined.user_id
joined.user_id: string;

The user ID of the initiator.

Defined in

conversations/lib/types/responses/memberResponse.ts:31


LegState

type LegState: object;

Type declaration

reason?
optional reason: ReasonCode;

Reason code of the message leg

status
status: LegStatus;

Status of the message leg

succssful?
optional succssful: boolean;

If the leg is successful

Defined in

conversations/lib/types/messageLegBody.ts:5


ListConversationsParameters

type ListConversationsParameters: object;

Represents the query parameters for listing conversations.

Type declaration

byUser?
optional byUser: string;

Return the records that were created by this user.

cursor?
optional cursor: string;

The cursor to start returning results from. You are not expected to provide this manually but to follow the URL provided in _links.next.href or _links.prev.href in the response which contains a cursor value.

Remarks

When using the generator from the client, this is handled for you.

dateEnd?
optional dateEnd: string;

Return the records that occurred before this point in time.

dateStart?
optional dateStart: string;

Return the records that occurred after this point in time.

includeCustomData?
optional includeCustomData: boolean;

Include custom data for the conversation

order?
optional order: "asc" | "desc";

Return the records in ascending or descending order. Must be one of: 'asc', 'desc'.

pageSize?
optional pageSize: number;

Return this amount of records in the response.

Defined in

conversations/lib/types/parameters/listConversationsParameters.ts:4


ListEventParameters

type ListEventParameters: object;

List Event Parameters

Type declaration

cursor?
optional cursor: string;

The cursor to start returning results from. You are not expected to provide this manually, but to follow the URL provided in _links.next.href or _links.prev.href in the response which contains a cursor value.

endId?
optional endId: string;

The ID to end returning events at.

eventType?
optional eventType: string;

The type of event to search for. Does not currently support custom events.

excludeDeletedEvents?
optional excludeDeletedEvents: boolean;

Exclude deleted events.

order?
optional order: "asc" | "desc";

Return the records in ascending or descending order. Must be one of: 'asc', 'desc'.

pageSize?
optional pageSize: number;

Return this amount of records in the response.

startId?
optional startId: string;

The ID to start returning events at.

Defined in

conversations/lib/types/parameters/listEventParameters.ts:4


ListMemberParameters

type ListMemberParameters: object;

Type declaration

cursor?
optional cursor: string;

Return the records starting from this cursor

You are not expected to provide this manually, but to follow the url provided in _links.next.href or _links.prev.href in the response which contains a cursor value.

order?
optional order: "asc" | "desc";

Return the records in ascending or descending order

pageSize?
optional pageSize: number;

Return this number of members

Defined in

conversations/lib/types/parameters/listMemberParameters.ts:1


ListMemberResponse

type ListMemberResponse: object & APILinks;

A Mmbmer as its returned from the API in the listMembers

Type declaration

_embedded
_embedded: object;
_embedded.user
_embedded.user: MemberUserResponse;

The matching user for this member.

id
id: string;

The member's id

state
state: MemberState;

The member's state

Defined in

conversations/lib/types/responses/listMemberResponse.ts:9


ListSessionParameters

type ListSessionParameters: object;

Type declaration

cursor?
optional cursor: string;

The cursor to start returning results from.

You are not expected to provide this manually but to follow the URL provided in _links.next.href or _links.prev.href in the response which contains a cursor value.

Remarks

When using the generator from the client, this is handled for you.

order?
optional order: "asc" | "desc";

Return the records in ascending or descending order.

pageSize?
optional pageSize: number;

Return the records per page

Defined in

conversations/lib/types/parameters/listSessionParameters.ts:1


Member

type Member: object;

Type representing a member in a conversation.

Type declaration

channel?
optional channel: AnyChannel;

The channel associated with the member.

conversationId?
optional conversationId: string;
id?
optional id: string;

The unique ID of the member.

initiator?
optional initiator: InitiatorJoined | InitiatorInvited;

The initiator of the member's joining.

invitedBy
invitedBy: string;

The user who invited the member.

knockingId
knockingId: string;

The knocking ID for the member.

media?
optional media: object;

Media-related information for the member.

media.audio
media.audio: boolean;

Indicates whether audio is active.

media.audioSettings
media.audioSettings: AudioSettings;

Audio settings for the member.

state?
optional state: MemberState;

The state of the member (INVITED, JOINED, LEFT, UNKNOWN).

timestamp?
optional timestamp: object;

Timestamps for various states of the member.

timestamp.invited
timestamp.invited: string;

Timestamp when the member was invited.

timestamp.joined
timestamp.joined: string;

Timestamp when the member joined.

timestamp.left
timestamp.left: string;

Timestamp when the member left.

user
user: UserType;

The user associated with the member.

Remarks

Either the user id or name is required.

Defined in

conversations/lib/types/member.ts:46


MemberPage

type MemberPage: object;

Type declaration

links?
optional links: Record<string, APILink>;

HAL links for the page.

members
members: Member[];

The list of members.

pageSize
pageSize: number;

The list of members.

Defined in

conversations/lib/types/memberPage.ts:4


MemberPageResponse

type MemberPageResponse: object & APILinks;

Type declaration

_embedded
_embedded: object;

HAL Page response

_embedded.members
_embedded.members: ListMemberResponse[];

The members in the page.

page_size
page_size: number;

Number of members in the page.

Defined in

conversations/lib/types/responses/memberPageResponse.ts:5


MemberResponse

type MemberResponse: object & APILinks;

A Mmbmer as its returned from the API

Type declaration

_embedded
_embedded: object;
_embedded.user
_embedded.user: MemberUserResponse;

The matching user for this member.

channel
channel: AnyChannel;

The channel associated with the member.

id
id: string;

The member's id

initiator
initiator: InitiatorJoinedResponse | InitiatorInvitedResponse;

The initiator of the member's joining.

invited_by
invited_by: string;

The user who invited the member.

knocking_id
knocking_id: string;

The knocking ID for the member.

media
media: object;

Media-related information for the member.

media.audio
media.audio: boolean;

Indicates whether audio is active.

media.audio_settings
media.audio_settings: AudioSettingsResponse;

Audio settings for the member.

state
state: MemberState;

The member's state

timestamp
timestamp: object;

Timestamps for various states of the member.

timestamp.invited
timestamp.invited: string;

Timestamp when the member was invited.

timestamp.joined
timestamp.joined: string;

Timestamp when the member joined.

timestamp.left
timestamp.left: string;

Timestamp when the member left.

Defined in

conversations/lib/types/responses/memberResponse.ts:71


MemberUserResponse

type MemberUserResponse: object & APILinks;

The user as its returned from the API

Type declaration

display_name
display_name: string;

A string to be displayed for the user. This does not have to be unique.

id
id: string;

The user's id

name
name: string;

The Unique name for the user

Defined in

conversations/lib/types/responses/memberUserResponse.ts:6


MessageASRBody

type MessageASRBody: object;

Type declaration

asr
asr: object;

ASR Result

asr.asrId
asr.asrId: string;

ASR Id

asr.callId
asr.callId: string;

ASR Call Id

asr.endTime?
optional asr.endTime: string;

ASR End Time

Remarks

Present only when recording is done

asr.error
asr.error: string;

ASR Error

asr.format?
optional asr.format: string;

ASR Audio Format

Remarks

Present only when recording is done

asr.mediaServiceUUID?
optional asr.mediaServiceUUID: string;

ASR Media Service UUID

Remarks

Present only when recording is done

asr.result?
optional asr.result: ASRResult[];

ASR Results

Remarks

Present only when recording is happening

asr.size?
optional asr.size: number;

ASR File size

Remarks

Present only when recording is done

asr.startTime?
optional asr.startTime: string;

ASR Start Time

Remarks

Present only when recording is done

asr.timeoutReason?
optional asr.timeoutReason: string;

ASR Timeout Reason

Remarks

Present only when recording is happening

channel
channel: MessageChannelBody;

Channel Information

Defined in

conversations/lib/types/messageASRBody.ts:15


MessageAudioBody

type MessageAudioBody: object;

Type declaration

audio
audio: object;

Message audio

audio.url
audio.url: string;

Audio URL

messageType
messageType: EventMessageType.AUDIO;

Message type

Defined in

conversations/lib/types/messageAudioBody.ts:3


MessageChannelBody

type MessageChannelBody: object;

Type declaration

channel
channel: object;

Channel Details

channel.from
channel.from: AnyChannel;

Channel is coming from user/type

channel.to
channel.to: AnyChannel;

Channel is going to user/type

headers
headers: Record<string, string>;

Message headers

id
id: string;

Message ID

type
type: ChannelType;

Message Type

Defined in

conversations/lib/types/messageChannelBody.ts:4


MessageConversationBody

type MessageConversationBody: object;

Type declaration

displayName?
optional displayName: string;

The conversation display name.

id
id: string;

The conversation id.

imageUrl?
optional imageUrl: string;

The image for the conversation.

name
name: string;

The conversation name.

state
state: ConversationState;

The conversation state.

timestamp?
readonly optional timestamp: object;

Timestamps for when the conversation was created, updated, and destroyed.

timestamp.created?
readonly optional timestamp.created: string;

The time the conversation was created.

timestamp.destroyed?
readonly optional timestamp.destroyed: string;

The time the conversation was destroyed (if applicable).

timestamp.updated?
readonly optional timestamp.updated: string;

The time the conversation was last updated.

Defined in

conversations/lib/types/messageConversationBody.ts:3


MessageCustomBody

type MessageCustomBody: object;

Type declaration

custom
custom: Record<string, number | string | boolean>;

Custom data for message

messageType
messageType: EventMessageType.CUSTOM;

Message type

Defined in

conversations/lib/types/messageCustomBody.ts:4


MessageEventBody

type MessageEventBody: object;

Type declaration

eventId
eventId: string;

The event id.

Defined in

conversations/lib/types/messageEventBody.ts:1


MessageFileBody

type MessageFileBody: object;

Type declaration

file
file: object;
file.url
file.url: string;

File URL

messageType
messageType: EventMessageType.FILE;

Message type

Defined in

conversations/lib/types/messageFileBody.ts:3


MessageImageBody

type MessageImageBody: object;

Type declaration

image
image: object;

Message image

image.url
image.url: string;

Image URL

messageType
messageType: EventMessageType.IMAGE;

Message type

Defined in

conversations/lib/types/messageImageBody.ts:3


MessageLegBody

type MessageLegBody: object;

Type declaration

direction
direction: CallDirection;

Call direction of the message leg

legId
legId: string;

Id of the message leg

state
state: LegState;

State of the message leg

status
status: CallStatus;

Call status of the message leg

statusHistory
statusHistory: object;

Last status of the leg

statusHistory.conversationId?
optional statusHistory.conversationId: string;

Conversation Id

statusHistory.knockerId?
optional statusHistory.knockerId: string;

Id of the knocker

statusHistory.memberId?
optional statusHistory.memberId: string;

Member Id

statusHistory.state
statusHistory.state: LegState;

Last state of the leg

statusHistory.status
statusHistory.status: CallStatus;

Call status of the leg

type
type: Channels;

Channel type of the message leg

Defined in

conversations/lib/types/messageLegBody.ts:23


MessageLocationBody

type MessageLocationBody: object;

Type declaration

location
location: object;
location.address
location.address: string;

Address

location.latitude
location.latitude: string;

Latitude

location.longitude
location.longitude: string;

Longitude

location.name
location.name: string;

Name

messageType
messageType: EventMessageType.LOCATION;

Message Type

Defined in

conversations/lib/types/messageLocationBody.ts:3


MessageMemberBody

type MessageMemberBody: object & Omit<Member, "status" | "id" | "conversationId"> & Omit<UpdateMemberParameters, "state" | "from">;

Type declaration

audio?
optional audio: boolean;

Audio Message

memberId
memberId: string;

Member ID

Defined in

conversations/lib/types/messageMemberBody.ts:4


MessagePlayDTMFBody

type MessagePlayDTMFBody: object;

Type declaration

channel
channel: object;

Channel information.

channel.from
channel.from: object;

Channel message was sent from.

channel.from.from
channel.from.from: object;

From Channel information.

channel.from.from.type
channel.from.from.type: Channels;

Channel type.

channel.from.to
channel.from.to: object;

To Channel information.

channel.from.to.type
channel.from.to.type: string;

Channel type.

channel.from.to.user
channel.from.to.user: string;

User ID.

channel.from.type
channel.from.type: Channels;

Channel type.

channel.headers
channel.headers: Record<string, string>;

Message headers

channel.id
channel.id: string;

Mmessage Id

channel.to
channel.to: object;

Channel message was sent to.

channel.to.from
channel.to.from: object;

From Channel information.

channel.to.from.type
channel.to.from.type: Channels;

Channel type.

channel.to.to
channel.to.to: object;

To Channel information.

channel.to.to.type
channel.to.to.type: string;

Channel type.

channel.to.to.user
channel.to.to.user: string;

User ID.

channel.to.type
channel.to.type: Channels;

Channel type.

channel.type
channel.type: 
  | "app"
  | "phone"
  | "sip"
  | "websocket"
  | "vcp"
  | "websocket";

Message type

digits
digits: string;

The digits to play.

dtmfSeq?
optional dtmfSeq: number;

The sequence number of the DTMF event.

duration
duration: number;

The duration of the DTMF event.

method
method: "in";

The method used to send the DTMF event.

Defined in

conversations/lib/types/messagePlayDTMFBody.ts:3


MessageRTCAnswerBody

type MessageRTCAnswerBody: object & MessageRTCIdBody;

Type declaration

answer
answer: string;
isFromMb
isFromMb: boolean;
sessionDestination
sessionDestination: string;

Defined in

conversations/lib/types/messageRTCAnswerBody.ts:3


MessageRTCIdBody

type MessageRTCIdBody: object;

Type declaration

rtcId
rtcId: string;

RTC ID

Defined in

conversations/lib/types/messageRTCIdBody.ts:1


MessageRandomBody

type MessageRandomBody: object;

Type declaration

messageType
messageType: EventMessageType.RANDOM;

Defined in

conversations/lib/types/messageRandomBody.ts:3


MessageRecordBody

type MessageRecordBody: object;

Type declaration

beepEnd
beepEnd: boolean;

Play beep at the end of the recording

beepStart
beepStart: boolean;

Play beep at the beginning of the recording

channels
channels: number;

Number of channels

detectSpeach
detectSpeach: boolean;

Detect speech

format
format: string;

Audio format

multiTrack
multiTrack: boolean;

Recording has multiple tracks

recordId
recordId: string;

Recording ID

split
split: boolean;

Split the audio

streamed
streamed: boolean;

Audio is streamed

transcription
transcription: object;

Transcription settings

transcription.language
transcription.language: string;

Transcription language

transcription.sentimentAnalysis
transcription.sentimentAnalysis: boolean;

Include sentiment analysis

validity
validity: number;

Recording URL

Defined in

conversations/lib/types/messageRecordBody.ts:1


MessageRecordIdBody

type MessageRecordIdBody: object;

Type declaration

recordId
recordId: string;

Recording ID

Defined in

conversations/lib/types/messageRecordIdBody.ts:1


MessageSIPBody

type MessageSIPBody: object;

Standard SIP and RTC message body

Type declaration

channel
channel: AnyChannel;

Call channel

Remarks

This is the same body for RTC and SIP

Defined in

conversations/lib/types/messageSIPBody.ts:8


MessageSIPDirectionBody

type MessageSIPDirectionBody: object & MessageSIPBody;

Standard SIP and RTC message body with direction

Type declaration

direction
direction: CallDirection;

Direction of the call

Remarks

This is the same body for RTC and SIP

Defined in

conversations/lib/types/messageSIPDirectionBody.ts:9


MessageSIPHangupBody

type MessageSIPHangupBody: object & MessageSIPDirectionBody;

Standard SIP and RTC

Type declaration

bandwidth
bandwidth: object;

Bandwidth of the call

bandwidth.byteIn
bandwidth.byteIn: number;

Total number of bytes received

bandwidth.byteOut
bandwidth.byteOut: number;

Total number of bytes sent

quality
quality: object;

Quality of the call

quality.flawTotal
quality.flawTotal: number;

Total number of packets that had flaws

quality.jitterBurstRate
quality.jitterBurstRate: number;

Average amount of jitter burst

quality.jitterLossRate
quality.jitterLossRate: number;

Average amount of jitter loss

quality.jitterMaxVar
quality.jitterMaxVar: number;

Most amount ofjitter

quality.jitterMinVar
quality.jitterMinVar: number;

Least amount of jitter

quality.mosScore
quality.mosScore: number;

The MOS score of the call

quality.packetCnt
quality.packetCnt: number;

Total number of packets

quality.packetLossPerc
quality.packetLossPerc: number;

Total number of packets lost

quality.qualityPercentage
quality.qualityPercentage: number;

The percentage of the call that was not silence

reason
reason: object;

The reason of the call hangup

reason.code
reason.code: string;

The SIP reason Code of the call

reason.sipCode
reason.sipCode: string;

The SIP code of the call

reason.text
reason.text: string;

The reason of the call

Remarks

This is the same body for RTC and SIP

Defined in

conversations/lib/types/messageSIPHangupBody.ts:8


MessageSIPMachineBody

type MessageSIPMachineBody: object & MessageSIPBody;

Type declaration

confidence
confidence: number;

Confidence of the machine detection

type
type: string;

Type of SIP call

Defined in

conversations/lib/types/messageSIPMachineBody.ts:3


MessageSIPStatusBody

type MessageSIPStatusBody: object & MessageSIPBody;

SIP and RTC message body with status

Type declaration

direction
direction: CallDirection;

Direction of the call

duration
duration: string;

Call duration

endTime
endTime: string;

Time of the end of the call

from
from: string;

Phone number of the caller

networkCode
networkCode: string;

Network code of the caller

price
price: string;

Price for the call

rate
rate: string;

Rate per minute

requestTime
requestTime: string;

Time of the request

startTime
startTime: string;

Time of the start of the call

state
state: object;

State of the call

state.status
state.status: CallStatus;

Status of the call

status
status: CallStatus;

Status of the call

to
to: string;

Phone number

Remarks

This is the same body for RTC and SIP

Defined in

conversations/lib/types/messageSIPStatusBody.ts:9


MessageSayBody

type MessageSayBody: object;

Type declaration

language
language: string;

The language of the voice

level
level: number;

Volume level

loop
loop: number;

Number of times to repeat the audio

premium
premium: boolean;

Whether to use the premium voice

queue
queue: boolean;

Queue the audio

ssml
ssml: boolean;

Whether to use SSML

style
style: number;

The style of the voice

text
text: string;

The text to say

voiceName
voiceName: string;

The name of the voice to use

Defined in

conversations/lib/types/messageSayBody.ts:1


MessageSayIdBody

type MessageSayIdBody: object;

Type declaration

sayId
sayId: string;

The ID of the message.

Defined in

conversations/lib/types/messageSayIdBody.ts:1


MessageStatusBody

type MessageStatusBody: object;

Type declaration

audio?
optional audio: object;
audio.url
audio.url: string;

Audio URL

channelType?
optional channelType: 
  | "sms"
  | "mms"
  | "whatsapp"
  | "viber"
  | "messenger";

Channel type

custom?
optional custom: Record<string, unknown>;
error?
optional error: Record<string, unknown>;

Message error

file?
optional file: object;
file.url
file.url: string;

File URL

from?
optional from: string;

Member ID of the sender.

image?
optional image: object;
image.url
image.url: string;

Image URL

location?
optional location: object;
location.address
location.address: string;

Location address

location.latitude
location.latitude: number;

Latitude

location.longitude
location.longitude: number;

Longitude

location.name
location.name: string;

Location name

messageType?
optional messageType: EventMessageType;

Type of event

messageUUID?
optional messageUUID: string;

The ID of the message.

originalEventId?
optional originalEventId: string;

The ID of the message.

template?
optional template: object;
template.name
template.name: string;
template.parameters
template.parameters: string[];

Template variables

text?
optional text: string;

Message text

to?
optional to: string;

Member ID of the recipient.

vcard?
optional vcard: object;
vcard.url
vcard.url: string;

VCard URL

video?
optional video: object;
video.url
video.url: string;

Video URL

whatsapp?
optional whatsapp: object;
whatsapp.locale
whatsapp.locale: string;

Whats App locale

whatsapp.policy
whatsapp.policy: string;

Whats App policy

Defined in

conversations/lib/types/messageStatusBody.ts:3


MessageTemplateBody

type MessageTemplateBody: object;

Type declaration

messageType
messageType: EventMessageType.TEMPLATE;

Message type

template
template: object;

Message template

template.name
template.name: string;

Template name

template.parameters
template.parameters: unknown[];

Template parameters

template.whatsapp
template.whatsapp: object;

Whatsapp settings

template.whatsapp.locale
template.whatsapp.locale: string;

Template locale

template.whatsapp.policy
template.whatsapp.policy: string;

Template policy

Defined in

conversations/lib/types/messageTemplateBody.ts:3


MessageTextBody

type MessageTextBody: object;

Type declaration

messageType
messageType: EventMessageType.TEXT;

Message type

text
text: string;

Message text

Defined in

conversations/lib/types/messageTextBody.ts:3


MessageVCardBody

type MessageVCardBody: object;

Type declaration

image
image: object;
image.url
image.url: string;

Image URL

messageType
messageType: EventMessageType.VCARD;

Message type

vcard
vcard: object;

Message vcard

vcard.url
vcard.url: string;

Vcard url

Defined in

conversations/lib/types/messageVCardBody.ts:3


MessageVideoBody

type MessageVideoBody: object;

Type declaration

messageType
messageType: EventMessageType.VIDEO;

Message type

video
video: object;

Message video

video.url
video.url: string;

Video URL

Defined in

conversations/lib/types/messageVideoBody.ts:3


PhoneNumberChannel

type PhoneNumberChannel: object;

Type representing a phone number channel.

Type declaration

number
number: string;

The phone number.

type
type: ChannelType.PHONE;

The type of channel (phone).

Defined in

conversations/lib/types/phoneNumberChannel.ts:6


Session

type Session: object;

Type declaration

apiKey
apiKey: string;

The API Key for the session.

id
id: string;

The ID of the session.

properties
properties: object;

Session properties

properties.ttl
properties.ttl: number;

Time to live in seconds.

user
user: SessionUser;

User for the session

Defined in

conversations/lib/types/session.ts:13


SessionPage

type SessionPage: object;

Type declaration

links?
optional links: Record<string, APILink>;

HAL links for the page.

pageSize
pageSize: number;

The number of items in the page.

sessions
sessions: Session[];

Sessions in the page.

Defined in

conversations/lib/types/sessionPage.ts:4


SessionPageResponse

type SessionPageResponse: object & APILinks;

Type declaration

_embedded
_embedded: object;

HAL Page response

_embedded.sessions
_embedded.sessions: SessionResponse[];

The sessions in the page.

page_size
page_size: number;

Number of members in the page.

Defined in

conversations/lib/types/responses/sessionPageResponse.ts:4


SessionResponse

type SessionResponse: object & Omit<Session, "user">;

A session as its returned from the API

Type declaration

_embedded
_embedded: object;
_embedded.api_key
_embedded.api_key: string;

API Key for the session.

_embedded.user
_embedded.user: SessionUser;

The matching user for this member.

Defined in

conversations/lib/types/responses/sessionResponse.ts:6


SessionUser

type SessionUser: object;

Type declaration

id
id: string;

The ID of the user.

name
name: string;

The name of the user.

Defined in

conversations/lib/types/session.ts:1


SipChannel

type SipChannel: object;

Type representing a SIP channel.

Type declaration

password
password: string;

The SIP password.

type
type: ChannelType.SIP;

The type of channel (SIP).

uri
uri: string;

The SIP URI.

username
username: string;

The SIP username.

Defined in

conversations/lib/types/sipChannel.ts:6


UpdateMemberParameters

type UpdateMemberParameters: object;

Parameters for updating a member.

Type declaration

from
from: string;

Member ID of who is making the update.

reason?
optional reason: object;

The reason for the update.

reason.code
reason.code: string;

The reason code.

reason.text
reason.text: string;

The reason text.

state
state: MemberState.LEFT | MemberState.JOINED;

The new state to public set

Setting to MemberState.LEFT will remove the member from the reason is required when setting to MemberState.JOINED

Defined in

conversations/lib/types/parameters/updateMemberParameters.ts:6


VbcChannel

type VbcChannel: object;

Type representing a VBC (Voice Business Cloud) channel.

Type declaration

extension
extension: string;

The VBC extension.

type
type: ChannelType.VBC;

The type of channel (VBC).

Defined in

conversations/lib/types/vbcChannel.ts:6


WebSocketChannel

type WebSocketChannel: object;

Type representing a WebSocket channel.

Type declaration

contentType
contentType: string;

The content type for WebSocket.

type
type: ChannelType;

The type of channel (WebSocket).

uri
uri: string;

The WebSocket URI.

Defined in

conversations/lib/types/websocketChannel.ts:6

Clone this wiki locally