# addPieces

> **addPieces**(`client`, `options`): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`OutputType`\>

Defined in: [packages/synapse-core/src/sp/add-pieces.ts:40](https://github.com/FilOzone/synapse-sdk/blob/7fdc04df4e3c52366a9f0cd55da4c05e20b2ed82/packages/synapse-core/src/sp/add-pieces.ts#L40)

Add pieces to a data set

Call the Service Provider API to add pieces to a data set.

## Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `client` | `Client`\<`Transport`, `Chain`, `Account`\> | The client to use to add the pieces. |
| `options` | [`OptionsType`](/reference/filoz/synapse-core/sp/namespaces/addpieces/type-aliases/optionstype/) | The options for the add pieces. [addPieces.OptionsType](/reference/filoz/synapse-core/sp/namespaces/addpieces/type-aliases/optionstype/) |

## Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`OutputType`\>

The response from the add pieces operation. [addPieces.OutputType](/reference/filoz/synapse-core/sp/namespaces/addpieces/type-aliases/outputtype/)

## Throws

Errors [addPieces.ErrorType](/reference/filoz/synapse-core/sp/namespaces/addpieces/type-aliases/errortype/)