組織メンバーを追加

POST/manage/organizations/:id/members

既存ユーザーを組織メンバーとして追加します。ADMIN のみ実行できます。

認証要ログイン

パスパラメータ

idstring必須

組織 ID。

リクエストボディ

userIdstring必須

追加するユーザー ID(必須)

rolestring

ADMIN / MEMBER のいずれか。

titlestring

役職。文字数制限なし。

startDate / endDatestring

在籍期間。YYYY-MM 形式。

currentboolean

在籍中かどうか。

補足

OAuth アクセストークンでアクセスした場合、レスポンス JSON から email フィールドが再帰的に除去されます(セッション認証の管理画面では除去されません)。

リクエスト
curl https://api.4s.link/manage/organizations/ID/members \
-X POST \
-H "Authorization: Bearer 4s_at_..." \
-H "Content-Type: application/json" \
-d '{
"userId": "a1b2c3d4-...",
"role": "MEMBER",
"title": "Software Engineer"
}'
レスポンス例
{
"id": "om1a2b3c-...",
"role": "ADMIN",
"title": "Software Engineer",
"startDate": "2024-04-01",
"endDate": null,
"current": true,
"user": { "id": "a1b2c3d4-...", "slug": "taro", "firstName": "太郎", "lastName": "山田", "avatarUrl": "https://.../avatar.png" }
}