# createDataSetAndAddPieces

```ts
function createDataSetAndAddPieces(options): Promise<{
  statusUrl: string;
  txHash: `0x${string}`;
}>;
```

Defined in: [packages/synapse-core/src/sp.ts:233](https://github.com/FilOzone/synapse-sdk/blob/1d6c4b9fe34534bf1087dfe41491b72be0b46858/packages/synapse-core/src/sp.ts#L233)

Create a data set and add pieces to it on PDP API

POST /pdp/data-sets/create-and-add

## Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `options` | [`PDPCreateDataSetAndAddPiecesOptions`](/reference/filoz/synapse-core/sp/type-aliases/pdpcreatedatasetandaddpiecesoptions/) | The options for the create data set and add pieces to it on PDP API. |

## Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<\{
  `statusUrl`: `string`;
  `txHash`: `` `0x${string}` ``;
\}\>

The response from the create data set and add pieces to it on PDP API.