초대 생성
조직에 사용자를 초대하는 API예요. 아직 Turso에 가입하지 않은 사용자라면 가입 링크를 받아요. 같은 이메일로 대기 중인 초대가 이미 있으면 새 초대로 교체돼요.
출처: 문서
본문
조직에 사용자를 초대해요. Turso에 아직 가입하지 않은 사용자는 가입 링크를 받아요. 같은 이메일로 대기 중인 초대가 이미 있으면 교체돼요.
Warning: 초대는 Scaler 플랜 이상에서만 사용할 수 있어요.
Info: 이메일 또는 username으로 초대할 수 있어요 — 둘 중 정확히 하나만 제공하세요. username으로 초대하면 그 사용자의 등록된 이메일로 초대가 전송돼요.
Info: 다른 사용자를 초대하려면 owner 또는 admin이어야 해요. 개인 계정이 아니라 팀에만 사용자를 초대할 수 있어요.
Info: 같은 이메일로 대기 중인 초대가 이미 있으면 새 초대로 교체돼요.
curl -L -X POST https://api.turso.tech/v2/organizations/{organizationSlug}/invites \
-H 'Authorization: Bearer ***' \
-H 'Content-Type: application/json' \
-d '{"email": "[email protected]", "role": "member"}'
curl -L -X POST https://api.turso.tech/v2/organizations/{organizationSlug}/invites \
-H 'Authorization: Bearer ***' \
-H 'Content-Type: application/json' \
-d '{"username": "turso-user", "role": "member"}'
import { createClient } from "@tursodatabase/api";
const turso = createClient({
org: "mycompany",
token: "",
});
const invite = await turso.organizations.inviteUser(
"[email protected]",
"member"
);
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:
/v2/organizations/{organizationSlug}/invites:
post:
summary: Invite Organization Member
description: >-
Invite a user to an organization. If the user isn't already registered
with Turso, they will receive a signup link. If an existing pending
invite exists for the same email, it will be replaced.
operationId: inviteOrganizationMemberV2
parameters:
- $ref: '#/components/parameters/organizationSlug'
requestBody:
description: >-
The user you want to invite to join Turso, and your organization.
Provide exactly one of email or username.
required: true
content:
application/json:
schema:
type: object
properties:
email:
type: string
description: >-
The email of the user you want to invite. Exactly one of
email or username must be provided.
username:
type: string
description: >-
The username of an existing Turso user you want to invite.
Exactly one of email or username must be provided.
role:
type: string
enum:
- admin
- member
- viewer
description: The role given to the user.
default: member
responses:
'200':
description: Successful response
content:
application/json:
schema:
type: object
properties:
invited:
$ref: '#/components/schemas/InviteCreatedV2'
components:
parameters:
organizationSlug:
in: path
name: organizationSlug
required: true
schema:
type: string
description: The slug of the organization or user account.
schemas:
InviteCreatedV2:
type: object
properties:
email:
type: string
description: The email of the person invited.
example: [email protected]
role:
type: string
enum:
- admin
- member
- viewer
description: The assigned role for the invited user.
example: member
organization:
type: string
description: The name of the organization the user was invited to.
example: mycompany