Skip to main content
POST
https://api-dev.weir.ai/
/
org
/
invite
/
team
/
member
/
:teamId
curl -X POST 'https://api.weir.ai/org/invite/team/member/team_123456789' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -H 'x-source: console' \
  -d '{
    "firstname": "John",
    "lastname": "Doe",
    "email": "[email protected]",
    "role": "Organization_User"
  }'
{
  "data": {
    "invitationId": "inv_123456789",
    "email": "[email protected]",
    "teamId": "team_123456789",
    "role": "Organization_User",
    "status": "pending",
    "expiresAt": "2024-01-22T10:30:00Z"
  },
  "message": "Invitation sent successfully",
  "status": "success"
}

Invite Team Member

Send an invitation to a user to join a specific team in your organization.
curl -X POST 'https://api.weir.ai/org/invite/team/member/team_123456789' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -H 'x-source: console' \
  -d '{
    "firstname": "John",
    "lastname": "Doe",
    "email": "[email protected]",
    "role": "Organization_User"
  }'
{
  "data": {
    "invitationId": "inv_123456789",
    "email": "[email protected]",
    "teamId": "team_123456789",
    "role": "Organization_User",
    "status": "pending",
    "expiresAt": "2024-01-22T10:30:00Z"
  },
  "message": "Invitation sent successfully",
  "status": "success"
}

Authentication

Requires Console API authentication with bearer token and x-source: console header.

Path Parameters

teamId
string
required
Unique identifier of the team to invite the member to.

Request Body

firstname
string
required
First name of the person being invited.
lastname
string
required
Last name of the person being invited.
email
string
required
Email address of the person being invited. Must be a valid email format.
role
string
required
Role to assign to the invited member. Must be one of: “Organization_Admin”, “Organization_User”, “Team_Lead”, “Team_Member”.

Response Fields

data
object
required
Invitation data object.

Error Responses

{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid request parameters",
    "details": {
      "email": "Invalid email format",
      "role": "Invalid role specified"
    }
  },
  "status": "error"
}
{
  "error": {
    "code": "MEMBER_EXISTS",
    "message": "User is already a team member",
    "details": "This user is already a member of the team"
  },
  "status": "error"
}

Usage Examples

const inviteTeamMember = async (teamId, memberData, accessToken) => {
  try {
    const response = await fetch(`https://api.weir.ai/org/invite/team/member/${teamId}`, {
      method: 'POST',
      headers: {
        'Authorization': `Bearer ${accessToken}`,
        'Content-Type': 'application/json',
        'x-source': 'console'
      },
      body: JSON.stringify(memberData)
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data.data;
  } catch (error) {
    console.error('Invite member error:', error);
    throw error;
  }
};

// Usage
const invitation = await inviteTeamMember('team_123456789', {
  firstname: 'John',
  lastname: 'Doe',
  email: '[email protected]',
  role: 'Organization_User'
}, 'your_access_token');
console.log('Invitation sent:', invitation.invitationId);

Available Roles

Full administrative access to the organization and all teams.
Standard user access with team-specific permissions.
Lead role with team management capabilities.
Basic team member with limited permissions.

Best Practices

Validate Email

Validate email format before sending invitations.

Check Existing Members

Verify the user isn’t already a team member.

Set Appropriate Role

Assign roles based on the member’s responsibilities.

Track Invitations

Monitor invitation status and send reminders if needed.
Pro Tip: Invitations typically expire in 7 days. Implement email reminders for pending invitations to increase acceptance rates.