# SourceDataset

**Beta:**
Salaxy API v04 is in beta: it may change, and it is not used in production yet. Build on v03, the current version.

CRUD for data funnel source datasets: uploaded sources normalised to flat JSON rows.

Salaxy API v04 (beta), **Finland only**. 7 operations. Interactive version: [REST API reference](https://code.salaxy.com/reference/rest-api-v04.md). Machine-readable: [OpenAPI document](https://code.salaxy.com/openapi/salaxy-04.json).

**The reference wins:**
These pages are generated from the OpenAPI document. If a guide and this reference disagree about a field, follow the reference. Error responses are not in the document — see [Errors](https://code.salaxy.com/reference/errors.md).

## `GET /v04/api/data-funnel/source-datasets`

**Performs an OData query to the search index.**

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `$search` | query | string |  |  |
| `$filter` | query | string |  | Specifies the logic to pull back a subset of records. |
| `$orderby` | query | string |  | Specifies the values used to sort the collection of entries. |
| `$select` | query | string |  | The $select system query option allows the clients to requests a limited set of properties for each entry. |
| `$top` | query | number |  | Specifies the subset of entries by count. |
| `$skip` | query | number |  | Specifies the count of entries to skip. |
| `$count` | query | boolean |  | Indicates whether or not to include a total entry count. |

Response: `PageResultOfSourceDatasetListItem`

Try it: [interactive reference](https://code.salaxy.com/reference/rest-api-v04.md#tag/sourcedataset/GET/v04/api/data-funnel/source-datasets)

## `POST /v04/api/data-funnel/source-datasets`

**Updates or creates a new object.**

Request body: `SourceDataset` (required)

Response: `SourceDataset`

Try it: [interactive reference](https://code.salaxy.com/reference/rest-api-v04.md#tag/sourcedataset/POST/v04/api/data-funnel/source-datasets)

## `GET /v04/api/data-funnel/source-datasets/{id}`

**Gets a single object based on identifier.**

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `id` | path | string | yes | Unique identifier for the object. |

Response: `SourceDataset`

Try it: [interactive reference](https://code.salaxy.com/reference/rest-api-v04.md#tag/sourcedataset/GET/v04/api/data-funnel/source-datasets/{id})

## `DELETE /v04/api/data-funnel/source-datasets/{id}`

**Deletes an object from the storage.**

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `id` | path | string | yes | Unique identifier for the object. |

Response: `string`

Try it: [interactive reference](https://code.salaxy.com/reference/rest-api-v04.md#tag/sourcedataset/DELETE/v04/api/data-funnel/source-datasets/{id})

## `GET /v04/api/data-funnel/source-datasets/new`

**Factory method that creates a new object.**

Response: `SourceDataset`

Try it: [interactive reference](https://code.salaxy.com/reference/rest-api-v04.md#tag/sourcedataset/GET/v04/api/data-funnel/source-datasets/new)

## `POST /v04/api/data-funnel/source-datasets/rows`

**Appends rows to an existing source dataset, or creates a new source dataset with the rows.**

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `id` | query | string |  | Identifier of an existing source dataset. If empty, a new source dataset is created. |

Request body: `object[]` (required)

Response: `SourceDataset`

Try it: [interactive reference](https://code.salaxy.com/reference/rest-api-v04.md#tag/sourcedataset/POST/v04/api/data-funnel/source-datasets/rows)

## `POST /v04/api/data-funnel/source-datasets/file`

**Uploads a file to an existing source dataset, or creates a new source dataset with the file.
The file is stored to sourceData as is (not parsed): format is set from the file extension,
text formats (csv, tsv, txt, jsonl) are stored as text, other files base64-encoded.
Max file size is 10 MB. Only csv, tsv, txt, jsonl, xlsx, xls, ods and pdf files are accepted.**

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `id` | query | string |  | Identifier of an existing source dataset. If empty, a new source dataset is created. |

Request body: `object` (required)

Response: `SourceDataset`

Try it: [interactive reference](https://code.salaxy.com/reference/rest-api-v04.md#tag/sourcedataset/POST/v04/api/data-funnel/source-datasets/file)
