> ## Documentation Index
> Fetch the complete documentation index at: https://docs.parable.work/llms.txt
> Use this file to discover all available pages before exploring further.

# Go SDK

> Authenticate and call the Workspace API from Go.

The Go client is
`github.com/parable-platform/platform-schemas/sdk/go/web-api`. It covers the
endpoints in the [Workspace API reference](/protocols/http/workspace).

## Access

Distribution is not public yet. Contact your Parable representative for access.

## Import and authenticate

Create a client with your Workspace API token.

```go theme={null}
import (
	"context"
	"fmt"
	"log"
	"os"

	webapisdk "github.com/parable-platform/platform-schemas/sdk/go/web-api"
	webapitypes "github.com/parable-platform/platform-schemas/types/go/web-api"
)

token := os.Getenv("PARABLE_API_TOKEN")
if token == "" {
	log.Fatal("Set PARABLE_API_TOKEN")
}

sdk, err := webapisdk.New(webapisdk.SDKConfig{
	BaseURL: "https://api.parable.work",
	Auth: &webapisdk.AuthConfig{
		Token: token,
	},
})
if err != nil {
	log.Fatal(err)
}

ctx := context.Background()
```

The client sends `Authorization: Bearer ...` on every call.

## Query Workspace data

Use the Go Flight SQL client alongside the Workspace API SDK when you need
table data rather than control-plane resources. The
[SQL SDK guide](/protocols/sql/query-with-sdks) shows how to execute a query and
consume its Arrow records. The [SQL primer](/protocols/sql) defines the shared
catalog and pool model.

## Read

Read the current member, then the Provider connections configured in the
Workspace:

```go theme={null}
me, err := sdk.UsersNamespace.Me(ctx)
if err != nil {
	log.Fatal(err)
}
fmt.Println(me.Name, me.Email)

connections, err := sdk.VendorsNamespace.TenantConnectorInstances(ctx)
if err != nil {
	log.Fatal(err)
}
for _, connection := range connections {
	fmt.Println(connection.Id, connection.ConnectionStatus)
}
```

## Update

Enable a tap. Replace the ID with one from the Workspace. List taps with
`sdk.TenantConnectorTapsNamespace.TenantConnectorTaps(ctx, nil)`.

```go theme={null}
tap, err := sdk.TenantConnectorTapsNamespace.UpdateTenantConnectorTap(
	ctx,
	"018f2a3b-9c4d-7e5f-8a6b-1c2d3e4f5a6b",
	webapitypes.UpdateTenantConnectorTapInput{
		Enabled: webapitypes.InputField[bool]{Set: true, Value: true},
	},
)
if err != nil {
	log.Fatal(err)
}
fmt.Println(tap.Id, tap.Enabled)
```

Omitted fields are left unchanged. To disable the tap, set `Value: false`.

<Tip>
  Groups in the [Workspace API reference](/protocols/http/workspace) are
  namespaces such as `sdk.UsersNamespace` and `sdk.VendorsNamespace`.
  Operations are methods such as `Me` and `TenantConnectorInstances`.
</Tip>
