Use the official LangSmith Terraform provider to manage workspaces, roles, members, evaluators, run rules, and alert rules as code.
The official LangSmith Terraform provider lets you manage LangSmith organization and workspace resources as code—workspaces, custom roles, organization and workspace members, evaluators, run rules, and alert rules. It’s the infrastructure-as-code counterpart to managing your organization using the API.
Add the provider to your Terraform configuration and pin a version:
terraform { required_providers { langsmith = { source = "langchain-ai/langsmith" version = "~> 0.0.2" } }}provider "langsmith" { # Cloud (US). Use https://eu.api.smith.langchain.com for the EU region, # or your self-hosted URL. Can also be set via LANGSMITH_ENDPOINT. api_url = "https://api.smith.langchain.com" # Optional: scope workspace-level resources to a specific workspace. workspace_id = "00000000-0000-0000-0000-000000000000"}
Organization-scoped operations—creating workspaces and inviting organization members—require an organization-scoped service key with Organization Admin permissions. Set workspace_id (or LANGSMITH_WORKSPACE_ID) to target workspace-scoped resources such as workspace memberships, evaluators, and run rules.