# 更新组织

> 更新你拥有或作为成员加入的组织。
> Canonical HTML: https://tursodb.cn/zh-cn/docs/api-reference/organizations/update/
> Upstream Source (MIT): https://docs.turso.tech/api-reference/organizations/update
> Language: zh-CN

---
```bash cURL（超额用量）
curl -L -X PATCH https://api.turso.tech/v1/organizations/{organizationSlug} \
  -H 'Authorization: Bearer TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
      "overages": true
  }'
```

```bash cURL（要求 MFA）
curl -L -X PATCH https://api.turso.tech/v1/organizations/{organizationSlug} \
  -H 'Authorization: Bearer TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
      "require_mfa": true
  }'
```

```ts Node.js
import { createClient } from "@tursodatabase/api";

const turso = createClient({
  org: "...",
  token: "",
});

const organization = await turso.organizations.update("mycompany", {
  overages: true,
});
```


## OpenAPI

````yaml PATCH /v1/organizations/{organizationSlug}
openapi: 3.0.1
info:
  title: Turso Platform API
  description: 此处为 API 描述
  license:
    name: MIT
  version: 0.1.0
servers:
  - url: https://api.turso.tech
    description: Turso 的平台 API
security: []
paths:
  /v1/organizations/{organizationSlug}:
    patch:
      summary: 更新组织
      description: 更新你拥有或作为成员加入的组织。
      operationId: updateOrganization
      parameters:
        - $ref: '#/components/parameters/organizationSlug'
      requestBody:
        description: 更新后的组织详情。
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                overages:
                  type: boolean
                  description: 为该组织启用或禁用超额用量。
                require_mfa:
                  type: boolean
                  description: >-
                    要求组织内的所有成员都启用多因素认证。发起请求的用户必须先在自己的账户上启用
                    MFA，才能启用此要求。
                restore_enabled:
                  type: boolean
                  description: >-
                    为该组织启用或禁用已删除数据库和组的恢复功能。必须与其他组织设置分开更新。
                    需要管理员或所有者权限。
      responses:
        '200':
          description: 成功响应
          content:
            application/json:
              schema:
                type: object
                properties:
                  organization:
                    $ref: '#/components/schemas/Organization'
                    description: 更新后的组织。
components:
  parameters:
    organizationSlug:
      in: path
      name: organizationSlug
      required: true
      schema:
        type: string
      description: 组织或用户账户的 slug。
  schemas:
    Organization:
      type: object
      properties:
        name:
          type: string
          description: >-
            组织名称。每个用户都拥有一个用于自身账户的 `personal` 组织。
          example: personal
        slug:
          type: string
          description: >-
            组织 slug。对于 `personal` 账户，这将是你的用户名。
          example: iku
        type:
          type: string
          description: >-
            该组织的账户类型。始终为 `personal` 或 `team`。
          example: personal
          enum:
            - personal
            - team
        overages:
          type: boolean
          description: >-
            组织名称。每个用户都拥有一个用于自身账户的 `personal` 组织。
          example: false
        require_mfa:
          type: boolean
          description: >-
            是否要求组织内的所有成员都启用多因素认证。
          example: false
        blocked_reads:
          type: boolean
          description: 返回读操作被阻止的当前状态。
          example: false
        blocked_writes:
          type: boolean
          description: 返回写操作被阻止的当前状态。
          example: false
        plan_id:
          type: string
          description: 该组织订阅的定价方案标识符。
          example: developer
        plan_timeline:
          type: string
          description: 付费方案的计费周期（如果有）。
          example: monthly
        platform:
          type: string
          description: >-
            管理该组织的外部平台。对于由 Turso 管理的组织，此字段为空。
          example: vercel
        restore_enabled:
          type: boolean
          description: >-
            该组织是否启用了已删除数据库和组的恢复功能。在获取单个组织时返回。

````
