API 参考Employees
Add a new employee to the organization
Creates a new employee record. Email must match an allowed domain. Optionally sends an invitation email.
Requires employees:write scope. Requires Idempotency-Key header.
Side effects: Creates audit log entry MEMBER_ADDED. Sends invitation email if send_invitation_email is true.
Authorization
apiKey AuthorizationBearer <token>
API key: Authorization: Bearer mpk_live_<key>
In: header
Header Parameters
Idempotency-Key*string
UUID v4. Required on all write operations. Prevents duplicate execution on retry.
Format
uuidRequest Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://motivation-money.vercel.app/api/v1/employees" \ -H "Idempotency-Key: 7f3c4d2a-8b1e-4f6a-9c2d-1a5b8e3f7d4c" \ -H "Content-Type: application/json" \ -d '{ "name": "Bob Kim", "email": "bob@acme.com", "salary_usd_cents": 600000 }'Empty
{
"error": {
"code": "DOMAIN_NOT_ALLOWED",
"message": "Email domain 'gmail.com' is not in the organization's allowed domain list.",
"details": {
"email": "bob@gmail.com",
"domain": "gmail.com",
"allowed_domains": [
"acme.com",
"acme.xyz"
]
},
"recovery_hint": "Use an email with an allowed domain, or add the domain in Settings → Allowed Domains."
}
}