> ## 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.

# Rust SDK

> Authenticate and call the Workspace API from Rust.

The Rust client is `parable-web-api-sdk`. It covers the endpoints in the
[Workspace API reference](/protocols/http/workspace). Calls are async.

## Access

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

## Import and authenticate

Create a client with your Workspace API token.

```rust theme={null}
use parable_web_api_sdk::{ClientConfig, WebApiSdk};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let token = std::env::var("PARABLE_API_TOKEN")?;
    let sdk = WebApiSdk::new(ClientConfig::with_base_url(
        "https://api.parable.work",
        Some(token),
        None,
    ))?;

    Ok(())
}
```

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

## Query Workspace data

Use the Rust 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 batches. 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:

```rust theme={null}
let me = sdk.users.me(None).await?;
println!("{} {}", me.name, me.email);

let connections = sdk.vendors.tenant_connector_instances(None).await?;
for connection in connections {
    println!("{:?} {:?}", connection.name, connection.connection_status);
}
```

## Update

Enable a tap. Replace the ID with one from the Workspace.

```rust theme={null}
use parable_web_api_sdk::types::UpdateTenantConnectorTapInput;

let tap_id = "018f2a3b-9c4d-7e5f-8a6b-1c2d3e4f5a6b".parse()?;
let tap = sdk
    .tenant_connector_taps
    .update_tenant_connector_tap(
        tap_id,
        UpdateTenantConnectorTapInput {
            enabled: Some(true),
            name: None,
            description: None,
            output_schema: None,
            config: None,
            canonical_person_source: None,
        },
        None,
    )
    .await?;

println!("{:?} {:?}", tap.id, tap.enabled);
```

Omitted fields (`None`) are left unchanged. To disable the tap, pass
`enabled: Some(false)`.

<Tip>
  Groups in the [Workspace API reference](/protocols/http/workspace) are
  namespaces such as `sdk.users` and `sdk.vendors`. Operations are snake\_case
  methods such as `me` and `tenant_connector_instances`.
</Tip>
