# 組織API

現在のAPIトークンでアクセスできる組織を取得します。

Source: https://support.toolingmetrics.com/ja/api/reference/organizations/
Updated: 2026-10-29

<a id="endpoint"></a>

## エンドポイント

```
GET /v1/organizations
```

トークンの所有者がアクセスできる組織について、名称とIDの対応表を返します。所有者がスーパー管理者の場合を除き、有効な契約を持つ組織のみを含みます。

<a id="response"></a>

## レスポンス

```json
{
  "Acme Manufacturing": 12,
  "Acme Tooling": 15
}
```

ほかのAPIリクエストでは、この数値IDを`:organization_id`のパス要素として使います。

<a id="examples"></a>

## 使用例

```bash
curl https://api.toolingmetrics.com/v1/organizations \
  -H "Authorization: Bearer YOUR_TOKEN"
```

```python
import requests

response = requests.get(
    "https://api.toolingmetrics.com/v1/organizations",
    headers={"Authorization": "Bearer YOUR_TOKEN"},
)
response.raise_for_status()

orgs = response.json()
# {"Acme Manufacturing": 12, "Acme Tooling": 15}

# Get the ID for a specific organization by name
org_id = orgs["Acme Manufacturing"]
```

<a id="notes"></a>

## 注意事項

- このエンドポイントに`organization_id`のパスパラメータは不要です。
- レスポンスには、トークンの所有者が所属する組織のみを含みます。
- 契約が無効な組織は除外します。
