# dokploy_organization (Resource)

An organization: the top-level tenant that owns projects, servers, git providers, and members. The API key's user becomes the owner of an organization that Terraform creates.

~> **The provider works inside the API key's active organization and cannot switch to another one.** Every other resource of this provider lands in the active organization. Use this resource to keep an organization record under Terraform (its name, logo, and default role), not to place resources in it. To manage resources in a second organization, configure a second provider instance with an API key whose active organization is that one.

## Example Usage

```terraform
# Keep the organization record under Terraform: its name, logo, and the role
# that a new member gets. The provider itself always works inside the API
# key's active organization.
resource "dokploy_organization" "main" {
  name         = "Acme"
  logo         = "https://acme.example.com/logo.png"
  default_role = "member"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `name` (String) Display name.

### Optional

- `default_role` (String) Role that a new member gets: `member`, `admin`, or the name of a custom role. Dokploy rejects an unknown role name and keeps the stored role when you remove the attribute, so the provider keeps the last value in the state after a removal.
- `logo` (String) URL of the logo image. If you remove it from the configuration, the provider clears it.

### Read-Only

- `created_at` (String) Creation timestamp from the server.
- `id` (String) Organization id.
- `owner_id` (String) User id of the owner: the user of the API key that created the organization.
- `slug` (String) URL slug that Dokploy generates.

## Import

Import is supported using the following syntax:

The [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import) can be used, for example:

```shell
terraform import dokploy_organization.main rUjt8eyMNJHM6J1irMxmR
```