> ## Documentation Index
> Fetch the complete documentation index at: https://docs.suprsend.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Tenants

> Learn how to create, update, fetch, & list tenants using Go SDK.

Tenants (previously named as brands) are used for white labeling notifications, personalizing template content or capturing admin preferences for another entity/organization. Tenants are workspace-level entities and by default, a tenant with `tenant_id="default"` (representing your organization) is created your workspace. Read more about tenants [here](/docs/tenants).

## Create / Update Tenant

This method will create a new tenant or update an existing tenant.

<CodeGroup>
  ```go Request theme={"system"}
  tenantPayload := &suprsend.Tenant{
    TenantName:      suprsend.String("Tenant Name"),
    Logo:           suprsend.String("Tenant logo url"),
    PrimaryColor:   suprsend.String("#FFFFFF"),
    SecondaryColor: suprsend.String("#000000"),
    TertiaryColor:  nil,
    SocialLinks: &suprsend.TenantSocialLinks{
      Facebook: suprsend.String("https://facebook.com/tenant"),
      Tiktok: suprsend.String("https://tiktok.com/tenant"),
      X: suprsend.String("https://x.com/tenant")
    },
    Properties: map[string]interface{}{
      "k1": "tenant settings 1",
      "k2": "tenant settings 2",
    },
  }

  res, err := suprClient.Tenants.Upsert(context.Background(), "__tenant_id__", tenantPayload)
  if err != nil {
    log.Fatalln(err)
  }
  log.Println(res)
  ```
</CodeGroup>

## Get tenant

<CodeGroup>
  ```go Request theme={"system"}
  tenant1, err := suprClient.Tenants.Get(context.Background(), "tenant_id")
  if err != nil {
    log.Fatalln(err)
  }
  log.Println(tenant1)
  ```

  ```go Response theme={"system"}
  {
     "tenant_id":"tenant_id",
     "tenant_name":"ABC Company",
     "logo":"https://logo_url.png",
     "timezone":"America/New_York",
     "blocked_channels":[
        "whatsapp",
        "email"
     ],
     "embedded_preference_url":"https://app.suprsend.com/preferences",
     "hosted_preference_domain":"preferences.suprsend.com",
     "primary_color":"#0751E8",
     "secondary_color":"#e308e3",
     "tertiary_color":"#1EE9F1",
     "social_links":{
        "website":"https://www.suprsend.com/",
        "facebook":"",
        "linkedin":"",
        "x":"",
        "instagram":"",
        "medium":"",
        "discord":"",
        "telegram":"",
        "youtube":"",
        "tiktok":""
     },
     "properties":{
        "address":"5678 Market Street Suite 300 San Francisco, CA 94103 USA"
     },
     "updated_at":"2025-02-27T10:21:15.235666Z"
  }
  ```
</CodeGroup>

## List tenants

By default, `limit=20`. The maximum value for `limit` is `1000`.

<CodeGroup>
  ```go Request theme={"system"}
  tenantsList, err := suprClient.Tenants.List(context.Background(), &suprsend.TenantListOptions{Limit: 10})
  if err != nil {
    log.Fatalln(err)
  }
  log.Println(tenantsList)
  ```

  ```go Response theme={"system"}
  {
     "meta":{
        "count":28,
        "limit":20,
        "offset":0
     },
     "results":[
        {
           "tenant_id":"tenant_01",
           "tenant_name":"ABC Company",
           "logo":"https://logo.url",
           ...
           "updated_at":"2025-03-13T18:16:35.744843Z"
        },
  	  {
           "tenant_id":"tenant_02",
           "tenant_name":"CDE Company",
           "logo":"https://logo.url",
           ...
           "updated_at":"2025-03-13T18:16:35.744843Z"
        }
  	...
     ]
  }
  ```
</CodeGroup>

## Add tenant in Workflow

<CodeGroup>
  ```go Request theme={"system"}
  wf := &suprsend.WorkflowTriggerRequest{
      Body: wfReqBody,
      TenantId: "tenant_id"
    }
  ```
</CodeGroup>

## Add tenant in Event

<CodeGroup>
  ```go Request theme={"system"}
  ev := &suprsend.Event{
    EventName:  "__event_name__",
    DistinctId: "_distinct_id_",
    Properties: map[string]interface{}{...},
    TenantId: "tenant_id"
  }
  ```
</CodeGroup>

***
