> For the complete documentation index, see [llms.txt](https://docs.tessell.com/tessell/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tessell.com/tessell/faq/api-and-terraform.md).

# API and Terraform

Tessell is built on an **API-first architecture**. Every action available in the Tessell portal can also be performed programmatically using the REST API or Terraform.

***

## REST API

Tessell exposes a comprehensive REST API that covers all portal functionality — provisioning database services, managing users, configuring networks, and more.

### Code Equivalent button

For most actions in the portal, Tessell provides a **`<> Code`** button (bottom-right corner of dialogs and action panels). Selecting it generates the equivalent code in your preferred language or format:

* Shell (curl)
* Python
* Go
* Java
* JavaScript
* PowerShell
* Terraform (HCL)

You can copy or download the generated code directly from the panel.

This is the fastest way to get started with the API — perform the action in the UI once, then copy the code to automate it.

***

## Terraform

Tessell provides an official Terraform provider that lets you manage Tessell resources as infrastructure-as-code.

### Getting started with Terraform

* **Provider documentation:** [Tessell Terraform Provider on the Terraform Registry](https://registry.terraform.io/providers/tessell-cloud/tessell/latest/docs)
* **In the portal:** Select the **`<> Code`** button on any resource creation or management panel and choose **Terraform (HCL)** to get a ready-to-use snippet.

### What can be managed with Terraform?

The published `tessell-cloud/tessell` provider supports the following **resources** (read-write):

| Resource                                 | Purpose                                      |
| ---------------------------------------- | -------------------------------------------- |
| `tessell_db_service`                     | Create and manage database services          |
| `tessell_db_snapshot`                    | Manage on-demand snapshots                   |
| `tessell_db_service_delete_schedule`     | Schedule automated deletion of a DB service  |
| `tessell_db_service_start_stop_schedule` | Schedule start/stop windows for a DB service |
| `tessell_parameter_profile`              | Create and manage parameter profiles         |

Availability Machines are available as **read-only data sources** only — they cannot be created or modified via Terraform.

Refer to the [Terraform provider documentation](https://registry.terraform.io/providers/tessell-cloud/tessell/latest/docs) for the full, up-to-date list of resources and data sources.

***

## Frequently asked questions

**Q: Does the Tessell API require authentication?** Yes. API calls are authenticated using an API key. Generate a key from **User Profile → API Keys** in the Tessell portal. Pass it as a Bearer token in the `Authorization` header.

> **Note on non-expiring keys:** The **Never Expire** option may not be available in all tenants — it is a feature-gated capability. If the option is greyed out, ask your Tessell administrator to enable the **Non Expiring API Key** feature.

**Q: Where can I find the API reference?** The full REST API reference is available through your Tessell account team. For Terraform, the provider reference is available at the [Terraform Registry](https://registry.terraform.io/providers/tessell-cloud/tessell/latest/docs).

**Q: Can I mix Terraform and manual portal actions?** Yes. Tessell's state is consistent regardless of how a resource was created. You can import existing resources into Terraform using `terraform import` if you want to bring portal-provisioned resources under IaC management.

**Q: Are webhooks or event notifications available?** Tessell supports integration with external monitoring and notification systems through the Integrations feature available on each database service. Refer to the Integrations tab on any database service's home page for supported integration types.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.tessell.com/tessell/faq/api-and-terraform.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
