> This page is for version API + Legacy Read.
> For other versions, use one of these documentation indexes:
> - API (default): https://docs.getthera.com/api/llms.txt
> - API + Legacy Read: https://docs.getthera.com/api-legacy-read/llms.txt
> - API + Legacy Full: https://docs.getthera.com/api-legacy-full/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.getthera.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.getthera.com/_mcp/server.

# Get Teams For Company

GET https://api.getthera.com/companies/{companyId}/teams

Get all of the teams and their contracts for a company

Reference: https://docs.getthera.com/thera-api/company/company-api/get-teams

## Authentication

- `X-Thera-API-Key` header (required) — API Key authentication via header

## Servers

- `https://api.getthera.com` (Production, default)
- `https://api.staging.getthera.com` (Staging)

## Request

### Path parameters

- `companyId` (string, required)

## Response

### 200

- `teams` (map from string to TeamAndDetails, required)

## Types

### TeamAndDetails

- `team` (Team, required) — Will be deprecated in favor of `name`.
- `name` (string, required)
- `contractIds` (list of string, required)
- `managers` (map from string to TeamRoleAndDetails, required)
- `autoApproveInvoice` (boolean, optional) — If enabled, all fixed rate invoices will be automatically approved for payment.
- `autoPay` (TeamAutoPay, optional) — Auto-pay configuration for fixed rate invoices.
- `defaultPayCycles` (map from enum to DefaultPayCycle, optional) — Suggested pay cycles for different wage types when creating contracts.

### Team

- `name` (string, required)

### TeamRoleAndDetails

We may allow granular changes to roles so creating this wrapper type to future-proof

- `role` (enum, required)
  - Allowed values: `role_admin`, `role_org_manager`, `role_people_manager`, `role_people_manager_and_payer`, `role_viewer_sensitive`, `role_apar_team_manager`
- `permissions` (list of enum, required) — Extra permissions can only be added to People Manager and People Manager + Payer roles.
  - Allowed values: `perm_adjust_payroll_and_payments`, `perm_approve_agreement_details_requests`, `perm_approve_payroll_and_payments`, `perm_manage_people_and_contracts`, `perm_manage_team_admins`, `perm_manage_team_settings`, `perm_pay_invoices`, `perm_view_nonsensitive_employee_info`, `perm_view_sensitive_employee_info`, `perm_view_sensitive_payroll_info`

### TeamAutoPay

- `enabled` (boolean, required) — If enabled, all fixed rate invoices will automatically be paid x days in advance of their due date, where x is the number of days that the company has set for their invoices to be available ahead of their due date.
- `paymentMethodId` (string, optional) — ID of the payment method auto-pay charges.
- `disabledReason` (enum, optional) — Set by the system when auto-pay is automatically disabled. Null when disabled manually by an admin. When present, auto-pay is paused and the system will re-enable it automatically once the condition is resolved (e.g. account funded). Cleared by the system on re-enable, or by an admin explicitly disabling the team's auto-pay.
  - Allowed values: `INSUFFICIENT_FUNDS`
- `requiredBalance` (double, optional) — The payroll amount (in USD) that failed due to insufficient funds. Used to determine when the account has been sufficiently funded to re-enable auto-pay. Only set when disabledReason is INSUFFICIENT_FUNDS. Cleared alongside disabledReason.
- `insufficientFundsNotifiedAt` (string, optional) — ISO 8601 timestamp of when the first insufficient funds email was sent to admins. Used as the reference point for scheduling follow-up notifications. Cleared when auto-pay is re-enabled or manually disabled by an admin.
- `followUpCount` (integer, optional) — Tracks how many follow-up notifications have been sent after the initial insufficient funds email. 0 or absent = only initial email sent. 1 = day-2 follow-up email sent. 2 = day-4 follow-up email sent. No further follow-ups after this. Cleared when auto-pay is re-enabled or manually disabled by an admin.

### DefaultPayCycle

- `cycleEnd` (PayCycleEnd, required)
- `paymentDueDays` (integer, required)

### PayCycleEnd

- `type`: `weekly`
  - `dayOfWeek` (enum, required)
    - Allowed values: `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`, `SATURDAY`, `SUNDAY`
- `type`: `biweekly`
  - `dayOfWeek` (enum, required)
    - Allowed values: `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`, `SATURDAY`, `SUNDAY`
- `type`: `monthly`
  - `value` (MonthlyPayCycleEnd, required)
- `type`: `semimonthly`
  - `value` (SemiMonthlyPayCycleEnd, required)

### MonthlyPayCycleEnd

- `type`: `dayOfMonth`
  - `value` (integer, required)
- `type`: `lastDayOfMonth`
- `type`: `lastDayOfWeekOfMonth`
  - `value` (enum, required)
    - Allowed values: `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`, `SATURDAY`, `SUNDAY`

### SemiMonthlyPayCycleEnd

- `type`: `fifteenthAndEndOfMonth`
- `type`: `dayOfMonth`
  - `value` (integer, required)

## Examples

**Response**

```json
{
  "teams": {
    "teams": {
      "team": {
        "name": "name"
      },
      "name": "name",
      "contractIds": [
        "contractIds",
        "contractIds"
      ],
      "managers": {
        "managers": {
          "role": "role_admin",
          "permissions": [
            "perm_adjust_payroll_and_payments",
            "perm_adjust_payroll_and_payments"
          ]
        }
      },
      "autoApproveInvoice": true,
      "autoPay": {
        "enabled": true,
        "paymentMethodId": "paymentMethodId",
        "disabledReason": "INSUFFICIENT_FUNDS",
        "requiredBalance": 1.1,
        "insufficientFundsNotifiedAt": "insufficientFundsNotifiedAt",
        "followUpCount": 1
      },
      "defaultPayCycles": {
        "WEEKLY": {
          "cycleEnd": {
            "type": "weekly",
            "dayOfWeek": "MONDAY"
          },
          "paymentDueDays": 1
        }
      }
    }
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.getthera.com/companies/companyId/teams"

headers = {"X-Thera-API-Key": "<apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.getthera.com/companies/companyId/teams';
const options = {method: 'GET', headers: {'X-Thera-API-Key': '<apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.getthera.com/companies/companyId/teams"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("X-Thera-API-Key", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.getthera.com/companies/companyId/teams")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["X-Thera-API-Key"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.getthera.com/companies/companyId/teams")
  .header("X-Thera-API-Key", "<apiKey>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.getthera.com/companies/companyId/teams', [
  'headers' => [
    'X-Thera-API-Key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.getthera.com/companies/companyId/teams");
var request = new RestRequest(Method.GET);
request.AddHeader("X-Thera-API-Key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["X-Thera-API-Key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getthera.com/companies/companyId/teams")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```