[**Documentation**](index.md)
***
[Documentation](packages.md) / Vonage Audit
# Vonage Audit SDK for Node.js
 [](https://codecov.io/gh/Vonage/vonage-server-sdk)  [](../../CODE_OF_CONDUCT.md) [][license]
This is the Vonage Audit SDK for Node.js for use with [Vonage APIs](https://www.vonage.com/). To use it you will need a Vonage account. Sign up [for free at vonage.com][signup].
For full API documentation refer to [developer.nexmo.com](https://developer.nexmo.com/).
* [Installation](#installation)
* [Usage](#usage)
* [Promises](#promises)
* [Testing](#testing)
## Installation
We recommend using this SDK as part of the overall [`@vonage/server-sdk` package](https://github.com/vonage/vonage-node-sdk). Please see the main package for installation.
You can also use this SDK standalone if you only need access to just the Audit API.
### With NPM
```bash
npm install @vonage/audit
```
### With Yarn
```bash
yarn add @vonage/audit
```
## Usage
### As part of the Vonage Server SDK
If you are using this SDK as part of the Vonage Server SDK, you can access it as the `audit` property off of the client that you instantiate.
```js
const { Vonage, Auth } = require('@vonage/server-sdk');
const credentials = new Auth({
apiKey: API_KEY,
apiSecret: API_SECRET
});
const options = {};
const vonage = new Vonage(credentials, options);
(async () =>{
for await (const event of vonage.audit.getEvents()) {
console.log(event);
}
})();
```
### Standalone
The SDK can be used standalone from the main [Vonage Server SDK for Node.js](https://github.com/vonage/vonage-node-sdk) if you only need to use the Audit API. All you need to do is `require('@vonage/audit')`, and use the returned object to create your own client.
```js
const { Auth } = require('@vonage/auth');
const { Audit } = require('@vonage/number');
const credentials = new Auth({
apiKey: API_KEY,
apiSecret: API_SECRET
});
const options = {};
const auditClient = new Audit(credentials, options);
```
Where `credentials` is any option from [`@vonage/auth`](https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/auth/README.md#options), and `options` is any option from [`@vonage/server-client`](https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/server-client/README.md#options)
## Promises
Most methods that interact with the Vonage API uses Promises. You can either resolve these yourself, or use `await` to wait for a response.
```js
const resp = await vonage.audit.getEvent(eventId);
vonage.audit.getEvent(eventId)
.then(resp => console.log(resp))
.catch(err => console.error(err));
```
## Testing
Run:
```bash
npm run test
```
[signup]: https://dashboard.nexmo.com/sign-up?utm_source=DEV_REL&utm_medium=github&utm_campaign=node-server-sdk
[license]: _media/LICENSE.txt
## Enumerations
### AuditEventTypes
Defined in: [audit/lib/enums.ts:14](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/enums.ts#L14)
Audit Events are generated automatically by Vonage as the user interacts with
either a Vonage API or the Vonage Dashboard. Each Audit Event object has a
type and associated metadata.
#### Remarks
The list of supported event types does change from time to time. For
this reason the OPTIONS method is provided to return event types. You can
see how to return the definitive list of event types from the [https://developer.vonage.com/en/audit/code-snippets/get-event-types](https://developer.vonage.com/en/audit/code-snippets/get-event-types)
#### See
Documentation [https://developer.vonage.com/en/audit/concepts/audit-events](https://developer.vonage.com/en/audit/concepts/audit-events)
#### Enumeration Members
| Enumeration Member | Value | Description | Defined in |
| ------ | ------ | ------ | ------ |
| `ACCOUNT_SECRET_CREATE` | `"ACCOUNT_SECRET_CREATE"` | Secret Rotation operation. | [audit/lib/enums.ts:63](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/enums.ts#L63) |
| `ACCOUNT_SECRET_DELETE` | `"ACCOUNT_SECRET_DELETE"` | Secret Rotation operation. | [audit/lib/enums.ts:58](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/enums.ts#L58) |
| `ACCOUNT_UPDATE_SETTINGS_API` | `"ACCOUNT_UPDATE_SETTINGS_API"` | Account Settings updated via API. | [audit/lib/enums.ts:73](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/enums.ts#L73) |
| `ACCOUNT_UPDATE_SPAMMER` | `"ACCOUNT_UPDATE_SPAMMER"` | Account Settings updated via API. | [audit/lib/enums.ts:68](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/enums.ts#L68) |
| `APP_CREATE` | `"APP_CREATE"` | App created. | [audit/lib/enums.ts:103](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/enums.ts#L103) |
| `APP_DELETE` | `"APP_DELETE"` | App deleted. | [audit/lib/enums.ts:113](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/enums.ts#L113) |
| `APP_DISABLE` | `"APP_DISABLE"` | App disabled. | [audit/lib/enums.ts:118](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/enums.ts#L118) |
| `APP_ENABLE` | `"APP_ENABLE"` | App enabled. | [audit/lib/enums.ts:123](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/enums.ts#L123) |
| `APP_UPDATE` | `"APP_UPDATE"` | App updated. | [audit/lib/enums.ts:108](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/enums.ts#L108) |
| `AUTORELOAD_DISABLE` | `"AUTORELOAD_DISABLE"` | Automatic reload disabled. | [audit/lib/enums.ts:148](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/enums.ts#L148) |
| `AUTORELOAD_ENABLE` | `"AUTORELOAD_ENABLE"` | Automatic reload enabled. | [audit/lib/enums.ts:138](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/enums.ts#L138) |
| `AUTORELOAD_UPDATE` | `"AUTORELOAD_UPDATE"` | Automatic reload settings updated. | [audit/lib/enums.ts:143](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/enums.ts#L143) |
| `IP_WHITELIST_CREATE` | `"IP_WHITELIST_CREATE"` | Whitelist IP added. | [audit/lib/enums.ts:128](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/enums.ts#L128) |
| `IP_WHITELIST_DELETE` | `"IP_WHITELIST_DELETE"` | Whitelist IP deleted. | [audit/lib/enums.ts:133](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/enums.ts#L133) |
| `NUMBER_ASSIGN` | `"NUMBER_ASSIGN"` | Number assigned. | [audit/lib/enums.ts:78](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/enums.ts#L78) |
| `NUMBER_LINKED` | `"NUMBER_LINKED"` | Number linked to Vonage application. | [audit/lib/enums.ts:93](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/enums.ts#L93) |
| `NUMBER_RELEASE` | `"NUMBER_RELEASE"` | Number released. | [audit/lib/enums.ts:88](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/enums.ts#L88) |
| `NUMBER_UNLINKED` | `"NUMBER_UNLINKED"` | Number unlinked from Vonage application. | [audit/lib/enums.ts:98](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/enums.ts#L98) |
| `NUMBER_UPDATED` | `"NUMBER_UPDATED"` | Number updated. | [audit/lib/enums.ts:83](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/enums.ts#L83) |
| `USER_API_KEYS_UPDATE` | `"USER_API_KEYS_UPDATE"` | Sub-accounts for user updated. | [audit/lib/enums.ts:53](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/enums.ts#L53) |
| `USER_BILLING_UPDATE` | `"USER_BILLING_UPDATE"` | User billing updated. | [audit/lib/enums.ts:28](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/enums.ts#L28) |
| `USER_CREATE` | `"USER_CREATE"` | User created. | [audit/lib/enums.ts:33](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/enums.ts#L33) |
| `USER_LOGIN` | `"USER_LOGIN"` | User login (Premium Support only). | [audit/lib/enums.ts:38](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/enums.ts#L38) |
| `USER_LOGOUT` | `"USER_LOGOUT"` | User logout (Premium Support only). | [audit/lib/enums.ts:43](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/enums.ts#L43) |
| `USER_PRODUCT_SEARCH` | `"USER_PRODUCT_SEARCH"` | Relates to searching for CDRs or logs in Dashboard. | [audit/lib/enums.ts:48](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/enums.ts#L48) |
| `USER_STATUS` | `"USER_STATUS"` | User status updated. | [audit/lib/enums.ts:18](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/enums.ts#L18) |
| `USER_UPDATE` | `"USER_UPDATE"` | User updated. | [audit/lib/enums.ts:23](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/enums.ts#L23) |
## Classes
### Audit
Defined in: [audit/lib/audit.ts:28](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/audit.ts#L28)
Represents an SDK client for interacting with audit-related functionality.
#### Remarks
This client is only available as a standalone client. It cannot be
instantiated from a Vonage client.
#### Example
Create a standalone Audit client
```ts
import { Audit } from '@vonage/audit';
const auditClient = new Audit({
apiKey: VONAGE_API_KEY,
apiSecret: VONAGE_API_SECRET
});
```
#### Extends
- [`Client`](Vonage-Server-Client.md#client)
#### Constructors
##### Constructor
```ts
new Audit(credentials, options?): Audit;
```
Defined in: server-client/dist/lib/client.d.ts:35
Creates a new instance of the Client.
###### Parameters
###### credentials
The authentication credentials or an authentication instance.
[`AuthInterface`](Vonage-Auth.md#authinterface) | [`AuthParams`](Vonage-Auth.md#authparams)
###### options?
[`ConfigParams`](Vonage-Server-Client.md#configparams)
Optional configuration settings for the client.
###### Returns
[`Audit`](#audit)
###### Inherited from
[`Client`](Vonage-Server-Client.md#client).[`constructor`](Vonage-Server-Client.md#client#constructor)
#### Properties
##### auth
```ts
protected auth: AuthInterface;
```
Defined in: server-client/dist/lib/client.d.ts:24
The authentication instance responsible for generating authentication headers and query parameters.
###### Inherited from
[`Client`](Vonage-Server-Client.md#client).[`auth`](Vonage-Server-Client.md#client#auth)
##### authType
```ts
authType: AuthenticationType = AuthenticationType.BASIC;
```
Defined in: [audit/lib/audit.ts:33](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/audit.ts#L33)
The type of authentication used for the client's requests.
###### Overrides
[`Client`](Vonage-Server-Client.md#client).[`authType`](Vonage-Server-Client.md#client#authtype)
##### BASE\_PATH
```ts
protected BASE_PATH: string = 'beta';
```
Defined in: [audit/lib/audit.ts:30](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/audit.ts#L30)
##### config
```ts
protected config: ConfigParams;
```
Defined in: server-client/dist/lib/client.d.ts:28
Configuration settings for the client, including default hosts for various services and other request settings.
###### Inherited from
[`Client`](Vonage-Server-Client.md#client).[`config`](Vonage-Server-Client.md#client#config)
##### transformers
```ts
static transformers: object;
```
Defined in: server-client/dist/lib/client.d.ts:11
Static property containing utility transformers.
###### camelCaseObjectKeys
```ts
camelCaseObjectKeys: PartialTransformFunction;
```
###### kebabCaseObjectKeys
```ts
kebabCaseObjectKeys: PartialTransformFunction;
```
###### omit()
```ts
omit: (keys, obj) => TransformedObject;
```
###### Parameters
###### keys
`string`[]
###### obj
[`ObjectToTransform`](Vonage-Server-Client.md#objecttotransform)
###### Returns
[`TransformedObject`](Vonage-Server-Client.md#transformedobject)
###### snakeCaseObjectKeys
```ts
snakeCaseObjectKeys: PartialTransformFunction;
```
###### Inherited from
[`Client`](Vonage-Server-Client.md#client).[`transformers`](Vonage-Server-Client.md#client#transformers)
#### Methods
##### addAuthenticationToRequest()
```ts
addAuthenticationToRequest(request): Promise;
```
Defined in: server-client/dist/lib/client.d.ts:43
Adds the appropriate authentication headers or parameters to the request based on the authentication type.
###### Parameters
###### request
[`VetchOptions`](Vonage-Vetch.md#vetchoptions)
The request options to which authentication needs to be added.
###### Returns
`Promise`\<[`VetchOptions`](Vonage-Vetch.md#vetchoptions)\>
- The request options with the added authentication.
###### Inherited from
[`Client`](Vonage-Server-Client.md#client).[`addAuthenticationToRequest`](Vonage-Server-Client.md#client#addauthenticationtorequest)
##### addBasicAuthToRequest()
```ts
protected addBasicAuthToRequest(request): Promise;
```
Defined in: server-client/dist/lib/client.d.ts:71
Adds basic authentication headers to the request.
###### Parameters
###### request
[`VetchOptions`](Vonage-Vetch.md#vetchoptions)
The request options to which authentication needs to be added.
###### Returns
`Promise`\<[`VetchOptions`](Vonage-Vetch.md#vetchoptions)\>
- The request options with the added authentication.
###### Inherited from
[`Client`](Vonage-Server-Client.md#client).[`addBasicAuthToRequest`](Vonage-Server-Client.md#client#addbasicauthtorequest)
##### addJWTToRequest()
```ts
protected addJWTToRequest(request): Promise;
```
Defined in: server-client/dist/lib/client.d.ts:64
Adds a JWT to the request.
###### Parameters
###### request
[`VetchOptions`](Vonage-Vetch.md#vetchoptions)
The request options to which authentication needs to be added.
###### Returns
`Promise`\<[`VetchOptions`](Vonage-Vetch.md#vetchoptions)\>
- The request options with the added authentication.
###### Inherited from
[`Client`](Vonage-Server-Client.md#client).[`addJWTToRequest`](Vonage-Server-Client.md#client#addjwttorequest)
##### addQueryKeySecretToRequest()
```ts
protected addQueryKeySecretToRequest(request): Promise;
```
Defined in: server-client/dist/lib/client.d.ts:57
Adds API key and secret to the request.
###### Parameters
###### request
[`VetchOptions`](Vonage-Vetch.md#vetchoptions)
The request options to which authentication needs to be added.
###### Returns
`Promise`\<[`VetchOptions`](Vonage-Vetch.md#vetchoptions)\>
- The request options with the added authentication.
###### Inherited from
[`Client`](Vonage-Server-Client.md#client).[`addQueryKeySecretToRequest`](Vonage-Server-Client.md#client#addquerykeysecrettorequest)
##### addQueryKeySecretToRequestBody()
```ts
protected addQueryKeySecretToRequestBody(request): Promise;
```
Defined in: server-client/dist/lib/client.d.ts:50
Adds API key and secret to the request body.
###### Parameters
###### request
[`VetchOptions`](Vonage-Vetch.md#vetchoptions)
The request options to which authentication needs to be added.
###### Returns
`Promise`\<[`VetchOptions`](Vonage-Vetch.md#vetchoptions)\>
- The request options with the added authentication.
###### Inherited from
[`Client`](Vonage-Server-Client.md#client).[`addQueryKeySecretToRequestBody`](Vonage-Server-Client.md#client#addquerykeysecrettorequestbody)
##### getConfig()
```ts
getConfig(): ConfigParams;
```
Defined in: server-client/dist/lib/client.d.ts:36
###### Returns
[`ConfigParams`](Vonage-Server-Client.md#configparams)
###### Inherited from
[`Client`](Vonage-Server-Client.md#client).[`getConfig`](Vonage-Server-Client.md#client#getconfig)
##### getEvent()
```ts
getEvent(eventId): Promise;
```
Defined in: [audit/lib/audit.ts:105](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/audit.ts#L105)
Retrieves a specific audit event by its ID.
###### Parameters
###### eventId
`string`
The ID of the audit event to retrieve.
###### Returns
`Promise`\<[`AuditEvent`](#auditevent)\>
A promise that resolves to the retrieved audit event.
###### Example
Retrieve a specific audit event
```ts
const auditEvent = await auditClient.getEvent('event-id');
console.log(auditEvent.id);
```
##### getEvents()
```ts
getEvents(params): AsyncGenerator;
```
Defined in: [audit/lib/audit.ts:68](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/audit.ts#L68)
Retrieves a list of audit events based on specified parameters.
###### Parameters
###### params
[`AuditParams`](#auditparams)
The query parameters for filtering audit events.
###### Returns
`AsyncGenerator`\<[`AuditEvent`](#auditevent), `void`, `undefined`\>
An async generator that yields audit events.
###### Example
Retrieve a list of audit events
```ts
const auditEvents = auditClient.getEvents({
page: 1,
size: 10,
dateFrom: '2021-01-01T00:00:00Z',
dateTo: '2021-01-31T23:59:59Z',
eventType: 'message',
search: 'search term'
});
for await (const event of auditEvents) {
console.log(event.id);
console.log(event.type);
console.log(event.created);
console.log(event.accountId);
console.log(event.requestId);
console.log(event.request);
console.log(event.response);
console.log(event.ipAddress);
console.log(event.country);
console.log(event.msisdn);
}
```
##### parseResponse()
```ts
protected parseResponse(request, response): Promise>;
```
Defined in: server-client/dist/lib/client.d.ts:168
Parses the response based on its content type.
###### Type Parameters
###### T
`T`
The expected type of the parsed response data.
###### Parameters
###### request
[`VetchOptions`](Vonage-Vetch.md#vetchoptions)
The request options.
###### response
`Response`
The raw response from the request.
###### Returns
`Promise`\<[`VetchResponse`](Vonage-Vetch.md#vetchresponse)\<`T`\>\>
- The parsed response.
###### Inherited from
[`Client`](Vonage-Server-Client.md#client).[`parseResponse`](Vonage-Server-Client.md#client#parseresponse)
##### prepareBody()
```ts
protected prepareBody(request): undefined | string;
```
Defined in: server-client/dist/lib/client.d.ts:158
Prepares the body for the request based on the content type.
###### Parameters
###### request
[`VetchOptions`](Vonage-Vetch.md#vetchoptions)
The request options.
###### Returns
`undefined` \| `string`
- The prepared request body as a string or undefined.
###### Inherited from
[`Client`](Vonage-Server-Client.md#client).[`prepareBody`](Vonage-Server-Client.md#client#preparebody)
##### prepareRequest()
```ts
protected prepareRequest(request): Promise;
```
Defined in: server-client/dist/lib/client.d.ts:151
Prepares the request with necessary headers, authentication, and query parameters.
###### Parameters
###### request
[`VetchOptions`](Vonage-Vetch.md#vetchoptions)
The initial request options.
###### Returns
`Promise`\<[`VetchOptions`](Vonage-Vetch.md#vetchoptions)\>
- The modified request options.
###### Inherited from
[`Client`](Vonage-Server-Client.md#client).[`prepareRequest`](Vonage-Server-Client.md#client#preparerequest)
##### sendDeleteRequest()
```ts
sendDeleteRequest(url): Promise>;
```
Defined in: server-client/dist/lib/client.d.ts:78
Sends a DELETE request to the specified URL.
###### Type Parameters
###### T
`T`
###### Parameters
###### url
`string`
The URL endpoint for the DELETE request.
###### Returns
`Promise`\<[`VetchResponse`](Vonage-Vetch.md#vetchresponse)\<`T`\>\>
- The response from the DELETE request.
###### Inherited from
[`Client`](Vonage-Server-Client.md#client).[`sendDeleteRequest`](Vonage-Server-Client.md#client#senddeleterequest)
##### sendFormSubmitRequest()
```ts
sendFormSubmitRequest(url, payload?): Promise>;
```
Defined in: server-client/dist/lib/client.d.ts:86
Sends a POST request with form data to the specified URL.
###### Type Parameters
###### T
`T`
###### Parameters
###### url
`string`
The URL endpoint for the POST request.
###### payload?
`Record`\<`string`, `undefined` \| `string`\>
Optional payload containing form data to send with the POST request.
###### Returns
`Promise`\<[`VetchResponse`](Vonage-Vetch.md#vetchresponse)\<`T`\>\>
- The response from the POST request.
###### Inherited from
[`Client`](Vonage-Server-Client.md#client).[`sendFormSubmitRequest`](Vonage-Server-Client.md#client#sendformsubmitrequest)
##### sendGetRequest()
```ts
sendGetRequest(url, queryParams?): Promise>;
```
Defined in: server-client/dist/lib/client.d.ts:94
Sends a GET request to the specified URL with optional query parameters.
###### Type Parameters
###### T
`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`](Vonage-Vetch.md#vetchresponse)\<`T`\>\>
- The response from the GET request.
###### Inherited from
[`Client`](Vonage-Server-Client.md#client).[`sendGetRequest`](Vonage-Server-Client.md#client#sendgetrequest)
##### sendPatchRequest()
```ts
sendPatchRequest(url, payload?): Promise>;
```
Defined in: server-client/dist/lib/client.d.ts:104
Sends a PATCH request to the specified URL with an optional payload.
###### Type Parameters
###### T
`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`](Vonage-Vetch.md#vetchresponse)\<`T`\>\>
- The response from the PATCH request.
###### Inherited from
[`Client`](Vonage-Server-Client.md#client).[`sendPatchRequest`](Vonage-Server-Client.md#client#sendpatchrequest)
##### sendPostRequest()
```ts
sendPostRequest(url, payload?): Promise>;
```
Defined in: server-client/dist/lib/client.d.ts:114
Sends a POST request to the specified URL with an optional payload.
###### Type Parameters
###### T
`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`](Vonage-Vetch.md#vetchresponse)\<`T`\>\>
- The response from the POST request.
###### Inherited from
[`Client`](Vonage-Server-Client.md#client).[`sendPostRequest`](Vonage-Server-Client.md#client#sendpostrequest)
##### sendPutRequest()
```ts
sendPutRequest(url, payload?): Promise>;
```
Defined in: server-client/dist/lib/client.d.ts:124
Sends a PUT request to the specified URL with an optional payload.
###### Type Parameters
###### T
`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`](Vonage-Vetch.md#vetchresponse)\<`T`\>\>
- The response from the PUT request.
###### Inherited from
[`Client`](Vonage-Server-Client.md#client).[`sendPutRequest`](Vonage-Server-Client.md#client#sendputrequest)
##### sendRequest()
```ts
sendRequest(request): Promise>;
```
Defined in: server-client/dist/lib/client.d.ts:144
Sends a request adding necessary headers, handling authentication, and parsing the response.
###### Type Parameters
###### T
`T`
###### Parameters
###### request
[`VetchOptions`](Vonage-Vetch.md#vetchoptions)
The options defining the request, including URL, method, headers, and data.
###### Returns
`Promise`\<[`VetchResponse`](Vonage-Vetch.md#vetchresponse)\<`T`\>\>
- The parsed response from the request.
###### Inherited from
[`Client`](Vonage-Server-Client.md#client).[`sendRequest`](Vonage-Server-Client.md#client#sendrequest)
##### sendRequestWithData()
```ts
sendRequestWithData(
method,
url,
payload?): Promise>;
```
Defined in: server-client/dist/lib/client.d.ts:135
Sends a request with JSON-encoded data to the specified URL using the provided HTTP method.
###### Type Parameters
###### T
`T`
###### Parameters
###### method
The HTTP method to be used for the request (only POST, PATCH, or PUT are acceptable).
[`POST`](Vonage-Vetch.md#httpmethods#post) | [`PUT`](Vonage-Vetch.md#httpmethods#put) | [`PATCH`](Vonage-Vetch.md#httpmethods#patch)
###### 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`](Vonage-Vetch.md#vetchresponse)\<`T`\>\>
- The response from the request.
###### Inherited from
[`Client`](Vonage-Server-Client.md#client).[`sendRequestWithData`](Vonage-Server-Client.md#client#sendrequestwithdata)
## Type Aliases
### AuditEvent
```ts
type AuditEvent = object;
```
Defined in: [audit/lib/types/auditEvent.ts:5](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/types/auditEvent.ts#L5)
Represents an Audit Event.
#### Properties
##### accountId
```ts
accountId: string;
```
Defined in: [audit/lib/types/auditEvent.ts:35](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/types/auditEvent.ts#L35)
The API_KEY of the Vonage API account that the audit event is associated with.
##### context?
```ts
optional context: unknown;
```
Defined in: [audit/lib/types/auditEvent.ts:55](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/types/auditEvent.ts#L55)
Additional context information for the audit event.
##### createdAt
```ts
createdAt: string;
```
Defined in: [audit/lib/types/auditEvent.ts:20](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/types/auditEvent.ts#L20)
The date when the audit event was created.
##### eventType
```ts
eventType: AuditEventTypes | string;
```
Defined in: [audit/lib/types/auditEvent.ts:15](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/types/auditEvent.ts#L15)
The type of the audit event.
##### id
```ts
id: string;
```
Defined in: [audit/lib/types/auditEvent.ts:9](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/types/auditEvent.ts#L9)
UUID of the audit event.
##### source
```ts
source: "CD" | "DEVAPI";
```
Defined in: [audit/lib/types/auditEvent.ts:40](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/types/auditEvent.ts#L40)
The source of the event.
##### sourceCountry
```ts
sourceCountry: string;
```
Defined in: [audit/lib/types/auditEvent.ts:50](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/types/auditEvent.ts#L50)
ISO 3166-1 Alpha-2 country code recorded for the event.
##### sourceDescription
```ts
sourceDescription: "Customer Dashboard" | "Developer API";
```
Defined in: [audit/lib/types/auditEvent.ts:45](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/types/auditEvent.ts#L45)
Description of the audit event source.
##### userEmail?
```ts
optional userEmail: string;
```
Defined in: [audit/lib/types/auditEvent.ts:25](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/types/auditEvent.ts#L25)
Email of the user whose account the audit event is associated with.
##### userId?
```ts
optional userId: string;
```
Defined in: [audit/lib/types/auditEvent.ts:30](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/types/auditEvent.ts#L30)
The ID of the user that the audit event is associated with.
***
### AuditEventListResponse
```ts
type AuditEventListResponse = object;
```
Defined in: [audit/lib/types/auditEventListResponse.ts:12](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/types/auditEventListResponse.ts#L12)
Represents the response containing a list of audit events.
#### Remarks
Vonage API's will return information using `snake_case`. This represents the
pure response before the client will transform the keys into `camelCase`
#### Properties
##### \_embedded?
```ts
optional _embedded: object;
```
Defined in: [audit/lib/types/auditEventListResponse.ts:16](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/types/auditEventListResponse.ts#L16)
An object containing an array of audit events.
###### events
```ts
events: AuditEvent[];
```
##### \_links
```ts
_links: APILinks;
```
Defined in: [audit/lib/types/auditEventListResponse.ts:23](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/types/auditEventListResponse.ts#L23)
Links associated with the API response.
##### page
```ts
page: AuditEventPage;
```
Defined in: [audit/lib/types/auditEventListResponse.ts:28](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/types/auditEventListResponse.ts#L28)
Information about the pagination and page details.
***
### AuditEventPage
```ts
type AuditEventPage = object;
```
Defined in: [audit/lib/types/auditEventPage.ts:4](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/types/auditEventPage.ts#L4)
Represents information about the pagination of audit events.
#### Properties
##### number
```ts
number: number;
```
Defined in: [audit/lib/types/auditEventPage.ts:23](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/types/auditEventPage.ts#L23)
The current page number.
##### size
```ts
size: number;
```
Defined in: [audit/lib/types/auditEventPage.ts:8](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/types/auditEventPage.ts#L8)
The number of items per page.
##### totalElements
```ts
totalElements: number;
```
Defined in: [audit/lib/types/auditEventPage.ts:13](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/types/auditEventPage.ts#L13)
The total number of elements across all pages.
##### totalPages
```ts
totalPages: number;
```
Defined in: [audit/lib/types/auditEventPage.ts:18](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/types/auditEventPage.ts#L18)
The total number of pages available.
***
### AuditEventResponse
```ts
type AuditEventResponse = object & Pick;
```
Defined in: [audit/lib/types/auditEventResponse.ts:11](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/types/auditEventResponse.ts#L11)
Represents an Audit Event.
#### Type declaration
##### account\_id
```ts
account_id: string;
```
The API_KEY of the Vonage API account that the audit event is associated with.
##### created\_at
```ts
created_at: string;
```
The date when the audit event was created.
##### event\_type
```ts
event_type: AuditEventTypes | string;
```
The type of the audit event.
##### source\_country
```ts
source_country: string;
```
ISO 3166-1 Alpha-2 country code recorded for the event.
##### source\_description
```ts
source_description: Pick;
```
Description of the audit event source.
##### user\_email?
```ts
optional user_email: string;
```
Email of the user whose account the audit event is associated with.
##### user\_id?
```ts
optional user_id: string;
```
The ID of the user that the audit event is associated with.
#### Remarks
Vonage API's will return information using `snake_case`. This represents the
pure response before the client will transform the keys into `camelCase`
***
### AuditParams
```ts
type AuditParams = object;
```
Defined in: [audit/lib/types/auditParams.ts:6](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/types/auditParams.ts#L6)
Represents parameters for querying audit events.
#### Properties
##### dateFrom?
```ts
optional dateFrom: string;
```
Defined in: [audit/lib/types/auditParams.ts:15](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/types/auditParams.ts#L15)
The start date for the audit event query.
##### dateTo?
```ts
optional dateTo: string;
```
Defined in: [audit/lib/types/auditParams.ts:20](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/types/auditParams.ts#L20)
The end date for the audit event query.
##### eventType?
```ts
optional eventType: AuditEventTypes | string;
```
Defined in: [audit/lib/types/auditParams.ts:10](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/types/auditParams.ts#L10)
The type of the audit event to filter by.
##### page?
```ts
optional page: number;
```
Defined in: [audit/lib/types/auditParams.ts:30](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/types/auditParams.ts#L30)
The page number for paginated results.
##### searchText?
```ts
optional searchText: string;
```
Defined in: [audit/lib/types/auditParams.ts:25](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/types/auditParams.ts#L25)
Text to search within audit event descriptions.
##### size?
```ts
optional size: number;
```
Defined in: [audit/lib/types/auditParams.ts:35](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/types/auditParams.ts#L35)
The number of items per page.
***
### ~~AuditResponse\~~
```ts
type AuditResponse = VetchResponse;
```
Defined in: [audit/lib/types/auditResponse.ts:6](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/audit/lib/types/auditResponse.ts#L6)
#### Type Parameters
##### T
`T`
#### Deprecated
this is not used