[**Documentation**](index.md)
***
[Documentation](packages.md) / Vonage Media
# Vonage Media SDK for Node.js
 [](https://codecov.io/gh/Vonage/vonage-server-sdk)  [](../../CODE_OF_CONDUCT.md) [][license]
This is the Vonage Media 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.vonage.com](https://developer.vonage.com/).
- [Installation](#installation)
- [Usage](#usage)
- [Promises](#promises)
- [Testing](#testing)
## Installation
### With NPM
```bash
npm install @vonage/media
```
### With Yarn
```bash
yarn add @vonage/media
```
## Usage
Unlike the other SDK's this package is not included in the [Vonage Server SDK for Node.js](https://github.com/vonage/vonage-node-sdk)
```js
const { Auth } = require('@vonage/auth')
const { Media } = require('@vonage/media')
const credentials = new Auth({
applicationId: APP_ID,
privateKey: PRIAVTE_KEY,
})
const options = {}
const mediaClient = new Media(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 mediaClient.listMediaItem()
mediaClient
.listMedia()
.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
## Classes
### Media
Defined in: [media/lib/media.ts:32](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/media/lib/media.ts#L32)
Client class to interact with the Media API which enables users to manage
their media items programmatically.
#### Remarks
This client is only available as a standalone client. It cannot be
instantiated from the server-sdk package.
#### Example
Create a standalone Secret client
```ts
import { Media } from '@vonage/media';
const mediaClient = new Media({
apiKey: VONAGE_API_KEY,
apiSecret: VONAGE_API_SECRET
});
```
#### Extends
- [`Client`](Vonage-Server-Client.md#client)
#### Constructors
##### Constructor
```ts
new Media(credentials, options?): Media;
```
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
[`Media`](#media)
###### 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
protected authType: AuthenticationType = AuthenticationType.JWT;
```
Defined in: [media/lib/media.ts:33](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/media/lib/media.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)
##### 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)
##### deleteMediaItem()
```ts
deleteMediaItem(mediaId): Promise;
```
Defined in: [media/lib/media.ts:172](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/media/lib/media.ts#L172)
Deletes a specific media item by its unique identifier.
###### Parameters
###### mediaId
`string`
The unique identifier of the media item to be deleted.
###### Returns
`Promise`\<`void`\>
A promise that resolves once the media item is successfully deleted.
###### Example
Delete a media item
```ts
await mediaClient.deleteMediaItem('my-media-id');
```
##### 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)
##### getMediaItem()
```ts
getMediaItem(mediaId): Promise;
```
Defined in: [media/lib/media.ts:120](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/media/lib/media.ts#L120)
Retrieves information about a specific media item by its unique identifier.
###### Parameters
###### mediaId
`string`
The unique identifier of the media item.
###### Returns
`Promise`\<[`MediaItem`](#mediaitem)\>
A promise that resolves to a [MediaItem](#mediaitem) object representing the retrieved media item.
###### Example
Retrieve a media item by its ID
```ts
const media = await mediaClient.getMediaItem('my-media-id');
console.log(`Media item ${media.id} is ${media.public ? 'public' : 'private'}`);
console.log(` - Title: ${media.title}`);
console.log(` - Description: ${media.description}`);
```
##### getMediaPage()
```ts
getMediaPage(params): Promise;
```
Defined in: [media/lib/media.ts:93](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/media/lib/media.ts#L93)
Retrieves a page of media items based on the specified parameters.
###### Parameters
###### params
[`MediaParameters`](#mediaparameters) = `{}`
Optional parameters for customizing the media page request.
###### Returns
`Promise`\<[`MediaItemPageResponse`](#mediaitempageresponse)\>
A promise that resolves to a [MediaItemPageResponse](#mediaitempageresponse) object representing the page of media items.
###### Example
List the first page of media items
```ts
const resp = await mediaClient.getMediaPage();
console.log(`There are ${resp.count} media items in total`);
console.log(`Showing ${resp._embedded.media.length} media items on this page`);
```
##### listAllMediaItems()
```ts
listAllMediaItems(params): AsyncGenerator;
```
Defined in: [media/lib/media.ts:61](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/media/lib/media.ts#L61)
Retrieves a paginated list of media items, yielding each item sequentially.
###### Parameters
###### params
[`MediaParameters`](#mediaparameters) = `{}`
Optional parameters for customizing the media list request.
###### Returns
`AsyncGenerator`\<[`MediaItem`](#mediaitem), `void` & [`MediaItem`](#mediaitem), `undefined`\>
An asynchronous generator that yields [MediaItem](#mediaitem) objects.
###### Examples
List all media items
```ts
for await (const media of mediaClient.listAllMediaItems()) {
console.log(`Media item ${media.id} is ${media.public ? 'public' : 'private'}`);
console.log(` - Title: ${media.title}`);
console.log(` - Description: ${media.description}`);
};
```
List all public media items
```ts
for await (const media of mediaClient.listAllMediaItems({ public: true })) {
console.log(`Media item ${media.id} is public`);
console.log(` - Title: ${media.title}`);
console.log(` - Description: ${media.description}`);
};
```
##### 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)
##### updateMediaItem()
```ts
updateMediaItem(media): Promise;
```
Defined in: [media/lib/media.ts:144](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/media/lib/media.ts#L144)
Updates the information of a specific media item based on the provided data.
###### Parameters
###### media
[`MediaItem`](#mediaitem)
The updated media item data.
###### Returns
`Promise`\<`void`\>
A promise that resolves once the media item is successfully updated.
###### Example
Update a media item
```ts
const media = await mediaClient.getMediaItem('my-media-id');
media.title = 'My new title';
media.description = 'My new description';
await mediaClient.updateMediaItem(media);
```
## Type Aliases
### MediaItem
```ts
type MediaItem = object;
```
Defined in: [media/lib/types/mediaItem.ts:4](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/media/lib/types/mediaItem.ts#L4)
Represents a media item.
#### Properties
##### accountId
```ts
accountId: string;
```
Defined in: [media/lib/types/mediaItem.ts:33](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/media/lib/types/mediaItem.ts#L33)
The ID of your Nexmo account. This is the same as your API key.
##### description?
```ts
optional description: string;
```
Defined in: [media/lib/types/mediaItem.ts:18](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/media/lib/types/mediaItem.ts#L18)
An optional description of the media file.
##### etag
```ts
etag: string;
```
Defined in: [media/lib/types/mediaItem.ts:54](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/media/lib/types/mediaItem.ts#L54)
An identifier for the content. This will change if the content of the file has been changed
(i.e., if you upload a new version of the file). For more information, see Wikipedia: HTTP ETag.
##### id
```ts
id: string;
```
Defined in: [media/lib/types/mediaItem.ts:8](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/media/lib/types/mediaItem.ts#L8)
A UUID representing the object.
##### maxDownloadsAllowed
```ts
maxDownloadsAllowed: number;
```
Defined in: [media/lib/types/mediaItem.ts:43](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/media/lib/types/mediaItem.ts#L43)
The maximum number of times the file may be downloaded.
##### mediaSize
```ts
mediaSize: number;
```
Defined in: [media/lib/types/mediaItem.ts:59](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/media/lib/types/mediaItem.ts#L59)
The size of the file in bytes.
##### metadataPrimary?
```ts
optional metadataPrimary: string | null;
```
Defined in: [media/lib/types/mediaItem.ts:79](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/media/lib/types/mediaItem.ts#L79)
A user-set string containing metadata about the media file.
##### metadataSecondary?
```ts
optional metadataSecondary: string | null;
```
Defined in: [media/lib/types/mediaItem.ts:84](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/media/lib/types/mediaItem.ts#L84)
A user-set string containing further metadata about the media file.
##### mimeType
```ts
mimeType: string;
```
Defined in: [media/lib/types/mediaItem.ts:28](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/media/lib/types/mediaItem.ts#L28)
The IETF MIME type of the file.
##### originalFileName
```ts
originalFileName: string;
```
Defined in: [media/lib/types/mediaItem.ts:23](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/media/lib/types/mediaItem.ts#L23)
The filename of the object as it was originally uploaded.
##### public
```ts
public: boolean;
```
Defined in: [media/lib/types/mediaItem.ts:74](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/media/lib/types/mediaItem.ts#L74)
Whether the item is available for download without authentication.
##### storeId
```ts
storeId: string;
```
Defined in: [media/lib/types/mediaItem.ts:38](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/media/lib/types/mediaItem.ts#L38)
An internal identifier of how the file is stored.
##### timeCreated
```ts
timeCreated: string;
```
Defined in: [media/lib/types/mediaItem.ts:64](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/media/lib/types/mediaItem.ts#L64)
A timestamp for the time that the file was created.
##### timeLastUpdated
```ts
timeLastUpdated: string;
```
Defined in: [media/lib/types/mediaItem.ts:69](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/media/lib/types/mediaItem.ts#L69)
A timestamp for the time that the file was last modified.
##### timesDownloaded
```ts
timesDownloaded: number;
```
Defined in: [media/lib/types/mediaItem.ts:48](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/media/lib/types/mediaItem.ts#L48)
The number of times the file has been downloaded.
##### title?
```ts
optional title: string;
```
Defined in: [media/lib/types/mediaItem.ts:13](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/media/lib/types/mediaItem.ts#L13)
An optional title for the media file.
***
### MediaItemPageResponse
```ts
type MediaItemPageResponse = object & APILinks;
```
Defined in: [media/lib/types/Responses/mediaItemResponsePage.ts:11](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/media/lib/types/Responses/mediaItemResponsePage.ts#L11)
Represents the response data for a page of media items.
#### Type declaration
##### \_embedded
```ts
_embedded: object;
```
A collection of media items.
###### \_embedded.media
```ts
_embedded.media: MediaItemResponse[];
```
##### count
```ts
count: number;
```
The total number of records returned by your request.
##### page\_index
```ts
page_index: number;
```
The page_index used in your request.
##### page\_size
```ts
page_size: number;
```
The amount of records returned in this response.
#### Remarks
Vonage API's will return information using `snake_case`. This represents the
pure response before the client will transform the keys into `camelCase`.
***
### MediaItemResponse
```ts
type MediaItemResponse = object;
```
Defined in: [media/lib/types/Responses/mediaItemResponse.ts:8](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/media/lib/types/Responses/mediaItemResponse.ts#L8)
Represents the response data for a media item.
#### 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
##### account\_id
```ts
account_id: string;
```
Defined in: [media/lib/types/Responses/mediaItemResponse.ts:22](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/media/lib/types/Responses/mediaItemResponse.ts#L22)
The ID of your Nexmo account. This is the same as your API key.
##### etag
```ts
etag: string;
```
Defined in: [media/lib/types/Responses/mediaItemResponse.ts:78](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/media/lib/types/Responses/mediaItemResponse.ts#L78)
An identifier for the content. This will change if the content of the file has been changed
(i.e., if you upload a new version of the file). For more information, see Wikipedia: HTTP ETag.
##### id
```ts
id: string;
```
Defined in: [media/lib/types/Responses/mediaItemResponse.ts:72](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/media/lib/types/Responses/mediaItemResponse.ts#L72)
A UUID representing the object.
##### max\_downloads\_allowed
```ts
max_downloads_allowed: number;
```
Defined in: [media/lib/types/Responses/mediaItemResponse.ts:32](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/media/lib/types/Responses/mediaItemResponse.ts#L32)
The maximum number of times the file may be downloaded.
##### media\_size
```ts
media_size: number;
```
Defined in: [media/lib/types/Responses/mediaItemResponse.ts:42](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/media/lib/types/Responses/mediaItemResponse.ts#L42)
The size of the file in bytes.
##### metadata\_primary?
```ts
optional metadata_primary: string | null;
```
Defined in: [media/lib/types/Responses/mediaItemResponse.ts:62](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/media/lib/types/Responses/mediaItemResponse.ts#L62)
A user-set string containing metadata about the media file.
##### metadata\_secondary?
```ts
optional metadata_secondary: string | null;
```
Defined in: [media/lib/types/Responses/mediaItemResponse.ts:67](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/media/lib/types/Responses/mediaItemResponse.ts#L67)
A user-set string containing further metadata about the media file.
##### mime\_type
```ts
mime_type: string;
```
Defined in: [media/lib/types/Responses/mediaItemResponse.ts:17](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/media/lib/types/Responses/mediaItemResponse.ts#L17)
The IETF MIME type of the file.
##### original\_file\_name
```ts
original_file_name: string;
```
Defined in: [media/lib/types/Responses/mediaItemResponse.ts:12](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/media/lib/types/Responses/mediaItemResponse.ts#L12)
The filename of the object as it was originally uploaded.
##### public
```ts
public: boolean;
```
Defined in: [media/lib/types/Responses/mediaItemResponse.ts:57](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/media/lib/types/Responses/mediaItemResponse.ts#L57)
Whether the item is available for download without authentication.
##### store\_id
```ts
store_id: string;
```
Defined in: [media/lib/types/Responses/mediaItemResponse.ts:27](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/media/lib/types/Responses/mediaItemResponse.ts#L27)
An internal identifier of how the file is stored.
##### time\_created
```ts
time_created: string;
```
Defined in: [media/lib/types/Responses/mediaItemResponse.ts:47](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/media/lib/types/Responses/mediaItemResponse.ts#L47)
A timestamp for the time that the file was created.
##### time\_last\_updated
```ts
time_last_updated: string;
```
Defined in: [media/lib/types/Responses/mediaItemResponse.ts:52](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/media/lib/types/Responses/mediaItemResponse.ts#L52)
A timestamp for the time that the file was last modified.
##### times\_downloaded
```ts
times_downloaded: number;
```
Defined in: [media/lib/types/Responses/mediaItemResponse.ts:37](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/media/lib/types/Responses/mediaItemResponse.ts#L37)
The number of times the file has been downloaded.
***
### MediaParameters
```ts
type MediaParameters = object;
```
Defined in: [media/lib/types/mediaParameters.ts:4](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/media/lib/types/mediaParameters.ts#L4)
Represents parameters for querying media items.
#### Properties
##### endTime?
```ts
optional endTime: string;
```
Defined in: [media/lib/types/mediaParameters.ts:28](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/media/lib/types/mediaParameters.ts#L28)
Retrieve results created on or before this timestamp.
##### order?
```ts
optional order: "ascending" | "descending";
```
Defined in: [media/lib/types/mediaParameters.ts:8](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/media/lib/types/mediaParameters.ts#L8)
The order of search results. Must be one of 'ascending' or 'descending'.
##### pageIndex?
```ts
optional pageIndex: number;
```
Defined in: [media/lib/types/mediaParameters.ts:13](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/media/lib/types/mediaParameters.ts#L13)
Which page to retrieve in pagination.
##### pageSize?
```ts
optional pageSize: number;
```
Defined in: [media/lib/types/mediaParameters.ts:18](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/media/lib/types/mediaParameters.ts#L18)
How many items at most per page.
##### startTime?
```ts
optional startTime: string;
```
Defined in: [media/lib/types/mediaParameters.ts:23](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/media/lib/types/mediaParameters.ts#L23)
Retrieve results created on or after this timestamp.