Overview
Send an invitation to a user to join a team. This endpoint allows team owners and managers to invite new members, set their roles, and configure payment and time tracking settings.
Request Body
The ID of the team to invite the user to. Example: 1
The email address of the user to invite. Example: "john.doe@example.com"
The role to assign to the invited user. Allowed values: "owner", "manager", "member"Example: "member"
The job title for the invited user. Example: "Senior Developer"
The pay rate for the user. Interpretation depends on pay_type.
If pay_type is "hourly": hourly rate
If pay_type is "fixed": fixed amount per pay period
Example: 0.00
The billable rate for the user (hourly rate charged to clients). Example: 0.00
Maximum hours per week the user can work. Example: 48
Type of payment structure. Allowed values: "hourly", "fixed"Default: "hourly"Example: "hourly"
Frequency of payment. Allowed values: "weekly", "bi-weekly", "twice per month", "monthly"Default: "weekly"Example: "weekly"
IP address of the inviter (for audit trail). Example: "192.168.1.1"
User agent string of the inviter (for audit trail). Example: "Mozilla/5.0..."
Response
Success message confirming the invitation was sent.
Example Request
curl --request POST \
--url https://staging.thareja.org/api/v3/team/sendInvitation \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"team_id": 1,
"email": "john.doe@example.com",
"role": "member",
"job_title": "Senior Developer",
"pay_rate": 50.00,
"bill_rate": 75.00,
"weekly_limit": 40,
"pay_type": "hourly",
"pay_period": "weekly"
}'
Example Request (JavaScript)
fetch ( 'https://staging.thareja.org/api/v3/team/sendInvitation' , {
method: 'POST' ,
headers: {
'Authorization' : 'Bearer YOUR_API_TOKEN' ,
'Content-Type' : 'application/json'
},
body: JSON . stringify ({
team_id: 1 ,
email: "john.doe@example.com" ,
role: "member" ,
job_title: "Senior Developer" ,
pay_rate: 50.00 ,
bill_rate: 75.00 ,
weekly_limit: 40 ,
pay_type: "hourly" ,
pay_period: "weekly"
})
})
. then ( response => response . json ())
. then ( data => console . log ( data ));
Example Response
{
"success" : "invitation sent successfully"
}
Example Request - Fixed Pay Type
For monthly fixed salary:
curl --request POST \
--url https://staging.thareja.org/api/v3/team/sendInvitation \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"team_id": 1,
"email": "jane.smith@example.com",
"role": "member",
"job_title": "Project Manager",
"pay_rate": 8000.00,
"bill_rate": 100.00,
"weekly_limit": 40,
"pay_type": "fixed",
"pay_period": "monthly"
}'
Error Responses
403 Forbidden - Missing Team ID
403 Forbidden - Permission Denied
401 Unauthorized
404 Not Found - Team Not Found
400 Bad Request - Invalid Email
400 Bad Request - Invalid Role
{
"error" : "team_id missing"
}
Pay Rate Calculations
When pay_type is "fixed", the system automatically calculates an hourly rate based on the pay period:
Weekly : hourly_rate = pay_rate / 40
Bi-weekly : hourly_rate = pay_rate / 80
Twice per month : hourly_rate = pay_rate / 80
Monthly : hourly_rate = pay_rate / 160
This hourly rate is used for time tracking and reporting purposes.
Notes
Permissions required : Only team owners and managers can send invitations
Team features : The invitation process depends on your team’s feature settings (sends email invitations or adds members directly)
Currency : Default currency is USD for all payment calculations
Time tracking : Weekly limits and allowed working days are automatically configured for the invited user
Pending status : Invitations are created with “pending” status until the user accepts
Terms agreement : If your workspace has terms and conditions, they are automatically accepted on behalf of the inviter
Audit trail : IP address and user agent can be provided for security and audit purposes
Payment configuration : Payment settings include pay rate, bill rate, pay type, and pay period
Time tracking limits : Weekly limits and daily tracking preferences are configured automatically
Default working days : All days (Sunday-Saturday) are enabled by default
Bearer authentication header of the form Bearer <token> , where <token> is your auth token.
The ID of the team to invite the user to
The email address of the user to invite
The role to assign to the invited user
Available options:
owner,
manager,
member
The job title for the invited user
The pay rate (hourly or fixed amount depending on pay_type)
The billable rate (hourly rate charged to clients)
Maximum hours per week the user can work
pay_type
enum<string>
default: hourly
Type of payment structure
Available options:
hourly,
fixed
pay_period
enum<string>
default: weekly
Available options:
weekly,
bi-weekly,
twice per month,
monthly
IP address of the inviter (for audit trail)
User agent string of the inviter (for audit trail)
Example: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"
Invitation sent successfully
Example: "invitation sent successfully"