Skip to content
Go to Boltz API

Archive a workspace

client.Admin.Workspaces.Archive(ctx, workspaceID) (*AdminWorkspaceArchiveResponse, error)
POST/compute/v1/admin/workspaces/{workspace_id}/archive

Archives a workspace and deactivates all its API keys. This action is irreversible.

ParametersExpand Collapse
workspaceID string
ReturnsExpand Collapse
type AdminWorkspaceArchiveResponse struct{…}
ID string

Workspace ID

ArchivedAt Time
formatdate-time
CreatedAt Time
formatdate-time
DataRetention AdminWorkspaceArchiveResponseDataRetention

How long result data is retained before automatic deletion. Defaults to 7 days if not specified. Maximum retention is 14 days (336 hours).

Unit AdminWorkspaceArchiveResponseDataRetentionUnit

Time unit for retention duration

Accepts one of the following:
const AdminWorkspaceArchiveResponseDataRetentionUnitHours AdminWorkspaceArchiveResponseDataRetentionUnit = "hours"
const AdminWorkspaceArchiveResponseDataRetentionUnitDays AdminWorkspaceArchiveResponseDataRetentionUnit = "days"
Value int64

Duration value. Maximum retention is 14 days (or 336 hours).

minimum1
IsDefault bool

Whether this is the default workspace

Name string

Workspace name

UpdatedAt Time
formatdate-time

Archive a workspace

package main

import (
  "context"
  "fmt"

  "github.com/boltz-bio/boltz-api-go"
  "github.com/boltz-bio/boltz-api-go/option"
)

func main() {
  client := boltzapi.NewClient(
    option.WithAPIKey("My API Key"),
  )
  response, err := client.Admin.Workspaces.Archive(context.TODO(), "workspace_id")
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.ID)
}
{
  "id": "id",
  "archived_at": "2019-12-27T18:11:19.117Z",
  "created_at": "2019-12-27T18:11:19.117Z",
  "data_retention": {
    "unit": "hours",
    "value": 1
  },
  "is_default": true,
  "name": "name",
  "updated_at": "2019-12-27T18:11:19.117Z"
}
Returns Examples
{
  "id": "id",
  "archived_at": "2019-12-27T18:11:19.117Z",
  "created_at": "2019-12-27T18:11:19.117Z",
  "data_retention": {
    "unit": "hours",
    "value": 1
  },
  "is_default": true,
  "name": "name",
  "updated_at": "2019-12-27T18:11:19.117Z"
}