Skip to main content
POST
/
api
/
v3
/
mobile
/
invitation
/
sendInvitation
Send team invitation
curl --request POST \
  --url https://app.thareja.ai/api/v3/mobile/invitation/sendInvitation \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "team_id": 1,
  "email": "john.doe@example.com",
  "role": "member",
  "job_title": "Senior Developer",
  "pay_rate": 50,
  "bill_rate": 75,
  "weekly_limit": 40,
  "pay_type": "hourly",
  "pay_period": "weekly",
  "ip": "192.168.1.1",
  "agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"
}
'
{
  "error": "team_id missing"
}

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

team_id
integer
required
The ID of the team to invite the user to.Example: 1
email
string
required
The email address of the user to invite.Example: "john.doe@example.com"
role
string
required
The role to assign to the invited user.Allowed values: "owner", "manager", "member"Example: "member"
job_title
string
required
The job title for the invited user.Example: "Senior Developer"
pay_rate
number
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
bill_rate
number
The billable rate for the user (hourly rate charged to clients).Example: 0.00
weekly_limit
number
Maximum hours per week the user can work.Example: 48
pay_type
string
default:"hourly"
Type of payment structure.Allowed values: "hourly", "fixed"Default: "hourly"Example: "hourly"
pay_period
string
default:"weekly"
Frequency of payment.Allowed values: "weekly", "bi-weekly", "twice per month", "monthly"Default: "weekly"Example: "weekly"
ip
string
IP address of the inviter (for audit trail).Example: "192.168.1.1"
agent
string
User agent string of the inviter (for audit trail).Example: "Mozilla/5.0..."

Response

success
string
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

{
  "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

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
team_id
integer<int64>
required

The ID of the team to invite the user to

Example:

1

email
string<email>
required

The email address of the user to invite

Example:

"john.doe@example.com"

role
enum<string>
required

The role to assign to the invited user

Available options:
owner,
manager,
member
Example:

"member"

job_title
string
required

The job title for the invited user

Example:

"Senior Developer"

pay_rate
number<float>

The pay rate (hourly or fixed amount depending on pay_type)

Example:

50

bill_rate
number<float>

The billable rate (hourly rate charged to clients)

Example:

75

weekly_limit
number<float>

Maximum hours per week the user can work

Example:

40

pay_type
enum<string>
default:hourly

Type of payment structure

Available options:
hourly,
fixed
Example:

"hourly"

pay_period
enum<string>
default:weekly

Frequency of payment

Available options:
weekly,
bi-weekly,
twice per month,
monthly
Example:

"weekly"

ip
string

IP address of the inviter (for audit trail)

Example:

"192.168.1.1"

agent
string

User agent string of the inviter (for audit trail)

Example:

"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"

Response

Invitation sent successfully

success
string
Example:

"invitation sent successfully"