본문 바로가기
WIKI 기술 지식 베이스

조직 업데이트

원문 보기 위키 갱신

조직 업데이트 (Update Organization)

소유하거나 멤버로 속해 있는 조직의 설정을 바꾸고 싶을 때 쓰는 API예요. 오버에이지(overage) 사용 허용 여부, MFA 강제 여부, 복구 기능 활성화 여부를 이 엔드포인트 하나로 관리할 수 있어요.

출처: 문서

본문

Update an organization you own or are a member of.

조직을 업데이트하려면 PATCH /v1/organizations/{organizationSlug} 요청을 보내면 돼요. 아래처럼 cURL, Node.js SDK로 호출할 수 있어요.

```bash cURL (overages) theme={null} curl -L -X PATCH https://api.turso.tech/v1/organizations/{organizationSlug} \ -H 'Authorization: Bearer ***' \ -H 'Content-Type: application/json' \ -d '{ "overages": true }' ```
curl -L -X PATCH https://api.turso.tech/v1/organizations/{organizationSlug} \
  -H 'Authorization: Bearer ***' \
  -H 'Content-Type: application/json' \
  -d '{
      "require_mfa": true
  }'
import { createClient } from "@tursodatabase/api";

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

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

OpenAPI

openapi: 3.0.1
info:
  title: Turso Platform API
  description: API description here
  license:
    name: MIT
  version: 0.1.0
servers:
  - url: https://api.turso.tech
    description: Turso's Platform API
security: []
paths:
  /v1/organizations/{organizationSlug}:
    patch:
      summary: Update Organization
      description: Update an organization you own or are a member of.
      operationId: updateOrganization
      parameters:
        - $ref: '#/components/parameters/organizationSlug'
      requestBody:
        description: The updated organization details.
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                overages:
                  type: boolean
                  description: Enable or disable overages for the organization.
                require_mfa:
                  type: boolean
                  description: >-
                    Require all members of the organization to have multi-factor
                    authentication enabled. The requesting user must have MFA
                    enabled on their own account before enabling this
                    requirement.
                restore_enabled:
                  type: boolean
                  description: >-
                    Enable or disable deleted database and group recovery for
                    the organization. Must be updated separately from other
                    organization settings. Requires an admin or owner.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  organization:
                    $ref: '#/components/schemas/Organization'
                    description: The updated organization.
components:
  parameters:
    organizationSlug:
      in: path
      name: organizationSlug
      required: true
      schema:
        type: string
      description: The slug of the organization or user account.
  schemas:
    Organization:
      type: object
      properties:
        name:
          type: string
          description: >-
            The organization name. Every user has a `personal` organization for
            their own account.
          example: personal
        slug:
          type: string
          description: >-
            The organization slug. This will be your username for `personal`
            accounts.
          example: iku
        type:
          type: string
          description: >-
            The type of account this organization is. Will always be `personal`
            or `team`.
          example: personal
          enum:
            - personal
            - team
        overages:
          type: boolean
          description: >-
            The name of the organization. Every user has a `personal`
            organization for their own account.
          example: false
        require_mfa:
          type: boolean
          description: >-
            Whether all members of the organization are required to have
            multi-factor authentication enabled.
          example: false
        blocked_reads:
          type: boolean
          description: Returns the current status for blocked reads.
          example: false
        blocked_writes:
          type: boolean
          description: Returns the current status for blocked writes.
          example: false
        plan_id:
          type: string
          description: The pricing plan identifier this organization is subscribed to.
          example: developer
        plan_timeline:
          type: string
          description: The billing cycle for the paid plan, if any.
          example: monthly
        platform:
          type: string
          description: >-
            The external platform this organization is managed by. Will be empty
            for Turso managed organizations.
          example: vercel
        restore_enabled:
          type: boolean
          description: >-
            Whether deleted database and group recovery is enabled for the
            organization. Returned when retrieving a single organization.

더 알아보기 (Learn more)