## Archive a dataset

`client.Datasets.Archive(ctx, datasetID) (*DatasetArchiveResponse, error)`

**delete** `/v5/datasets/{dataset_id}`

Soft-delete a dataset by archiving it; the row is retained and can be restored later.

This sets the dataset's `archived_at` timestamp rather than permanently removing it, and
cascades the same archival to the dataset's items and versions. Archiving is not idempotent:
if the dataset is already archived the call fails. The dataset can be brought back with the
PATCH restore request. The response reports the dataset id with `deleted` set to true.

### Parameters

- `datasetID string`

### Returns

- `type DatasetArchiveResponse struct{…}`

  - `ID string`

  - `Deleted bool`

  - `Object DatasetArchiveResponseObject`

    - `const DatasetArchiveResponseObjectDataset DatasetArchiveResponseObject = "dataset"`

### Example

```go
package main

import (
  "context"
  "fmt"

  "github.com/scaleapi/sgp-dev-go"
  "github.com/scaleapi/sgp-dev-go/option"
)

func main() {
  client := sgpdev.NewClient(
    option.WithAPIKey("My API Key"),
    option.WithAccountID("My Account ID"),
  )
  response, err := client.Datasets.Archive(context.TODO(), "dataset_id")
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.ID)
}
```

#### Response

```json
{
  "id": "id",
  "deleted": true,
  "object": "dataset"
}
```
