Skip to content
Get started

List all workspaces in the account

client.WorkspaceAdmin.List(ctx, query) (*CursorPagination[Workspace], error)
GET/v1/account/workspaces

Lists every workspace in the account, optionally including archived ones. Admin only.

ParametersExpand Collapse
query WorkspaceAdminListParams
Cursor param.Field[string]Optional

Pagination cursor from previous response

IncludeArchived param.Field[bool]Optional

When true, archived workspaces are included in the results. Defaults to false (active workspaces only).

Limit param.Field[int64]Optional

Maximum number of results to return

formatint32
ReturnsExpand Collapse
type Workspace struct{…}

AccountResourceMetadata is used to represent a resource that is associated to an account but not to a workspace.

ID string

Unique identifier for the resource (prefixed ULID, e.g., “apikey_01HXK…”)

AccountID string

Account this resource belongs to for multi-tenant isolation (prefixed ULID)

Name string

Human-readable name for the resource (e.g., “Customer Support Agent”, “Email Tool”) Required for resources that users interact with directly

ProfileID string
ExternalID stringOptional

External ID for the resource (e.g., a workflow ID from an external system)

Labels map[string, string]Optional

Arbitrary key-value pairs for categorization and filtering Examples: {“environment”: “production”, “team”: “platform”, “version”: “v2”}

Description stringOptional
Status WorkspaceStatusOptional

Lifecycle status of the workspace. Archived workspaces reject all requests scoped to them. Server-populated.

formatenum
One of the following:
const WorkspaceStatusStatusEnabled WorkspaceStatus = "STATUS_ENABLED"
const WorkspaceStatusStatusDisabled WorkspaceStatus = "STATUS_DISABLED"
const WorkspaceStatusStatusArchived WorkspaceStatus = "STATUS_ARCHIVED"

List all workspaces in the account

package main

import (
  "context"
  "fmt"

  "github.com/cadenya/cadenya-go"
  "github.com/cadenya/cadenya-go/option"
)

func main() {
  client := cadenya.NewClient(
    option.WithAPIKey("My API Key"),
  )
  page, err := client.WorkspaceAdmin.List(context.TODO(), cadenya.WorkspaceAdminListParams{

  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
{
  "items": [
    {
      "metadata": {
        "id": "id",
        "accountId": "accountId",
        "name": "name",
        "profileId": "profileId",
        "externalId": "externalId",
        "labels": {
          "foo": "string"
        }
      },
      "spec": {
        "description": "description"
      },
      "status": "STATUS_ENABLED"
    }
  ],
  "pagination": {
    "nextCursor": "nextCursor",
    "total": 0
  }
}
Returns Examples
{
  "items": [
    {
      "metadata": {
        "id": "id",
        "accountId": "accountId",
        "name": "name",
        "profileId": "profileId",
        "externalId": "externalId",
        "labels": {
          "foo": "string"
        }
      },
      "spec": {
        "description": "description"
      },
      "status": "STATUS_ENABLED"
    }
  ],
  "pagination": {
    "nextCursor": "nextCursor",
    "total": 0
  }
}