---
editLink: false
lastUpdated: false
---

[@salesforce/b2c-tooling-sdk](../../../modules.md) / [operations/ods](../index.md) / buildSandboxSettings

# Function: buildSandboxSettings()

> **buildSandboxSettings**(`options`): \{ \} \| `undefined`

Defined in: [packages/b2c-tooling-sdk/src/operations/ods/sandbox-settings.ts:71](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/b0472c439ca6570be5c7809783a46327d7493694/packages/b2c-tooling-sdk/src/operations/ods/sandbox-settings.ts#L71)

Builds the sandbox `settings` object granting OCAPI and WebDAV permissions to
a client ID. New sandboxes have no API permissions by default, so the client
used to create the sandbox (e.g. for code deployment) must be granted access
explicitly or subsequent operations will fail with authorization errors.

When `ocapiSettings`/`webdavSettings` are provided they fully replace the
defaults. Otherwise, when a `clientId` is provided, the client is granted the
default resources/permissions.

## Parameters

### options

[`BuildSandboxSettingsOptions`](../interfaces/BuildSandboxSettingsOptions.md)

## Returns

\{ \} \| `undefined`

The settings object, or `undefined` when there is nothing to set
  (no client ID and no custom settings).

## Example

```ts
const settings = buildSandboxSettings({clientId: config.values.clientId});
await odsClient.POST('/sandboxes', {body: {realm, ttl, settings}});
```
