ja
チームとフリートテクニシャンの追加

テクニシャンの追加

現在のビジネスの下にテクニシャンのメンバーシップを作成します。phone/email が既存ユーザーと一致する場合、そのアカウントがリンクされます。そうでなければ新しいユーザー ID が作成されます(招待メールはなし — ログインは後でパスワードレスになります)。いずれの場合もメンバーシップはアクティブで開始します。テクニシャンが以前に削除されていた(deactive)場合は、代わりに再有効化されます。オーナー/管理者グループは API キーでは割り当てできず、サンドボックスモードでは一切割り当てできません。 任意の関係(すべて検証されます。存在しない ID があれば → 404 TECHNICIAN_NOT_FOUND に `missing_ids` が付きます): `buddy_ids` はこのテクニシャンのバディリストを設定します(リード作成時に使用)。`lead_ids` はこのテクニシャンを各リードのバディとして追加します(バディ作成時に使用 — 同じ lead↔buddy 関係をバディ側から付ける方法)。`service_area_ids` はテクニシャンをそれらのサービスエリアに割り当てます。 `start_location_type=office` は作成時にビジネス住所 + 座標をテクニシャンにスナップショットします。ボディ内の `address`、`start_location_lat`、`start_location_long` は無視されます。ビジネスに座標が設定されている必要があります(なければ 400 BUSINESS_LOCATION_MISSING)。`start_location_type=home`(または空)はボディの住所 + 座標を使用します。

引数

Idempotency-Keystringheader任意
Unique key making retries safe: a repeat send with the same key replays the original response (header Idempotent-Replayed: true) instead of re-running the operation. Reusing a key with a different body returns 422 IDEMPOTENCY_KEY_REUSE.
addressobjectbody任意
Home address (the day-start point when start_location_type=home).
citystringbody任意
City / locality.
countrystringbody任意
Country (free-form or ISO code).
formattedstringbody任意
完全な表示文字列です。設定されている場合、表示では個別の各パーツより優先されます。
linestringbody任意
番地 1 行目です。
line2stringbody任意
番地 2 行目(部屋番号、スイート)です。
postal_codestringbody任意
郵便番号 / ZIP コードです。
statestringbody任意
State / province / region.
assignment_tierenumbody任意
マッチングエンジンが割り当てに使うクルーティアです: lead(ジョブを率いることができる)、buddy(クルーの補助)、float(自動クルー割り当てから除外)。
buddy_idsarray<string>body任意
BuddyIDs — このテクニシャンのバディ(リード作成時に設定)。LeadIDs — このテクニシャンがバディとして属するリード(バディ作成時に設定。テクニシャンが各リードのバディリストに追加されます)。ServiceAreaIDs — テクニシャンを割り当てるサービスエリア。すべて省略可能です。
business_group_idstringbody必須
新しいメンバーのロールグループです。ID は GET /permission/groups で確認できます(オーナー/管理者グループはサンドボックスモードでは拒否されます)。
emailstringbody任意
Email address. At least one of phone/email is required (identity resolution key).
full_namestringbody必須
The person's full display name. Required; max 255 chars.
job_titlestringbody任意
表示用の肩書き(例: "Senior HVAC Technician")です。
join_datestringbody任意
初出勤日(YYYY-MM-DD)です。
lead_idsarray<string>body任意
Leads this technician is a buddy of (set when creating a buddy; the technician is appended to each lead's buddy list). Optional; max 50 technician ids.
phonestringbody任意
phone/email の少なくとも一方が必須です(ID 解決のキー)。
service_area_idsarray<string>body任意
Service areas to assign the technician to. Optional; max 50. Discover via GET /service-areas.
start_location_latnumberbody任意
明示的な当日開始座標です。設定されている場合は住所のジオコードより優先されます。
start_location_longnumberbody任意
Explicit day-start longitude in decimal degrees (-180..180); when set it wins over the address geocode.
start_location_typeenumbody任意
テクニシャンが 1 日を開始する場所です: home(本人の住所)または office(ビジネスの所在地)。エンジンの移動見積もりを左右します。
POST/v1/technicians
curl -X POST "https://api.crisphive.com/v1/technicians" \
  -H "Authorization: Bearer chsk_test_4eC8xQ9mZ2pL7Ka0rT" \
  -H "Content-Type: application/json" \
  -d '{
  "address": {
    "city": "San Francisco",
    "country": "US",
    "formatted": "123 Market Street, San Francisco, CA 94103",
    "line": "123 Market Street",
    "line2": "Suite 200",
    "postal_code": "94103",
    "state": "CA"
  },
  "assignment_tier": "lead",
  "buddy_ids": [
    "9b2f6c3e-1a4d-4f0a-8f2e-7c5d1b3a9e01"
  ],
  "business_group_id": "9b2f6c3e-1a4d-4f0a-8f2e-7c5d1b3a9e01",
  "email": "jane.doe@example.com",
  "full_name": "Jane Cooper",
  "job_title": "Sample title",
  "join_date": "2026-07-02",
  "lead_ids": [
    "9b2f6c3e-1a4d-4f0a-8f2e-7c5d1b3a9e01"
  ],
  "phone": "+14155550142",
  "service_area_ids": [
    "9b2f6c3e-1a4d-4f0a-8f2e-7c5d1b3a9e01"
  ],
  "start_location_lat": 1,
  "start_location_long": 1,
  "start_location_type": "home"
}'
リクエストボディ
{
"address": {
"city": ,
"country": ,
"formatted": ,
"line": ,
"line2": ,
"postal_code": ,
"state":
},
"assignment_tier": ,
"buddy_ids": [
],
"business_group_id": ,
"email": ,
"full_name": ,
"job_title": ,
"join_date": ,
"lead_ids": [
],
"phone": ,
"service_area_ids": [
],
"start_location_lat": ,
"start_location_long": ,
"start_location_type":
}

レスポンス