{"openapi":"3.1.0","info":{"title":"POST /api/v1/advisory-firms/{firm_id}/users/invite","version":"1.0.0","description":"Invite a staff member to the firm"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/advisory-firms/{firm_id}/users/invite":{"post":{"tags":["advisory-firms"],"summary":"Invite a staff member to the firm","description":"Invite a user by email to join the firm as staff (admin or member). If the user already exists they are added immediately; otherwise an invitation email is sent and they are added on signup. Owner role cannot be assigned via invitation.","operationId":"invite_staff_to_firm_api_v1_advisory_firms__firm_id__users_invite_post","parameters":[{"name":"firm_id","in":"path","required":true,"schema":{"type":"string","title":"Firm Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteStaffRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteStaffResponse"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"409":{"description":"Conflict - Resource already exists","content":{"application/json":{"example":{"detail":"Resource already exists"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"InviteStaffRequest":{"properties":{"email":{"type":"string","title":"Email","description":"Email address of the person to invite."},"role":{"type":"string","enum":["admin","member"],"title":"Role","description":"Role to assign: 'admin' or 'member'. Owner cannot be invited.","default":"member"},"first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Name","description":"Optional first name to personalize the invitation."},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Name","description":"Optional last name to personalize the invitation."},"message":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Message","description":"Optional personal message from the inviter included in the email."},"business_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Business Ids","description":"For 'member' role: explicit list of businesses the invitee should be assigned to on acceptance. Ignored for 'admin' (admins see every firm business)."},"team_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Team Id","description":"For 'member' role: team to add the invitee to on acceptance. Mutually exclusive with 'business_ids' and 'assign_all_firm_businesses'."},"assign_all_firm_businesses":{"type":"boolean","title":"Assign All Firm Businesses","description":"For 'member' role: if true, grant the invitee direct assignment to every currently active firm business on acceptance.","default":false}},"type":"object","required":["email"],"title":"InviteStaffRequest","description":"Request schema for inviting a staff user to a firm.","example":{"business_ids":["b1111111-1111-1111-1111-111111111111"],"email":"staff@example.com","role":"member"}},"InviteStaffResponse":{"properties":{"status":{"type":"string","title":"Status","description":"'added' if user existed and was added, 'invited' if invitation email was sent."},"reason":{"anyOf":[{"type":"string","enum":["clerk_confirmed","new_user","needs_clerk_signup","clerk_unavailable"]},{"type":"null"}],"title":"Reason","description":"Why this branch was chosen. Lets the UI render the right confirmation message without parsing 'message'."},"message":{"type":"string","title":"Message"},"email_sent":{"type":"boolean","title":"Email Sent","description":"Whether the notification email was sent successfully.","default":true}},"type":"object","required":["status","message"],"title":"InviteStaffResponse","description":"Response schema for a staff invitation."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Token","description":"API token authentication. Format: `Bearer dz_...`"}}},"security":[{"BearerAuth":[]}]}