**Source URL:** https://limited.veevavault.dev/medical/custom-pages/vault-web-sdk/25.3.0/interfaces/vaultapiclient.md

# VaultApiClient

Provides functions to use Vault API from client code.

## Properties {#properties}

### fetch {#fetch}

> 
**fetch**: (`input`, `init?`) => `Promise`<`Response`>

Makes authorized requests to Vault API and prepends the `/api` prefix to the path.
This is a wrapped version of JavaScript's `fetch` function.

#### Parameters {#parameters}

##### input {#input}

`string`

A URL string to make a request to

##### init? {#init}

`RequestInit`

A [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request) object
containing any custom settings that you want to apply to the request

#### Returns {#returns}

`Promise`<`Response`>

A [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)
which is fulfilled with a [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) object
representing the server's response

#### See {#see}

* [https://limited.veevavault.dev/vault-api/api-reference](/vault-api/api-reference)

* [https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch)

#### Remarks {#remarks}

Only accepts strings as input, not URL or Request objects.

Naively prepends `/api` to the provided URL. For example, calling this with `"http://example.com`"
would make a request to `"/api/http://example.com`".

#### Example {#example}

```
import { vaultApiClient } from '@veeva/vault'

const response = await vaultApiClient.fetch(
      '/v25.1/objects/documents/301',
      {
        headers: {
          Accept: 'application/json',
        },
      }
    );
const json = response.json();

```


---

**Previous:** [PageParameters](/medical/custom-pages/vault-web-sdk/25.3.0/interfaces/pageparameters)  
**Next:** [Type Aliases](/medical/custom-pages/vault-web-sdk/25.3.0/type-aliases)