Skip to content

Onboard a new staff member

Request

🔐 Required role: API_ADMIN

📖 Data dictionary: Staff

Create a new staff member, optionally assigning them to a rate card

Creates a staff record and, when rateCardAssignment is provided, atomically creates the corresponding billing rate and average cost records in the same transaction.

Required fields:

  • firstName — staff member's first name
  • lastName — staff member's last name
  • pmsRef — practice management system reference
  • ref — unique staff reference code

Rate card assignment (rateCardAssignment): When provided, the rate card must already exist. Each entry in billingRates requires a valid rateTypeId. All three records (staff, billing rates, average cost) are created atomically — if any write fails the entire request is rolled back.

  • rateCardId — ID of an existing rate card (validated before any writes)
  • billingRates — one record per rate type; each requires a rateTypeId
  • averageCost — single average hourly cost for this staff member (optional)
Security
(BearerAuth and CfAccessClientId and CfAccessClientSecret) or BearerAuth
Bodyapplication/jsonrequired
firstNamestringrequired

Staff member's first name

Example:"Jane"
lastNamestringrequired

Staff member's last name

Example:"Doe"
pmsRefstringrequired

Practice management system reference identifier

Example:"EMP-1042"
refstringrequired

Unique staff reference code

Example:"doe-j"
emailstring or null, (email)

Primary email address

Example:"jane.doe@firm.com"
jobTitlestring or null

Job title (free-text)

Example:"Senior Associate"
jobTitleIdinteger or null, (int64)

ID of a job title lookup record

Example:7
departmentIdinteger or null, (int64)

ID of the department this staff member belongs to

Example:3
officeIdinteger or null, (int64)

ID of the office this staff member is based in

Example:2
orgIdinteger or null, (int64)

ID of the organization

Example:1
serviceLineIdinteger or null, (int64)

ID of the service line

Example:4
staffTypeIdinteger or null, (int64)

ID of the staff type (e.g. Partner, Manager, Associate)

Example:2
partnerStaffIdinteger or null, (int64)

ID of the partner staff member assigned to this person

Example:50
managerStaffIdinteger or null, (int64)

ID of the manager staff member

Example:30
supervisorStaffIdinteger or null, (int64)

ID of the supervisor staff member

Example:null
prefixstring or null

Name prefix (e.g. Dr., Ms.)

Example:"Ms."
startDatestring or null, (date-time)

Employment start date

Example:"2024-01-15T00:00:00"
endDatestring or null, (date-time)

Employment end date

Example:null
activeboolean

Whether the staff member is active

Default:true
Example:true
rateCardAssignmentobject or null

Optional rate card assignment. When provided, billing rate and average cost records are created atomically with the staff record. rateCardId and all rateTypeId values must reference existing records or the entire request is rejected with HTTP 400.

curl -i -X POST \
  https://api.sandbox.aiwyn.app/api/v1/staff \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'CF-Access-Client-Id: YOUR_API_KEY_HERE' \
  -H 'CF-Access-Client-Secret: YOUR_API_KEY_HERE' \
  -H 'Content-Type: application/json' \
  -d '{
    "firstName": "Jane",
    "lastName": "Doe",
    "pmsRef": "EMP-1042",
    "ref": "doe-j"
  }'

Responses

Staff member created successfully

Bodyapplication/json
dataobject
metaobject
Response
{ "data": { "id": 312, "pmsRef": "EMP-1042", "ref": "doe-j", "firstName": "Jane", "lastName": "Doe", "fullName": "Jane Doe", "email": "jane.doe@firm.com", "active": true, "version": 0, "createdAt": "2024-03-15T10:00:00Z", "updatedAt": "2024-03-15T10:00:00Z", "rateCardAssignment": null }, "meta": { "success": true, "message": "Staff member created successfully", "timestamp": "2024-03-15T10:00:00Z", "version": "v1" } }