# Terraform Provider

> Manage your StaticForm forms, connections, and settings as code with the official Terraform and OpenTofu provider.

The official **StaticForm provider** lets you manage your account as code with [Terraform](https://www.terraform.io/) or [OpenTofu](https://opentofu.org/). Create and update forms, API keys, integration connections, and account settings from the same workflow you use for the rest of your infrastructure.

The provider is published on both registries:

- **Terraform Registry**: [registry.terraform.io/providers/resoftware/staticform](https://registry.terraform.io/providers/resoftware/staticform/latest)
- **OpenTofu Registry**: [search.opentofu.org/provider/resoftware/staticform](https://search.opentofu.org/provider/resoftware/staticform/latest)

The full, always-current reference for every resource and data source lives in the registry docs. This page just gets you connected.

## Requirements

- Terraform 1.0+ or OpenTofu 1.6+
- A StaticForm API key ([create one](https://app.staticform.app/settings?tab=api-keys) under **Settings → API keys**)

## Configure the provider

Declare the provider and pass your API key. The key reads from the `STATICFORM_API_KEY` environment variable, so you don't have to put it in your configuration:

```hcl
terraform {
  required_providers {
    staticform = {
      source = "resoftware/staticform"
    }
  }
}

provider "staticform" {
  # api_key = "sf_..."   # or set STATICFORM_API_KEY in the environment
}
```

```bash
export STATICFORM_API_KEY="sf_your_key_here"
```

Scope the API key to only the permissions and forms your configuration needs. A key restricted to specific forms cannot touch anything else in your account.

## What you can manage

The provider exposes resources and data sources for forms (fields, submit actions, redirects, payments, tags), API keys, integration connections, collaborators, and account settings, plus data sources for reading submissions and execution logs.

For the exact resource names, arguments, and worked examples, follow the official provider docs on the [Terraform Registry](https://registry.terraform.io/providers/resoftware/staticform/latest/docs) or [OpenTofu Registry](https://search.opentofu.org/provider/resoftware/staticform/latest).